main() {
  int hi = 5, lo = 4;
  printf("%d,%d\n", (hi + lo) / 2, (hi + lo) >> 1);
  int a[5] = {1, 2, 3, 4, 5};
  int *ap[5];
  int **p;
  int i = 0;
  printf("address a = %d,a+1 = %d\n", a, a + 1);
  printf("sizeof *p = %d,sizeof ap = %d\n", sizeof *p, sizeof ap);
  for (; i < 5; i++) {
    printf("p=%d,*p = %d,*p+1 = %d,", p, *p, *p + 1);
    *p = &a[i];
    (*p)++;
    printf("v = %-3d\n", *(*p - 1));
    ap[i] = &a[i];
    printf("ap=%d,ap[] = %d,ap+1 = %d,", ap, *(ap + i), ap + 1);
    printf("v = %-3d\n", **(ap + i));
  }
  printf("\nhello world\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
sar    $0x1,%edx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xf35(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xf32(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xf30(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x5c(%rbp)
lea    -0x20(%rbp),%rsi
lea    -0x20(%rbp),%rdx
add    $0x4,%rdx
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
mov    $0x8,%esi
mov    $0x28,%edx
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x5,-0x5c(%rbp)
jge    1278 <main+0x168>
mov    -0x58(%rbp),%rsi
mov    -0x58(%rbp),%rax
mov    (%rax),%rdx
mov    -0x58(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x5c(%rbp),%rax
lea    -0x20(%rbp),%rcx
shl    $0x2,%rax
add    %rax,%rcx
mov    -0x58(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x58(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x58(%rbp),%rax
mov    (%rax),%rax
mov    -0x4(%rax),%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x5c(%rbp),%rax
lea    -0x20(%rbp),%rcx
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x5c(%rbp),%rax
mov    %rcx,-0x50(%rbp,%rax,8)
lea    -0x50(%rbp),%rsi
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdx
lea    -0x50(%rbp),%rcx
add    $0x8,%rcx
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x5c(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rax
mov    (%rax),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11ac <main+0x9c>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    $0x4,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xf3e(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xf23(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x4(%rsp),%rdx
lea    0xeba(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x8,%esi
mov    $0x28,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%d,%d\0A\00"
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str.1 = [25 x i8] c"address a = %d,a+1 = %d\0A\00"
@.str.2 = [31 x i8] c"sizeof *p = %d,sizeof ap = %d\0A\00"
@.str.3 = [24 x i8] c"p=%d,*p = %d,*p+1 = %d,\00"
@.str.4 = [10 x i8] c"v = %-3d\0A\00"
@.str.5 = [27 x i8] c"ap=%d,ap[] = %d,ap+1 = %d,\00"
@.str.6 = [14 x i8] c"\0Ahello world\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = alloca [5 x i32*]
%6 = alloca i32**
%7 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 4, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = sdiv i32 %10, 2
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
%15 = ashr i32 %14, 1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %15)
%17 = bitcast [5 x i32]* %4 to i8*
store i32 0, i32* %7
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%20 = getelementptr inbounds i32, i32* %19, i64 1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32* %18, i32* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i64 8, i64 40)
br label %23
23: ; preds = %68, %0
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 5
br i1 %25, label %26, label %71
26: ; preds = %23
%27 = load i32**, i32*** %6
%28 = load i32**, i32*** %6
%29 = load i32*, i32** %28
%30 = load i32**, i32*** %6
%31 = load i32*, i32** %30
%32 = getelementptr inbounds i32, i32* %31, i64 1
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32** %27, i32* %29, i32* %32)
%34 = load i32, i32* %7
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %35
%37 = load i32**, i32*** %6
store i32* %36, i32** %37
%38 = load i32**, i32*** %6
%39 = load i32*, i32** %38
%40 = getelementptr inbounds i32, i32* %39, i32 1
store i32* %40, i32** %38
%41 = load i32**, i32*** %6
%42 = load i32*, i32** %41
%43 = getelementptr inbounds i32, i32* %42, i64 -1
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %44)
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %47
%49 = load i32, i32* %7
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [5 x i32*], [5 x i32*]* %5, i64 0, i64 %50
store i32* %48, i32** %51
%52 = getelementptr inbounds [5 x i32*], [5 x i32*]* %5, i64 0, i64 0
%53 = getelementptr inbounds [5 x i32*], [5 x i32*]* %5, i64 0, i64 0
%54 = load i32, i32* %7
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32*, i32** %53, i64 %55
%57 = load i32*, i32** %56
%58 = getelementptr inbounds [5 x i32*], [5 x i32*]* %5, i64 0, i64 0
%59 = getelementptr inbounds i32*, i32** %58, i64 1
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i32** %52, i32* %57, i32** %59)
%61 = getelementptr inbounds [5 x i32*], [5 x i32*]* %5, i64 0, i64 0
%62 = load i32, i32* %7
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32*, i32** %61, i64 %63
%65 = load i32*, i32** %64
%66 = load i32, i32* %65
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %66)
br label %68
68: ; preds = %26
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %23
71: ; preds = %23
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d,%d\0A\00"
@__const.main.a = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
@.str.1 = [25 x i8] c"address a = %d,a+1 = %d\0A\00"
@.str.2 = [31 x i8] c"sizeof *p = %d,sizeof ap = %d\0A\00"
@.str.3 = [24 x i8] c"p=%d,*p = %d,*p+1 = %d,\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4, i32 4)
%3 = bitcast [5 x i32]* %1 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i64 8, i64 40)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32** undef, i32* undef, i32* poison)
unreachable
}