xunge/DecIR huggingface dataset:
int getprime(int n) {
  int m, p;
  for (m = n | 1;; m += 2) {
    for (p = 3;; p += 2) {
      if (p * p > m)
        return m;
      if (0 == m % p)
        break;
    }
  }
}


x86 assembly (clang, -O0):
<getprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    112c <getprime+0x2c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    1142 <getprime+0x42>
jmp    1155 <getprime+0x55>
jmp    1147 <getprime+0x47>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <getprime+0x17>
jmp    115a <getprime+0x5a>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1110 <getprime+0x10>

x86 assembly (clang, -O2):
<getprime>:
or     $0x1,%edi
cmp    $0x9,%edi
jge    110b <getprime+0xb>
mov    %edi,%eax
ret
mov    $0x3,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
add    $0x2,%ecx
test   %edx,%edx
je     1127 <getprime+0x27>
mov    %ecx,%eax
imul   %ecx,%eax
cmp    %edi,%eax
jle    1110 <getprime+0x10>
jmp    1108 <getprime+0x8>
add    $0x2,%edi
mov    $0x3,%ecx
jmp    1110 <getprime+0x10>

LLVM IR (-O0):
define i32 @getprime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = or i32 %5, 1
store i32 %6, i32* %3
br label %7
7: ; preds = %27, %1
store i32 3, i32* %4
br label %8
8: ; preds = %23, %7
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = load i32, i32* %3
ret i32 %15
16: ; preds = %8
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = srem i32 %17, %18
%20 = icmp eq i32 0, %19
br i1 %20, label %21, label %22
21: ; preds = %16
br label %26
22: ; preds = %16
br label %23
23: ; preds = %22
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 2
store i32 %25, i32* %4
br label %8
26: ; preds = %21
br label %27
27: ; preds = %26
%28 = load i32, i32* %3
%29 = add nsw i32 %28, 2
store i32 %29, i32* %3
br label %7
}

LLVM IR (-O2):
define i32 @getprime(i32 %0) {
%2 = or i32 %0, 1
%3 = icmp slt i32 %2, 9
br i1 %3, label %9, label %4
4: ; preds = %1, %16
%5 = phi i32 [ %17, %16 ], [ %2, %1 ]
br label %11
6: ; preds = %11
%7 = mul nsw i32 %15, %15
%8 = icmp sgt i32 %7, %5
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = phi i32 [ %2, %1 ], [ %5, %6 ]
ret i32 %10
11: ; preds = %4, %6
%12 = phi i32 [ 3, %4 ], [ %15, %6 ]
%13 = srem i32 %5, %12
%14 = icmp eq i32 %13, 0
%15 = add nuw nsw i32 %12, 2
br i1 %14, label %16, label %6
16: ; preds = %11
%17 = add nsw i32 %5, 2
br label %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ vt_write_hex_4(int);
void vt_write_hex_8(uint8_t value) {
  vt_write_hex_4(value >> 4);
  vt_write_hex_4(value >> 0);
}


x86 assembly (clang, -O0):
<vt_write_hex_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x4,%edi
call   1030 <vt_write_hex_4@plt>
mov    -0x4(%rbp),%edi
sar    $0x0,%edi
call   1030 <vt_write_hex_4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_write_hex_8>:
push   %rbx
mov    %edi,%ebx
sar    $0x4,%edi
call   1030 <vt_write_hex_4@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <vt_write_hex_4@plt>

LLVM IR (-O0):
define void @vt_write_hex_8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = call i32 @vt_write_hex_4(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 0
%8 = call i32 @vt_write_hex_4(i32 %7)
ret void
}

LLVM IR (-O2):
define void @vt_write_hex_8(i32 %0) {
%2 = ashr i32 %0, 4
%3 = tail call i32 @vt_write_hex_4(i32 %2)
%4 = tail call i32 @vt_write_hex_4(i32 %0)
ret void
}
int reverse(int n) {
  int r = 0;
  while (n > 0) {
    r = 10 * r + (n % 10);
    n /= 10;
  }
  return r;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1145 <reverse+0x45>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <reverse+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 10, %8
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
%12 = add nsw i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = sdiv i32 %13, 10
store i32 %14, i32* %2
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = urem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
int c_ones4(unsigned int x) {
  int result = 0;
  while (x != 0) {
    ++result;
    x &= x - 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<c_ones4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <c_ones4+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    110e <c_ones4+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_ones4>:
xor    %eax,%eax
test   %edi,%edi
je     111c <c_ones4+0x1c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%eax
lea    -0x1(%rdi),%ecx
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <c_ones4+0x10>
ret

LLVM IR (-O0):
define i32 @c_ones4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %2
%11 = sub i32 %10, 1
%12 = load i32, i32* %2
%13 = and i32 %12, %11
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @c_ones4(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %5, -1
%8 = and i32 %7, %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %11
}
/* Variables and functions */
char *print_vfpu_reg(int, int, char, char, char *);
char *print_vfpumpair(int reg, char *output) {
  if ((reg >> 6) & 1) {
    return print_vfpu_reg(reg, 2, 'M', 'E', output);
  } else {
    return print_vfpu_reg(reg, 0, 'M', 'E', output);
  }
}


x86 assembly (clang, -O0):
<print_vfpumpair>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x6,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1155 <print_vfpumpair+0x45>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%r8
mov    $0x2,%esi
mov    $0x4d,%edx
mov    $0x45,%ecx
call   1030 <print_vfpu_reg@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <print_vfpumpair+0x61>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%r8
xor    %esi,%esi
mov    $0x4d,%edx
mov    $0x45,%ecx
call   1030 <print_vfpu_reg@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_vfpumpair>:
mov    %rsi,%r8
mov    %edi,%esi
shr    $0x5,%esi
and    $0x2,%esi
mov    $0x4d,%edx
mov    $0x45,%ecx
jmp    1030 <print_vfpu_reg@plt>

LLVM IR (-O0):
define i8* @print_vfpumpair(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = ashr i32 %6, 6
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = call i8* @print_vfpu_reg(i32 %11, i32 2, i8 signext 77, i8 signext 69, i8* %12)
store i8* %13, i8** %3
br label %18
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i8*, i8** %5
%17 = call i8* @print_vfpu_reg(i32 %15, i32 0, i8 signext 77, i8 signext 69, i8* %16)
store i8* %17, i8** %3
br label %18
18: ; preds = %14, %10
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @print_vfpumpair(i32 %0, i8* %1) {
%3 = lshr i32 %0, 5
%4 = and i32 %3, 2
%5 = tail call i8* @print_vfpu_reg(i32 %0, i32 %4, i8 signext 77, i8 signext 69, i8* %1)
ret i8* %5
}
int get_min_count(int object_count) {
  if (object_count == 3)
    return 100;
  else if (object_count == 4)
    return 1000;
  else if (object_count == 5)
    return 10000;
  else if (object_count == 6)
    return 100000;
  else if (object_count == 7)
    return 1000000;
  else if (object_count == 8)
    return 10000000;
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_min_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    111d <get_min_count+0x1d>
movl   $0x64,-0x4(%rbp)
jmp    1192 <get_min_count+0x92>
cmpl   $0x4,-0x8(%rbp)
jne    1133 <get_min_count+0x33>
movl   $0x3e8,-0x4(%rbp)
jmp    1192 <get_min_count+0x92>
cmpl   $0x5,-0x8(%rbp)
jne    1149 <get_min_count+0x49>
movl   $0x2710,-0x4(%rbp)
jmp    1192 <get_min_count+0x92>
cmpl   $0x6,-0x8(%rbp)
jne    115f <get_min_count+0x5f>
movl   $0x186a0,-0x4(%rbp)
jmp    1192 <get_min_count+0x92>
cmpl   $0x7,-0x8(%rbp)
jne    1175 <get_min_count+0x75>
movl   $0xf4240,-0x4(%rbp)
jmp    1192 <get_min_count+0x92>
cmpl   $0x8,-0x8(%rbp)
jne    118b <get_min_count+0x8b>
movl   $0x989680,-0x4(%rbp)
jmp    1192 <get_min_count+0x92>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_min_count>:
add    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     1117 <get_min_count+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_min_count(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 3
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 100, i32* %2
br label %28
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1000, i32* %2
br label %28
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 5
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 10000, i32* %2
br label %28
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 6
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 100000, i32* %2
br label %28
19: ; preds = %15
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 7
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 1000000, i32* %2
br label %28
23: ; preds = %19
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 8
br i1 %25, label %26, label %27
26: ; preds = %23
store i32 10000000, i32* %2
br label %28
27: ; preds = %23
store i32 0, i32* %2
br label %28
28: ; preds = %27, %26, %22, %18, %14, %10, %6
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@switch.table.get_min_count = [6 x i32] [i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000]
define i32 @get_min_count(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.get_min_count, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
int at_debugger_breakpoint(struct pt_regs *regs) { return 0; }


x86 assembly (clang, -O0):
<at_debugger_breakpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_debugger_breakpoint>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.pt_regs = type opaque
define i32 @at_debugger_breakpoint(%struct.pt_regs* %0) {
%2 = alloca %struct.pt_regs*
store %struct.pt_regs* %0, %struct.pt_regs** %2
ret i32 0
}

LLVM IR (-O2):
%struct.pt_regs = type opaque
define i32 @at_debugger_breakpoint(%struct.pt_regs* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void kotlinclib_print_char(char message) { printf("%c", message); }


x86 assembly (clang, -O0):
<kotlinclib_print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kotlinclib_print_char>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @kotlinclib_print_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @kotlinclib_print_char(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
void ff_hevc_put_hevc_uni_w_qpel_v32_12_sse4() {}


x86 assembly (clang, -O0):
<ff_hevc_put_hevc_uni_w_qpel_v32_12_sse4>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff_hevc_put_hevc_uni_w_qpel_v32_12_sse4>:
ret

LLVM IR (-O0):
define void @ff_hevc_put_hevc_uni_w_qpel_v32_12_sse4() {
ret void
}

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_v32_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int const, char *, int);
int /*<<< orphan*/ unset_uikey(char *);
void unbind_key(int c) {
  const int ssize = 17;
  char s[ssize];
  snprintf(s, ssize, "%x", c);
  unset_uikey(s);
}


x86 assembly (clang, -O0):
<unbind_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x11,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
lea    -0x30(%rbp),%rdi
mov    $0x11,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <unset_uikey@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unbind_key>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x11,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <unset_uikey@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%x\00"
define void @unbind_key(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
store i32 17, i32* %3
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %4
%6 = alloca i8, i64 17
%7 = load i32, i32* %2
%8 = call i32 @snprintf(i8* %6, i32 17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @unset_uikey(i8* %6)
%10 = load i8*, i8** %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
define void @unbind_key(i32 %0) {
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @unset_uikey(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int zhputs(char *str) {
  puts(str);
  return 0;
}


x86 assembly (clang, -O0):
<zhputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zhputs>:
push   %rax
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @zhputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @puts(i8* %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @zhputs(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret i32 0
}
int vrrp_ip4_setsockopt(__attribute__((unused)) int sock_fd,
                        __attribute__((unused)) int vrid) {
  return 0;
}


x86 assembly (clang, -O0):
<vrrp_ip4_setsockopt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrrp_ip4_setsockopt>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @vrrp_ip4_setsockopt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @vrrp_ip4_setsockopt(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_value;
typedef int /*<<< orphan*/ sqlite3_context;

/* Variables and functions */
int /*<<< orphan*/ EVP_sha1();
int /*<<< orphan*/ sqlite3_digest_type(int /*<<< orphan*/ *, int,
                                       int /*<<< orphan*/ **,
                                       int /*<<< orphan*/);
void sqlite3_digest_sha1(sqlite3_context *context, int argc,
                         sqlite3_value **argv) {
  sqlite3_digest_type(context, argc, argv, EVP_sha1());
}


x86 assembly (clang, -O0):
<sqlite3_digest_sha1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <EVP_sha1@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1040 <sqlite3_digest_type@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_digest_sha1>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <EVP_sha1@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sqlite3_digest_type@plt>

LLVM IR (-O0):
define void @sqlite3_digest_sha1(i32* %0, i32 %1, i32** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32** %2, i32*** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32**, i32*** %6
%10 = call i32 (...) @EVP_sha1()
%11 = call i32 @sqlite3_digest_type(i32* %7, i32 %8, i32** %9, i32 %10)
ret void
}

LLVM IR (-O2):
define void @sqlite3_digest_sha1(i32* %0, i32 %1, i32** %2) {
%4 = tail call i32 (...) @EVP_sha1()
%5 = tail call i32 @sqlite3_digest_type(i32* %0, i32 %1, i32** %2, i32 %4)
ret void
}
void ccuEnableSlices(const unsigned int slices) {
  (*((volatile unsigned int *const)(0x48040000 + 0x0008))) = (1 << 9);
  (*((volatile unsigned int *const)(0x48040000 + 0x000c))) = (1 << 8) | slices;
}


x86 assembly (clang, -O0):
<ccuEnableSlices>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x48040008,%eax
movl   $0x200,(%rax)
mov    -0x4(%rbp),%ecx
or     $0x100,%ecx
mov    $0x4804000c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccuEnableSlices>:
movl   $0x200,0x48040008
or     $0x100,%edi
mov    %edi,0x4804000c
ret

LLVM IR (-O0):
define void @ccuEnableSlices(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store volatile i32 512, i32* inttoptr (i64 1208221704 to i32*)
%3 = load i32, i32* %2
%4 = or i32 256, %3
store volatile i32 %4, i32* inttoptr (i64 1208221708 to i32*)
ret void
}

LLVM IR (-O2):
define void @ccuEnableSlices(i32 %0) {
store volatile i32 512, i32* inttoptr (i64 1208221704 to i32*)
%2 = or i32 %0, 256
store volatile i32 %2, i32* inttoptr (i64 1208221708 to i32*)
ret void
}
/* Variables and functions */
int strlen(char *);
void string_chomp(char *buffer) {
  int pos;
  char *c;
  pos = strlen(buffer);
  c = &buffer[pos];
  while (1) {
    c--;
    if ((*c == '\n') || (*c == '\r')) {
      *c = 0;
    } else {
      break;
    }
  }
}


x86 assembly (clang, -O0):
<string_chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1163 <string_chomp+0x53>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    116f <string_chomp+0x5f>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
jmp    1174 <string_chomp+0x64>
jmp    1179 <string_chomp+0x69>
jmp    1137 <string_chomp+0x27>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xffffffffffffffff,%rax
jmp    1137 <string_chomp+0x27>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
movzbl (%rax),%ecx
cmp    $0xd,%cl
je     1130 <string_chomp+0x20>
cmp    $0xa,%cl
je     1130 <string_chomp+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @string_chomp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i8*, i8** %2
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8* %10, i8** %4
br label %11
11: ; preds = %1, %26
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 -1
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 10
br i1 %17, label %23, label %18
18: ; preds = %11
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 13
br i1 %22, label %23, label %25
23: ; preds = %18, %11
%24 = load i8*, i8** %4
store i8 0, i8* %24
br label %26
25: ; preds = %18
br label %27
26: ; preds = %23
br label %11
27: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @string_chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %9, %1
%6 = phi i8* [ %4, %1 ], [ %7, %9 ]
%7 = getelementptr inbounds i8, i8* %6, i64 -1
%8 = load i8, i8* %7
switch i8 %8, label %10 [
i8 10, label %9
i8 13, label %9
]
9: ; preds = %5, %5
store i8 0, i8* %7
br label %5
10: ; preds = %5
ret void
}
/* Type definitions */
struct pull_down_menu {
  int dummy;
};

/* Variables and functions */
int pull_down_menu_add_column_internal(struct pull_down_menu *, char *, int);
int pull_down_menu_add_column(struct pull_down_menu *m, char *column) {
  return pull_down_menu_add_column_internal(m, column, 1);
}


x86 assembly (clang, -O0):
<pull_down_menu_add_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <pull_down_menu_add_column_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pull_down_menu_add_column>:
mov    $0x1,%edx
jmp    1030 <pull_down_menu_add_column_internal@plt>

LLVM IR (-O0):
%struct.pull_down_menu = type { i32 }
define i32 @pull_down_menu_add_column(%struct.pull_down_menu* %0, i8* %1) {
%3 = alloca %struct.pull_down_menu*
%4 = alloca i8*
store %struct.pull_down_menu* %0, %struct.pull_down_menu** %3
store i8* %1, i8** %4
%5 = load %struct.pull_down_menu*, %struct.pull_down_menu** %3
%6 = load i8*, i8** %4
%7 = call i32 @pull_down_menu_add_column_internal(%struct.pull_down_menu* %5, i8* %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.pull_down_menu = type { i32 }
define i32 @pull_down_menu_add_column(%struct.pull_down_menu* %0, i8* %1) {
%3 = tail call i32 @pull_down_menu_add_column_internal(%struct.pull_down_menu* %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dis_GpG_to_ffsol();
int /*<<< orphan*/ dis_print_PERT_ffsol(char *);
void dis_print_PERT_GpG(char *fact_file_name) {
  dis_GpG_to_ffsol();
  dis_print_PERT_ffsol(fact_file_name);
}


x86 assembly (clang, -O0):
<dis_print_PERT_GpG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dis_GpG_to_ffsol@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dis_print_PERT_ffsol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dis_print_PERT_GpG>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dis_GpG_to_ffsol@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <dis_print_PERT_ffsol@plt>

LLVM IR (-O0):
define void @dis_print_PERT_GpG(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @dis_GpG_to_ffsol()
%4 = load i8*, i8** %2
%5 = call i32 @dis_print_PERT_ffsol(i8* %4)
ret void
}

LLVM IR (-O2):
define void @dis_print_PERT_GpG(i8* %0) {
%2 = tail call i32 (...) @dis_GpG_to_ffsol()
%3 = tail call i32 @dis_print_PERT_ffsol(i8* %0)
ret void
}
int blk_oversized_queue_1(int *q) {
  if (q[2])
    return q[1] > 5;
  return (q[0] > 5);
}


x86 assembly (clang, -O0):
<blk_oversized_queue_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
je     112e <blk_oversized_queue_1+0x2e>
mov    -0x10(%rbp),%rax
cmpl   $0x5,0x4(%rax)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1140 <blk_oversized_queue_1+0x40>
mov    -0x10(%rbp),%rax
cmpl   $0x5,(%rax)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blk_oversized_queue_1>:
xor    %ecx,%ecx
cmpl   $0x0,0x8(%rdi)
setne  %cl
xor    %eax,%eax
cmpl   $0x6,(%rdi,%rcx,4)
setge  %al
ret

LLVM IR (-O0):
define i32 @blk_oversized_queue_1(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 2
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = icmp sgt i32 %11, 5
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %20
14: ; preds = %1
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
%18 = icmp sgt i32 %17, 5
%19 = zext i1 %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %14, %8
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @blk_oversized_queue_1(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = getelementptr i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 5
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned long strlen(char *);
void ICPrintLengthString(char *string) {
  unsigned long strLength;
  if (string[strLength = strlen(string)] == '\0') {
    printf("String length = %lu\n", strLength);
  } else {
    printf("String is not null-terminated\n");
  }
}


x86 assembly (clang, -O0):
<ICPrintLengthString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,-0x10(%rbp)
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    116c <ICPrintLengthString+0x4c>
mov    -0x10(%rbp),%rsi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    117a <ICPrintLengthString+0x5a>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICPrintLengthString>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmpb   $0x0,(%rbx,%rax,1)
je     114c <ICPrintLengthString+0x1c>
lea    0xecf(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xead(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"String length = %lu\0A\00"
@.str.1 = [31 x i8] c"String is not null-terminated\0A\00"
define void @ICPrintLengthString(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %12)
br label %16
14: ; preds = %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"String length = %lu\0A\00"
@str = [30 x i8] c"String is not null-terminated\00"
define void @ICPrintLengthString(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %10
8: ; preds = %1
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
ret void
}
void emit_type_definition_sigma(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_type_definition_sigma>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_type_definition_sigma>:
ret

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_sigma(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_sigma(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ local_gethostbyname(char *);
int main(int argc, char **argv) {
  while (--argc) {
    local_gethostbyname(*++argv);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1155 <main+0x45>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <local_gethostbyname@plt>
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x1,%edi
je     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <local_gethostbyname@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %12
%14 = call i32 @local_gethostbyname(i8* %13)
br label %6
15: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = icmp eq i32 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @local_gethostbyname(i8* %9)
%11 = add nsw i32 %6, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i32 0
}
int fun369() { return 369; }


x86 assembly (clang, -O0):
<fun369>:
push   %rbp
mov    %rsp,%rbp
mov    $0x171,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun369>:
mov    $0x171,%eax
ret

LLVM IR (-O0):
define i32 @fun369() {
ret i32 369
}

LLVM IR (-O2):
define i32 @fun369() {
ret i32 369
}
int main() {
  char c;
  c = 'mother';
  printf("%s -> %s", c, toupper(c));
  c = 'D';
  printf("\n%c -> %c", c, toupper(c));
  c = '9';
  printf("\n%c -> %c", c, toupper(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x72,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x44,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    -0x10(%rbp),%esi
mov    %eax,%edx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movb   $0x39,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <toupper@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x72,%edi
call   1030 <toupper@plt>
lea    0xece(%rip),%rdi
mov    $0x72,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x44,%edi
call   1030 <toupper@plt>
lea    0xeb8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x44,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x39,%edi
call   1030 <toupper@plt>
mov    %rbx,%rdi
mov    $0x39,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s -> %s\00"
@.str.1 = [10 x i8] c"\0A%c -> %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 114, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = call i32 @toupper(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %7)
store i8 68, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = call i32 @toupper(i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %13)
store i8 57, i8* %2
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = call i32 @toupper(i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %16, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s -> %s\00"
@.str.1 = [10 x i8] c"\0A%c -> %c\00"
define i32 @main() {
%1 = tail call i32 @toupper(i32 114)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 114, i32 %1)
%3 = tail call i32 @toupper(i32 68)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 68, i32 %3)
%5 = tail call i32 @toupper(i32 57)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 57, i32 %5)
ret i32 0
}
int raio_bs_null_init(struct raio_bs *dev) { return 0; }


x86 assembly (clang, -O0):
<raio_bs_null_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<raio_bs_null_init>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.raio_bs = type opaque
define i32 @raio_bs_null_init(%struct.raio_bs* %0) {
%2 = alloca %struct.raio_bs*
store %struct.raio_bs* %0, %struct.raio_bs** %2
ret i32 0
}

LLVM IR (-O2):
%struct.raio_bs = type opaque
define i32 @raio_bs_null_init(%struct.raio_bs* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int True;
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _XlibErrorHandler(Display *display, XErrorEvent *event) {
  printf("Something bad happened.", stderr);
  return True;
}


x86 assembly (clang, -O0):
<_XlibErrorHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_XlibErrorHandler>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ebb(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Something bad happened.\00"
@stderr = global i32 0
@True = global i32 0
define i32 @_XlibErrorHandler(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stderr
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @True
ret i32 %7
}

LLVM IR (-O2):
@.str = [24 x i8] c"Something bad happened.\00"
@stderr = global i32 0
@True = global i32 0
define i32 @_XlibErrorHandler(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @True
ret i32 %5
}
/* Variables and functions */
int p(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", p(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1030 <p@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <p@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @p(i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @p(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("opencl.h standalone test PASSED.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"opencl.h standalone test PASSED.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"opencl.h standalone test PASSED.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeLPC(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000002);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000004, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeLPC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%edx
mov    $0x8,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeLPC>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeLPC(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i32 @GPIODirModeSet(i64 %5, i8 zeroext %6, i32 2)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @GPIOPadConfigSet(i64 %8, i8 zeroext %9, i32 4, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeLPC(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 4, i32 8)
ret void
}
/* Variables and functions */
char *alloca(int);
int /*<<< orphan*/ strncpy(char *, char *, int);
int foo(int c) {
  char *ptr = alloca(c);
  strncpy(ptr, "hello world\n", c);
  return c;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xebb(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
call   1040 <alloca@plt>
lea    0xed1(%rip),%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @alloca(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @strncpy(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world\0A\00"
define i32 @foo(i32 returned %0) {
%2 = tail call i8* @alloca(i32 %0)
%3 = tail call i32 @strncpy(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 %0
}
/* Variables and functions */
char **_falParseBaseFontNameList() { return NULL; }


x86 assembly (clang, -O0):
<_falParseBaseFontNameList>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_falParseBaseFontNameList>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8** @_falParseBaseFontNameList() {
ret i8** null
}

LLVM IR (-O2):
define noalias i8** @_falParseBaseFontNameList() {
ret i8** null
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
void *get_mode_katcp(struct katcp_dispatch *, int /*<<< orphan*/);
void *get_state_katcp(struct katcp_dispatch *d) { return get_mode_katcp(d, 0); }


x86 assembly (clang, -O0):
<get_state_katcp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <get_mode_katcp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_state_katcp>:
xor    %esi,%esi
jmp    1030 <get_mode_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define i8* @get_state_katcp(%struct.katcp_dispatch* %0) {
%2 = alloca %struct.katcp_dispatch*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %2
%3 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %2
%4 = call i8* @get_mode_katcp(%struct.katcp_dispatch* %3, i32 0)
ret i8* %4
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define i8* @get_state_katcp(%struct.katcp_dispatch* %0) {
%2 = tail call i8* @get_mode_katcp(%struct.katcp_dispatch* %0, i32 0)
ret i8* %2
}
void radDEBUGLog(char *format, ...) { return; }


x86 assembly (clang, -O0):
<radDEBUGLog>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<radDEBUGLog>:
ret

LLVM IR (-O0):
define void @radDEBUGLog(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @radDEBUGLog(i8* nocapture %0, ...) {
ret void
}
float psquare(float a) { return (a + a + a + a); }


x86 assembly (clang, -O0):
<psquare>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<psquare>:
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
addss  %xmm0,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @psquare(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fadd float %3, %4
%6 = load float, float* %2
%7 = fadd float %5, %6
%8 = load float, float* %2
%9 = fadd float %7, %8
ret float %9
}

LLVM IR (-O2):
define float @psquare(float %0) {
%2 = fadd float %0, %0
%3 = fadd float %2, %0
%4 = fadd float %3, %0
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char, char);
void fun15(char data[3]) {
  printf("data[0] %d data[1] %d data[2] %d\n", data[0], data[1], data[2]);
}


x86 assembly (clang, -O0):
<fun15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%dl
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
lea    0xecc(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl 0x2(%rax),%ecx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun15>:
movsbl (%rdi),%esi
movsbl 0x1(%rdi),%edx
movsbl 0x2(%rdi),%ecx
lea    0xede(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"data[0] %d data[1] %d data[2] %d\0A\00"
define void @fun15(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %8, i8 signext %11)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"data[0] %d data[1] %d data[2] %d\0A\00"
define void @fun15(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext %2, i8 signext %4, i8 signext %6)
ret void
}