I'm new to ARM assembly and am trying to translate some easy code snippets from C to assembly. I'm not sure if I am using ldr and str correctly (although I feel like ive tried everything) and I keep getting seg fault when I try to run it.

The C code is

```
int main() {
    int x = 10;
    int y = 5;
    int z = 20;

    int min = y;

    if (x < min) {min = x;}
    if (z < min) {min = z;}

    return min;
}

```

My assembly code:

```
.global main
.text

main:
    push {ip, lr}

    mov r0, #10
    mov r1, #5
    mov r2, #20

    str r3, [r1]

    cmp r0, r3
    bge done
    str r0, [r3]

    cmp r2, r3
    bge done
    str r2, [r3]

done:
    ldr r0, [r3]
    pop {ip, pc}

```