int main() {
  int i = 2;
  int j = func();
  print("j  1");
  printid(j);
  j = func2(i);
  print("j  4");
  printid(j);
  func(i, &j);
  print("j  5");
  printid(j);
  i = 8;
  j = 0;
  do {
    j++;
    i--;
    if (i % 2 == 0)
      continue;
    j++;
    if (i == 1)
      break;
  } while (i != 10);
  print("j  11");
  printid(j);
  print("i  1");
  printid(i);
  for (i = 0; i < 10; i++) {
    if (i == 5)
      break;
  }
  print("i  5");
  printid(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    $0x0,%al
call   1060 <func@plt>
mov    %eax,-0xc(%rbp)
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <printid@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <func2@plt>
mov    %eax,-0xc(%rbp)
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <printid@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <func@plt>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <printid@plt>
movl   $0x8,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11fc <main+0xbc>
jmp    1219 <main+0xd9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1214 <main+0xd4>
jmp    1223 <main+0xe3>
jmp    1219 <main+0xd9>
cmpl   $0xa,-0x8(%rbp)
jne    11d1 <main+0x91>
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1040 <printid@plt>
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <printid@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1286 <main+0x146>
cmpl   $0x5,-0x8(%rbp)
jne    1273 <main+0x133>
jmp    1286 <main+0x146>
jmp    1278 <main+0x138>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    125a <main+0x11a>
lea    0xd8d(%rip),%rdi
mov    $0x0,%al
call   1030 <print@plt>
mov    $0x5,%edi
mov    $0x0,%al
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <func@plt>
mov    %eax,%ebx
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <printid@plt>
mov    $0x2,%edi
xor    %eax,%eax
call   1050 <func2@plt>
mov    %eax,%ebx
mov    %eax,0x4(%rsp)
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <printid@plt>
lea    0x4(%rsp),%rsi
mov    $0x2,%edi
xor    %eax,%eax
call   1060 <func@plt>
lea    0xe64(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
mov    0x4(%rsp),%edi
xor    %eax,%eax
call   1040 <printid@plt>
mov    $0x8,%eax
jmp    11cb <main+0x8b>
nop
add    $0x1,%ebp
cmp    $0xb,%eax
je     11e2 <main+0xa2>
add    $0xffffffff,%eax
lea    -0x1(%rax),%ebx
test   $0x1,%bl
je     11c0 <main+0x80>
add    $0x2,%ebp
cmp    $0x2,%eax
je     11e7 <main+0xa7>
cmp    $0xb,%eax
jne    11c8 <main+0x88>
jmp    11e7 <main+0xa7>
mov    $0xa,%ebx
mov    %ebp,0x4(%rsp)
lea    0xe1d(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
mov    0x4(%rsp),%edi
xor    %eax,%eax
call   1040 <printid@plt>
lea    0xe0a(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <printid@plt>
lea    0xdf8(%rip),%rdi
xor    %eax,%eax
call   1030 <print@plt>
mov    $0x5,%edi
xor    %eax,%eax
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"j 1\00"
@.str.1 = [5 x i8] c"j 4\00"
@.str.2 = [5 x i8] c"j 5\00"
@.str.3 = [6 x i8] c"j 11\00"
@.str.4 = [5 x i8] c"i 1\00"
@.str.5 = [5 x i8] c"i 5\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%4 = call i32 (...) @func()
store i32 %4, i32* %3
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %2
%9 = call i32 (i32, ...) bitcast (i32 (...)* @func2 to i32 (i32, ...)*)(i32 %8)
store i32 %9, i32* %3
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32, i32* %3
%12 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %11)
%13 = load i32, i32* %2
%14 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @func to i32 (i32, i32*, ...)*)(i32 %13, i32* %3)
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %16)
store i32 8, i32* %2
store i32 0, i32* %3
br label %18
18: ; preds = %34, %0
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
%21 = load i32, i32* %2
%22 = add nsw i32 %21, -1
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = srem i32 %23, 2
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %18
br label %34
27: ; preds = %18
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 1
store i32 %29, i32* %3
%30 = load i32, i32* %2
%31 = icmp eq i32 %30, 1
br i1 %31, label %32, label %33
32: ; preds = %27
br label %37
33: ; preds = %27
br label %34
34: ; preds = %33, %26
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 10
br i1 %36, label %18, label %37
37: ; preds = %34, %32
%38 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%39 = load i32, i32* %3
%40 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %39)
%41 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%42 = load i32, i32* %2
%43 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %42)
store i32 0, i32* %2
br label %44
44: ; preds = %52, %37
%45 = load i32, i32* %2
%46 = icmp slt i32 %45, 10
br i1 %46, label %47, label %55
47: ; preds = %44
%48 = load i32, i32* %2
%49 = icmp eq i32 %48, 5
br i1 %49, label %50, label %51
50: ; preds = %47
br label %55
51: ; preds = %47
br label %52
52: ; preds = %51
%53 = load i32, i32* %2
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
br label %44
55: ; preds = %50, %44
%56 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%57 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"j 1\00"
@.str.1 = [5 x i8] c"j 4\00"
@.str.2 = [5 x i8] c"j 5\00"
@.str.3 = [6 x i8] c"j 11\00"
@.str.4 = [5 x i8] c"i 1\00"
@.str.5 = [5 x i8] c"i 5\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @func()
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %3)
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @func2 to i32 (i32, ...)*)(i32 2)
store i32 %6, i32* %1
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %6)
%9 = call i32 (i32, i32*, ...) bitcast (i32 (...)* @func to i32 (i32, i32*, ...)*)(i32 2, i32* %1)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%11 = load i32, i32* %1
%12 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %11)
br label %13
13: ; preds = %24, %0
%14 = phi i32 [ 0, %0 ], [ %25, %24 ]
%15 = phi i32 [ 8, %0 ], [ %17, %24 ]
%16 = add nsw i32 %14, 1
%17 = add nsw i32 %15, -1
%18 = and i32 %17, 1
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %13
%21 = add nsw i32 %14, 2
switch i32 %15, label %24 [
i32 11, label %26
i32 2, label %26
]
22: ; preds = %13
%23 = icmp eq i32 %17, 10
br i1 %23, label %26, label %24
24: ; preds = %22, %20
%25 = phi i32 [ %16, %22 ], [ %21, %20 ]
br label %13
26: ; preds = %20, %20, %22
%27 = phi i32 [ %17, %20 ], [ %17, %20 ], [ 10, %22 ]
%28 = phi i32 [ %21, %20 ], [ %21, %20 ], [ %16, %22 ]
store i32 %28, i32* %1
%29 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%30 = load i32, i32* %1
%31 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %30)
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%33 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 %27)
%34 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%35 = call i32 (i32, ...) bitcast (i32 (...)* @printid to i32 (i32, ...)*)(i32 5)
ret i32 0
}