int main() {
  int *p1, *p2, *p3, a, b, c, d;
  if (c)
    p2 = &a;
  else
    p2 = &b;
  if (a)
    p3 = &c;
  else
    p3 = &d;
  p1 = p2 + 1;
  printf("%d %u", *p1, p1);
  p1 = p3 + 1;
  printf("%d %u", *p1, p1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     1136 <main+0x26>
lea    -0x24(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    113e <main+0x2e>
lea    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1155 <main+0x45>
lea    -0x2c(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115d <main+0x4d>
lea    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x4(%rsp),%r14
lea    0x8(%rsp),%rdx
lea    0xedb(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
store i32* %5, i32** %3
br label %13
12: ; preds = %0
store i32* %6, i32** %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %5
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %13
store i32* %7, i32** %4
br label %18
17: ; preds = %13
store i32* %8, i32** %4
br label %18
18: ; preds = %17, %16
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32* %20, i32** %2
%21 = load i32*, i32** %2
%22 = load i32, i32* %21
%23 = load i32*, i32** %2
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %22, i32* %23)
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32* %26, i32** %2
%27 = load i32*, i32** %2
%28 = load i32, i32* %27
%29 = load i32*, i32** %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %28, i32* %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds i32, i32* %2, i64 1
%6 = getelementptr inbounds i32, i32* %1, i64 1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 undef, i32* %6)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 undef, i32* %5)
ret i32 0
}