xunge/DecIR huggingface dataset:
void print_spaces(n) register unsigned int n;
{
  while (n-- > 0)
    putchar(' ');
}


x86 assembly (clang, -O0):
<print_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jbe    1140 <print_spaces+0x30>
mov    $0x20,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    111b <print_spaces+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spaces>:
push   %rbx
test   %edi,%edi
je     1131 <print_spaces+0x21>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_spaces+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @print_spaces(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ugt i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 32)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_spaces(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 32)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arch_local_irq_restore(unsigned long);
unsigned long arch_local_save_flags();
void arch_local_irq_enable(void) {
  unsigned long flags = arch_local_save_flags();
  flags |= 1;
  arch_local_irq_restore(flags);
}


x86 assembly (clang, -O0):
<arch_local_irq_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <arch_local_save_flags@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <arch_local_irq_restore@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_local_irq_enable>:
push   %rax
xor    %eax,%eax
call   1040 <arch_local_save_flags@plt>
or     $0x1,%rax
mov    %rax,%rdi
pop    %rax
jmp    1030 <arch_local_irq_restore@plt>

LLVM IR (-O0):
define void @arch_local_irq_enable() {
%1 = alloca i64
%2 = call i64 (...) @arch_local_save_flags()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = or i64 %3, 1
store i64 %4, i64* %1
%5 = load i64, i64* %1
%6 = call i32 @arch_local_irq_restore(i64 %5)
ret void
}

LLVM IR (-O2):
define void @arch_local_irq_enable() {
%1 = tail call i64 (...) @arch_local_save_flags()
%2 = or i64 %1, 1
%3 = tail call i32 @arch_local_irq_restore(i64 %2)
ret void
}
void atmel_atmega328_Mcu_reset__E() {}


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

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

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

LLVM IR (-O2):
define void @atmel_atmega328_Mcu_reset__E() {
ret void
}
void on_button_release(union ui_state *state, int button, int x, int y) {}


x86 assembly (clang, -O0):
<on_button_release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%union.ui_state = type opaque
define void @on_button_release(%union.ui_state* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %union.ui_state*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %union.ui_state* %0, %union.ui_state** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
%union.ui_state = type opaque
define void @on_button_release(%union.ui_state* nocapture %0, i32 %1, i32 %2, i32 %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("int 大小: %lu \n", sizeof(int));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"int \E5\A4\A7\E5\B0\8F: %lu \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"int \E5\A4\A7\E5\B0\8F: %lu \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
int test_imm_D5uint8_mem(unsigned char *val) {
  return ((*val) & (-0xD5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D5uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff2b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D5uint8_mem>:
testb  $0x2b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D5uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -213
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_D5uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 43
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int str_chr(const char *in, char needle) {
  unsigned int u = 0;
  char ch;
  while ((ch = in[u]) && ch != needle)
    u++;
  return u;
}


x86 assembly (clang, -O0):
<str_chr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
je     1143 <str_chr+0x43>
movsbl -0x11(%rbp),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1153 <str_chr+0x53>
jmp    1161 <str_chr+0x61>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1115 <str_chr+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_chr>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1120 <str_chr+0x20>
cmp    %sil,%cl
jne    1110 <str_chr+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_chr(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %11, %3 ]
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp ne i8 %7, %1
%10 = and i1 %8, %9
%11 = add i32 %4, 1
br i1 %10, label %3, label %12
12: ; preds = %3
ret i32 %4
}
int iamember(int n, int *l) {
  while (*l != -1) {
    if (*l == n)
      return 1;
    l = l + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iamember>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xffffffff,(%rax)
je     1144 <iamember+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x8(%rbp),%eax
jne    1133 <iamember+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114b <iamember+0x4b>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <iamember+0xb>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iamember>:
mov    (%rsi),%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     111f <iamember+0x1f>
add    $0x4,%rsi
nopl   (%rax)
cmp    %edi,%ecx
je     1120 <iamember+0x20>
mov    (%rsi),%ecx
add    $0x4,%rsi
cmp    $0xffffffff,%ecx
jne    1110 <iamember+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iamember(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i32, i32* %12
%7 = icmp eq i32 %6, -1
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ %3, %2 ]
%10 = phi i32* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i32 %9, %0
%12 = getelementptr inbounds i32, i32* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
unsigned int stb_bitreverse(unsigned int n) {
  n = ((n & 0xAAAAAAAA) >> 1) | ((n & 0x55555555) << 1);
  n = ((n & 0xCCCCCCCC) >> 2) | ((n & 0x33333333) << 2);
  n = ((n & 0xF0F0F0F0) >> 4) | ((n & 0x0F0F0F0F) << 4);
  n = ((n & 0xFF00FF00) >> 8) | ((n & 0x00FF00FF) << 8);
  return (n >> 16) | (n << 16);
}


x86 assembly (clang, -O0):
<stb_bitreverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaaaaaaaa,%eax
shr    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x55555555,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcccccccc,%eax
shr    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x33333333,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f0,%eax
shr    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f0f0f,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff00,%eax
shr    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
mov    -0x4(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_bitreverse>:
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%ecx
and    $0x55555555,%ecx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rcx,2),%eax
ret

LLVM IR (-O0):
define i32 @stb_bitreverse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -1431655766
%5 = lshr i32 %4, 1
%6 = load i32, i32* %2
%7 = and i32 %6, 1431655765
%8 = shl i32 %7, 1
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, -858993460
%12 = lshr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 858993459
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, -252645136
%19 = lshr i32 %18, 4
%20 = load i32, i32* %2
%21 = and i32 %20, 252645135
%22 = shl i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = and i32 %24, -16711936
%26 = lshr i32 %25, 8
%27 = load i32, i32* %2
%28 = and i32 %27, 16711935
%29 = shl i32 %28, 8
%30 = or i32 %26, %29
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = lshr i32 %31, 16
%33 = load i32, i32* %2
%34 = shl i32 %33, 16
%35 = or i32 %32, %34
ret i32 %35
}

LLVM IR (-O2):
define i32 @stb_bitreverse(i32 %0) {
%2 = tail call i32 @llvm.bitreverse.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int showHistogram(int *histogram) {
  int i;
  for (i = 0; i < 93; i++) {
    printf("%02d (%c) %d\n", i, i + '!', histogram[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<showHistogram>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5d,-0xc(%rbp)
jge    115b <showHistogram+0x4b>
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
add    $0x21,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <showHistogram+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showHistogram>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xedf(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x21(%rbx),%edx
mov    (%r14,%rbx,4),%ecx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x5d,%rbx
jne    1130 <showHistogram+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%02d (%c) %d\0A\00"
define i32 @showHistogram(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 93
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 33
%11 = load i32*, i32** %2
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %15)
br label %17
17: ; preds = %7
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"%02d (%c) %d\0A\00"
define i32 @showHistogram(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %9, %2 ]
%4 = trunc i64 %3 to i32
%5 = add nuw nsw i32 %4, 33
%6 = getelementptr inbounds i32, i32* %0, i64 %3
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %7)
%9 = add nuw nsw i64 %3, 1
%10 = icmp eq i64 %9, 93
br i1 %10, label %11, label %2
11: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ strcmp(char *, char *);
void strcmp_embedded_null() { clang_analyzer_eval(strcmp("\0z", "\0y") == 0); }


x86 assembly (clang, -O0):
<strcmp_embedded_null>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp_embedded_null>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\00z\00"
@.str.1 = [3 x i8] c"\00y\00"
define void @strcmp_embedded_null() {
%1 = call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\00z\00"
@.str.1 = [3 x i8] c"\00y\00"
define void @strcmp_embedded_null() {
%1 = tail call i64 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
unsigned int calculate_remote_timeout(unsigned int timeout) {
  return timeout / 2;
}


x86 assembly (clang, -O0):
<calculate_remote_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_remote_timeout>:
mov    %edi,%eax
shr    %eax
ret

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

LLVM IR (-O2):
define i32 @calculate_remote_timeout(i32 %0) {
%2 = lshr i32 %0, 1
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void writel(uint32_t data, void *where) { *(volatile uint32_t *)where = data; }


x86 assembly (clang, -O0):
<writel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<writel>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @writel(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
int /*<<< orphan*/ _ulltoa_internal(unsigned long long, char *,
                                    int /*<<< orphan*/);
char *_lltoa_internal(long long value, char *str, uint base) {
  char *ptr = str;
  int i = 0;
  if (value < 0) {
    ptr[i++] = '-';
    value = -value;
  }
  _ulltoa_internal((unsigned long long)value, str + i, base);
  return str;
}


x86 assembly (clang, -O0):
<_lltoa_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    115d <_lltoa_internal+0x4d>
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x24(%rbp)
movslq %ecx,%rcx
movb   $0x2d,(%rax,%rcx,1)
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
call   1030 <_ulltoa_internal@plt>
mov    -0x10(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lltoa_internal>:
push   %rbx
mov    %rsi,%rbx
test   %rdi,%rdi
js     111d <_lltoa_internal+0xd>
xor    %esi,%esi
jmp    1128 <_lltoa_internal+0x18>
movb   $0x2d,(%rbx)
neg    %rdi
mov    $0x1,%esi
add    %rbx,%rsi
call   1030 <_ulltoa_internal@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @_lltoa_internal(i64 %0, i8* returned %1, i32 %2) {
%4 = icmp slt i64 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
store i8 45, i8* %1
%6 = sub nsw i64 0, %0
br label %7
7: ; preds = %5, %3
%8 = phi i64 [ %6, %5 ], [ %0, %3 ]
%9 = phi i64 [ 1, %5 ], [ 0, %3 ]
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = tail call i32 @_ulltoa_internal(i64 %8, i8* %10, i32 %2)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ handle_47(int /*<<< orphan*/);
int gen_47() { handle_47(0); }


x86 assembly (clang, -O0):
<gen_47>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <handle_47@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_47>:
xor    %edi,%edi
jmp    1030 <handle_47@plt>

LLVM IR (-O0):
define i32 @gen_47() {
%1 = alloca i32
%2 = call i32 @handle_47(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_47() {
%1 = tail call i32 @handle_47(i32 0)
ret i32 undef
}
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
unsigned int base64_decode(unsigned char c) {
  extern const uint8_t base64_table[256];
  return base64_table[c];
}


x86 assembly (clang, -O0):
<base64_decode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,%ecx
mov    0x2ec9(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_decode>:
mov    %edi,%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@base64_table = external constant [256 x i32]
define i32 @base64_decode(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds [256 x i32], [256 x i32]* @base64_table, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
@base64_table = external constant [256 x i32]
define i32 @base64_decode(i8 zeroext %0) {
%2 = zext i8 %0 to i64
%3 = getelementptr inbounds [256 x i32], [256 x i32]* @base64_table, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getfistat1();
int /*<<< orphan*/ getfstat1();
int /*<<< orphan*/ getfstat2();
int /*<<< orphan*/ mod_ftime0();
int main() {
  mod_ftime0();
  getfstat1();
  getfstat2();
  getfistat1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <mod_ftime0@plt>
mov    $0x0,%al
call   1030 <getfstat1@plt>
mov    $0x0,%al
call   1050 <getfstat2@plt>
mov    $0x0,%al
call   1040 <getfistat1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <mod_ftime0@plt>
xor    %eax,%eax
call   1030 <getfstat1@plt>
xor    %eax,%eax
call   1050 <getfstat2@plt>
xor    %eax,%eax
call   1040 <getfistat1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mod_ftime0()
%3 = call i32 (...) @getfstat1()
%4 = call i32 (...) @getfstat2()
%5 = call i32 (...) @getfistat1()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mod_ftime0()
%2 = tail call i32 (...) @getfstat1()
%3 = tail call i32 (...) @getfstat2()
%4 = tail call i32 (...) @getfistat1()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ LOG_PERROR;
int /*<<< orphan*/ LOG_USER;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ openlog(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char *);
int main() {
  openlog("sonico", LOG_PERROR, LOG_USER);
  syslog(LOG_ERR, "example error message by %s.", "sonico");
  closelog();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xeb3(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
lea    0xe97(%rip),%rdx
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
call   1050 <openlog@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
mov    %rbx,%rdx
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sonico\00"
@LOG_PERROR = global i32 0
@LOG_USER = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [29 x i8] c"example error message by %s.\00"
define i32 @main() {
%1 = load i32, i32* @LOG_PERROR
%2 = load i32, i32* @LOG_USER
%3 = call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = load i32, i32* @LOG_ERR
%5 = call i32 @syslog(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @closelog()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"sonico\00"
@LOG_PERROR = global i32 0
@LOG_USER = global i32 0
@LOG_ERR = global i32 0
@.str.1 = [29 x i8] c"example error message by %s.\00"
define i32 @main() {
%1 = load i32, i32* @LOG_PERROR
%2 = load i32, i32* @LOG_USER
%3 = tail call i32 @openlog(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = load i32, i32* @LOG_ERR
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @closelog()
ret i32 0
}
/* Variables and functions */
double floor(double);
double ndt_mod(double y, double x) { return y - x * floor(y / x); }


x86 assembly (clang, -O0):
<ndt_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movsd  -0x20(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x18(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndt_mod>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ndt_mod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
%10 = call double @llvm.floor.f64(double %9)
%11 = fneg double %6
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double %5)
ret double %12
}

LLVM IR (-O2):
define double @ndt_mod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fneg double %1
%6 = tail call double @llvm.fmuladd.f64(double %5, double %4, double %0)
ret double %6
}
/* Variables and functions */
float __infer_nondet_float();
float cbrtf(float x) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<cbrtf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrtf>:
xor    %eax,%eax
jmp    1030 <__infer_nondet_float@plt>

LLVM IR (-O0):
define float @cbrtf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @cbrtf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
int Abc_TtSuppOnlyOne(int Supp) {
  if (Supp == 0)
    return 0;
  return (Supp & (Supp - 1)) == 0;
}


x86 assembly (clang, -O0):
<Abc_TtSuppOnlyOne>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <Abc_TtSuppOnlyOne+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1136 <Abc_TtSuppOnlyOne+0x36>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abc_TtSuppOnlyOne>:
test   %edi,%edi
je     110f <Abc_TtSuppOnlyOne+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Abc_TtSuppOnlyOne(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("helloworld\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [12 x i8] c"helloworld\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"helloworld\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float hypotf(float, float);
float __c8abs(float zreal, float zimag) { return (hypotf(zreal, zimag)); }


x86 assembly (clang, -O0):
<__c8abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <hypotf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__c8abs>:
jmp    1030 <hypotf@plt>

LLVM IR (-O0):
define float @__c8abs(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @hypotf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__c8abs(float %0, float %1) {
%3 = tail call float @hypotf(float %0, float %1)
ret float %3
}
int main() {
  int a = 0;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void gdk_gc_set_background() {}


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

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

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

LLVM IR (-O2):
define void @gdk_gc_set_background() {
ret void
}
void f5(void) {
  typedef int(*arr)[4];
  typedef arr brr[3];
  int(*(*b)[3])[4];
  brr c;
  b = &c;
  (void)b;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
lea    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f5() {
%1 = alloca [3 x [4 x i32]*]*
%2 = alloca [3 x [4 x i32]*]
store [3 x [4 x i32]*]* %2, [3 x [4 x i32]*]** %1
%3 = load [3 x [4 x i32]*]*, [3 x [4 x i32]*]** %1
ret void
}

LLVM IR (-O2):
define void @f5() {
ret void
}
int fib(int n) {
  int acc = 1;
  int i = n;
  while (i >= 2) {
    acc = fib(i - 1) + acc;
    i = i - 2;
  }
  return acc;
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jl     1151 <fib+0x41>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <fib+0x18>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1142 <fib+0x32>
mov    %edi,%ebx
add    $0x2,%ebx
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 1, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %7, %5
%9 = add nsw i32 %4, -2
%10 = icmp ugt i32 %4, 3
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 1, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ floor(int);
int /*<<< orphan*/ max_heapify(double *, int, int);
void build_max_heap(double *srcdata, int len) {
  int idx = 0;
  for (idx = (int)(floor(len / 2)); idx >= 0; idx--) {
    max_heapify(srcdata, len, idx);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <floor@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1172 <build_max_heap+0x52>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    114b <build_max_heap+0x2b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
shr    $0x1f,%edi
add    %esi,%edi
sar    %edi
call   1040 <floor@plt>
mov    %rax,%rbx
test   %ebx,%ebx
js     1151 <build_max_heap+0x31>
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebx
jb     1140 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 2
%8 = call i64 @floor(i32 %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
br label %10
10: ; preds = %18, %2
%11 = load i32, i32* %5
%12 = icmp sge i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load double*, double** %3
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @max_heapify(double* %14, i32 %15, i32 %16)
br label %18
18: ; preds = %13
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
br label %10
21: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @build_max_heap(double* %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = tail call i64 @floor(i32 %3)
%5 = trunc i64 %4 to i32
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %5, %2 ]
%9 = tail call i32 @max_heapify(double* %0, i32 %1, i32 %8)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printTime(char *, int);
char *currentTime() {
  static char timeBuf[128];
  printTime(timeBuf, 128);
  return timeBuf;
}


x86 assembly (clang, -O0):
<currentTime>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x80,%esi
call   1030 <printTime@plt>
lea    0x2f14(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentTime>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <printTime@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@currentTime.timeBuf = internal global [128 x i8] zeroinitializer
define i8* @currentTime() {
%1 = call i32 @printTime(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @currentTime.timeBuf, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @currentTime.timeBuf, i64 0, i64 0)
}

LLVM IR (-O2):
@currentTime.timeBuf = internal global [128 x i8] zeroinitializer
define i8* @currentTime() {
%1 = tail call i32 @printTime(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @currentTime.timeBuf, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @currentTime.timeBuf, i64 0, i64 0)
}
int test_imm_58uint16_reg(unsigned short val) {
  return ((val) & (0x58 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_58uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x58,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_58uint16_reg>:
test   $0x58,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_58uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 88
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_58uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 88
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
int /*<<< orphan*/ *fopen(char *, char *);
void test_fopen() {
  FILE *fp = fopen("/dev/null", "rb");
  assertTrue("fp == 0", fp == 0);
  ;
}


x86 assembly (clang, -O0):
<test_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xeba(%rip),%rdi
call   1030 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fopen>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1040 <fopen@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <assertTrue@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [8 x i8] c"fp == 0\00"
define void @test_fopen() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp eq i32* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assertTrue(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [8 x i8] c"fp == 0\00"
define void @test_fopen() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assertTrue(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int strlen(char *);
void ChompStr(char *str) {
  if (str == NULL)
    return;
  if (str[strlen(str) - 1] == '\n')
    str[strlen(str) - 1] = '\0';
}


x86 assembly (clang, -O0):
<ChompStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ChompStr+0x1c>
jmp    1177 <ChompStr+0x67>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1177 <ChompStr+0x67>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChompStr>:
push   %rbx
test   %rdi,%rdi
je     1136 <ChompStr+0x26>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1136 <ChompStr+0x26>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ChompStr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = tail call i32 @strlen(i8* %0)
%12 = add nsw i32 %11, -1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
store i8 0, i8* %14
br label %15
15: ; preds = %1, %10, %3
ret void
}
void appendHex2(char **pDstStr, int n) {
  *((*pDstStr)++) = "0123456789abcdef"[n >> 4];
  *((*pDstStr)++) = "0123456789abcdef"[n & 0xf];
  **pDstStr = 0;
}


x86 assembly (clang, -O0):
<appendHex2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0xee5(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0xebf(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendHex2>:
mov    %esi,%eax
sar    $0x4,%eax
cltq
lea    0xef2(%rip),%r8
mov    (%rax,%r8,1),%al
mov    (%rdi),%rdx
lea    0x1(%rdx),%rcx
mov    %rcx,(%rdi)
mov    %al,(%rdx)
and    $0xf,%esi
mov    (%rsi,%r8,1),%al
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
mov    (%rdi),%rax
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @appendHex2(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
store i8 %9, i8* %11
%13 = load i32, i32* %4
%14 = and i32 %13, 15
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
store i8 %17, i8* %19
%21 = load i8**, i8*** %3
%22 = load i8*, i8** %21
store i8 0, i8* %22
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"0123456789abcdef\00"
define void @appendHex2(i8** nocapture %0, i32 %1) {
%3 = ashr i32 %1, 4
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
store i8 %6, i8* %7
%9 = and i32 %1, 15
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [17 x i8], [17 x i8]* @.str, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %14, i8** %0
store i8 %12, i8* %13
%15 = load i8*, i8** %0
store i8 0, i8* %15
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ func2();
int main(int argc, char *argv[]) {
  func1();
  func2();
  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    $0x0,%al
call   1030 <func1@plt>
mov    $0x0,%al
call   1040 <func2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <func1@plt>
xor    %eax,%eax
call   1040 <func2@plt>
xor    %eax,%eax
pop    %rcx
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
%6 = call i32 (...) @func1()
%7 = call i32 (...) @func2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func1()
%4 = tail call i32 (...) @func2()
ret i32 0
}
/* Variables and functions */
scalar_t__ MQ_PRIO_MAX;
int /*<<< orphan*/ printf(char *, long);
int main(void) {
  printf("%ld\n", (long)MQ_PRIO_MAX);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%ld\0A\00"
@MQ_PRIO_MAX = global i64 0
define i32 @main() {
%1 = load i64, i64* @MQ_PRIO_MAX
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}