xunge/DecIR huggingface dataset:
long _integerDivide() {
  long EV_a;
  EV_a = 3000;
  EV_a = (EV_a / 2);
  EV_a = (EV_a * 4);
  EV_a = (EV_a / 8);
  EV_a = (EV_a / 16);
  EV_a = (EV_a * 32);
  EV_a = (EV_a / 64);
  EV_a = (EV_a * 128);
  EV_a = (EV_a / 4);
  return EV_a;
}


x86 assembly (clang, -O0):
<_integerDivide>:
push   %rbp
mov    %rsp,%rbp
movq   $0xbb8,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x10,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x40,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x7,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @_integerDivide() {
%1 = alloca i64
store i64 3000, i64* %1
%2 = load i64, i64* %1
%3 = sdiv i64 %2, 2
store i64 %3, i64* %1
%4 = load i64, i64* %1
%5 = mul nsw i64 %4, 4
store i64 %5, i64* %1
%6 = load i64, i64* %1
%7 = sdiv i64 %6, 8
store i64 %7, i64* %1
%8 = load i64, i64* %1
%9 = sdiv i64 %8, 16
store i64 %9, i64* %1
%10 = load i64, i64* %1
%11 = mul nsw i64 %10, 32
store i64 %11, i64* %1
%12 = load i64, i64* %1
%13 = sdiv i64 %12, 64
store i64 %13, i64* %1
%14 = load i64, i64* %1
%15 = mul nsw i64 %14, 128
store i64 %15, i64* %1
%16 = load i64, i64* %1
%17 = sdiv i64 %16, 4
store i64 %17, i64* %1
%18 = load i64, i64* %1
ret i64 %18
}

LLVM IR (-O2):
define i64 @_integerDivide() {
ret i64 736
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void get_time_now(struct timeval *tv) {
  int ret = gettimeofday(tv, NULL);
  if (ret)
    perror("gettimeofday");
}


x86 assembly (clang, -O0):
<get_time_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1152 <get_time_now+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_now>:
push   %rax
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %eax,%eax
jne    112e <get_time_now+0xe>
pop    %rax
ret
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define void @get_time_now(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca i32
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = call i32 @gettimeofday(%struct.timeval* %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [13 x i8] c"gettimeofday\00"
define void @get_time_now(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ HeadSort(int *, int);
int main(void) {
  int array[] = {36, 48, 48, 90, 88, 80, 76, 99};
  HeadSort(array, 8);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x8,%esi
call   1030 <HeadSort@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <HeadSort@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [8 x i32] [i32 36, i32 48, i32 48, i32 90, i32 88, i32 80, i32 76, i32 99]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
store i32 0, i32* %1
%3 = bitcast [8 x i32]* %2 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%5 = call i32 @HeadSort(i32* %4, i32 8)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@__const.main.array = [8 x i32] [i32 36, i32 48, i32 48, i32 90, i32 88, i32 80, i32 76, i32 99]
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @HeadSort(i32* %3, i32 8)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void KTError(char *msg, char *str) {
  fprintf(stderr, "keytouchd: ");
  fprintf(stderr, msg, str);
  putc('\n', stderr);
}


x86 assembly (clang, -O0):
<KTError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KTError>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eae(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%esi
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [12 x i8] c"keytouchd: \00"
define void @KTError(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = call i32 @putc(i8 signext 10, i32 %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [12 x i8] c"keytouchd: \00"
define void @KTError(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* %0, i8* %1)
%7 = load i32, i32* @stderr
%8 = tail call i32 @putc(i8 signext 10, i32 %7)
ret void
}
int basamak_sayisi_bulma(int girilen_sayi) {
  int basamak_sayisi;
  while (girilen_sayi != 0) {
    girilen_sayi = girilen_sayi / 10;
    basamak_sayisi++;
  }
  return basamak_sayisi;
}


x86 assembly (clang, -O0):
<basamak_sayisi_bulma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112d <basamak_sayisi_bulma+0x2d>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1107 <basamak_sayisi_bulma+0x7>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<basamak_sayisi_bulma>:
test   %edi,%edi
je     1132 <basamak_sayisi_bulma+0x32>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <basamak_sayisi_bulma+0x10>
ret

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

LLVM IR (-O2):
define i32 @basamak_sayisi_bulma(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ undef, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ undef, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ __please_call_pp_printf_not_mprintf();
int mprintf(const char *fmt, ...) {
  __please_call_pp_printf_not_mprintf();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @mprintf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @__please_call_pp_printf_not_mprintf()
ret i32 0
}

LLVM IR (-O2):
define i32 @mprintf(i8* nocapture readnone %0, ...) {
%2 = tail call i32 (...) @__please_call_pp_printf_not_mprintf()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *, int *);
main() {
  int a, b;
  while (scanf("%d%d", &a, &b) > 0) {
    printf("%d\n", a + b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x0,%rax
jle    1164 <main+0x44>
mov    -0x8(%rbp),%esi
add    -0xc(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
test   %rax,%rax
jle    1182 <main+0x62>
lea    0xebd(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%esi
add    0x4(%rsp),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
test   %rax,%rax
jg     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %7, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %4
12: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%13 = icmp sgt i64 %12, 0
br i1 %13, label %7, label %14
14: ; preds = %7, %0
ret i32 0
}
int test_imm_36uint16_reg(unsigned short val) {
  return ((val) & (0x36 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_36uint16_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, 54
%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_36uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 54
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ saa7114_write_reg(int, unsigned char);
int saa7114_set_decoder_hue(char hue) {
  saa7114_write_reg(0x0D, (unsigned char)hue);
  return (0);
}


x86 assembly (clang, -O0):
<saa7114_set_decoder_hue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xd,%edi
movzbl -0x1(%rbp),%esi
call   1030 <saa7114_write_reg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saa7114_set_decoder_hue>:
push   %rax
movzbl %dil,%esi
mov    $0xd,%edi
call   1030 <saa7114_write_reg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @saa7114_set_decoder_hue(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @saa7114_write_reg(i32 13, i8 zeroext %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @saa7114_set_decoder_hue(i8 signext %0) {
%2 = tail call i32 @saa7114_write_reg(i32 13, i8 zeroext %0)
ret i32 0
}
/* Variables and functions */
int maj_elem(int *, int);
int test_maj_elem_even() {
  int array[] = {1, 5, 2, 5, 9, 5, 9, 5, 5, 5};
  return 5 == maj_elem(array, 10);
}


x86 assembly (clang, -O0):
<test_maj_elem_even>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <maj_elem@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_maj_elem_even>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <maj_elem@plt>
xor    %ecx,%ecx
cmp    $0x5,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_maj_elem_even.array = [10 x i32] [i32 1, i32 5, i32 2, i32 5, i32 9, i32 5, i32 9, i32 5, i32 5, i32 5]
define i32 @test_maj_elem_even() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @maj_elem(i32* %3, i32 10)
%5 = icmp eq i32 5, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_maj_elem_even.array = [10 x i32] [i32 1, i32 5, i32 2, i32 5, i32 9, i32 5, i32 9, i32 5, i32 5, i32 5]
define i32 @test_maj_elem_even() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @maj_elem(i32* %3, i32 10)
%5 = icmp eq i32 %4, 5
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testbreak(void) {
  int i;
  for (i = 0; i < 3; i++) {
    printf("-");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<testbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1143 <testbreak+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <testbreak+0xf>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testbreak>:
push   %rax
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @testbreak() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @testbreak() {
%1 = tail call i32 @putchar(i32 45)
%2 = tail call i32 @putchar(i32 45)
%3 = tail call i32 @putchar(i32 45)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int streq(const char *a, const char *b) { return strcmp(a, b) == 0; }


x86 assembly (clang, -O0):
<streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<streq>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @streq(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @streq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int calcMB(int n) {
  if ((n % 1024) > 0)
    return ((n / 1024));
  else
    return (n / 1024);
}


x86 assembly (clang, -O0):
<calcMB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jle    112e <calcMB+0x2e>
mov    -0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    113c <calcMB+0x3c>
mov    -0x8(%rbp),%eax
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcMB>:
lea    0x3ff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0xa,%eax
ret

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

LLVM IR (-O2):
define i32 @calcMB(i32 %0) {
%2 = sdiv i32 %0, 1024
ret i32 %2
}
void sk_num(void) {}


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

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

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

LLVM IR (-O2):
define void @sk_num() {
ret void
}
extern unsigned int inl(unsigned long addr) {
  return *(volatile unsigned int *)((addr << 5) +
                                    ((0xfffffc0000000000UL) + 0x1c0000000UL) +
                                    0x18);
}


x86 assembly (clang, -O0):
<inl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
movabs $0xfffffc01c0000000,%rcx
fc ff ff
add    %rcx,%rax
mov    0x18(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl>:
shl    $0x5,%rdi
movabs $0xfffffc01c0000018,%rax
fc ff ff
mov    (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @inl(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 5
%5 = add i64 %4, -4390530318336
%6 = add i64 %5, 24
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @inl(i64 %0) {
%2 = shl i64 %0, 5
%3 = add i64 %2, -4390530318312
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
ret i32 %5
}
void clonefd_do_notify(struct task_struct *p) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @clonefd_do_notify(%struct.task_struct* nocapture %0) {
ret void
}
int GetRecordEpoch(const char *msg) { return (int)(msg[3] << 8 | msg[4]); }


x86 assembly (clang, -O0):
<GetRecordEpoch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x4(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetRecordEpoch>:
movsbl 0x3(%rdi),%ecx
shl    $0x8,%ecx
movsbl 0x4(%rdi),%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @GetRecordEpoch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @GetRecordEpoch(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = shl nsw i32 %4, 8
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = or i32 %5, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ GetLine(char *, int, int /*<<< orphan*/);
double atof(char *);
double GetDouble(void) {
  char s[20];
  GetLine(s, 18, 0);
  return (atof(s));
}


x86 assembly (clang, -O0):
<GetDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x12,%esi
xor    %edx,%edx
call   1040 <GetLine@plt>
lea    -0x20(%rbp),%rdi
call   1030 <atof@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDouble>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x12,%esi
xor    %edx,%edx
call   1040 <GetLine@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @GetDouble() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetLine(i8* %2, i32 18, i32 0)
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call double @atof(i8* %4)
ret double %5
}

LLVM IR (-O2):
define double @GetDouble() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @GetLine(i8* %2, i32 18, i32 0)
%4 = call double @atof(i8* %2)
ret double %4
}
/* Variables and functions */
int scsi_pt_open_device(char const *, int, int);
int sg_cmds_open_device(const char *device_name, int read_only, int verbose) {
  return scsi_pt_open_device(device_name, read_only, verbose);
}


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

x86 assembly (clang, -O2):
<sg_cmds_open_device>:
jmp    1030 <scsi_pt_open_device@plt>

LLVM IR (-O0):
define i32 @sg_cmds_open_device(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @scsi_pt_open_device(i8* %7, i32 %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sg_cmds_open_device(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @scsi_pt_open_device(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
int test_imm_05int8_mem(signed char *val) {
  return ((*val) & (-0x05 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_05int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -5
%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_05int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -5
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int sw(int);
int main(int argc, char **argv) { return sw(argc); }


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),%edi
call   1030 <sw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <sw@plt>

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 = load i32, i32* %4
%7 = call i32 @sw(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sw(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ util_breverse(char *, int /*<<< orphan*/);
void util_str_reverse(char *str) { util_breverse(str, strlen(str)); }


x86 assembly (clang, -O0):
<util_str_reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <util_breverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_str_reverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <util_breverse@plt>

LLVM IR (-O0):
define void @util_str_reverse(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @util_breverse(i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @util_str_reverse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @util_breverse(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flash_register();
void module_init() { flash_register(); }


x86 assembly (clang, -O0):
<module_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <flash_register@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @module_init() {
%1 = call i32 (...) @flash_register()
ret void
}

LLVM IR (-O2):
define void @module_init() {
%1 = tail call i32 (...) @flash_register()
ret void
}
void arg_int3(int x, int y, int z) {}


x86 assembly (clang, -O0):
<arg_int3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @arg_int3(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
ret void
}

LLVM IR (-O2):
define void @arg_int3(i32 %0, i32 %1, i32 %2) {
ret void
}
float snramplitude(int snr) {
  float snrlookup[21] = {0.042, 0.0475, 0.0533, 0.0599, 0.067, 0.075, 0.084,
                         0.094, 0.1055, 0.1187, 0.134,  0.15,  0.168, 0.19,
                         0.213, 0.238,  0.267,  0.3,    0.335, 0.378, 0.425};
  return snrlookup[snr + 10];
}


x86 assembly (clang, -O0):
<snramplitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x54,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
add    $0xa,%eax
cltq
movss  -0x60(%rbp,%rax,4),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snramplitude>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
movss  0x28(%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
@__const.snramplitude.snrlookup = [21 x float] [float 0x3FA5810620000000, float 0x3FA851EB80000000, float 0x3FAB4A2340000000, float 0x3FAEAB3680000000, float 0x3FB126E980000000, float 0x3FB3333340000000, float 0x3FB5810620000000, float 0x3FB8106240000000, float 0x3FBB020C40000000, float 0x3FBE631F80000000, float 0x3FC126E980000000, float 0x3FC3333340000000, float 0x3FC5810620000000, float 0x3FC851EB80000000, float 0x3FCB439580000000, float 0x3FCE76C8C0000000, float 0x3FD1168720000000, float 0x3FD3333340000000, float 0x3FD570A3E0000000, float 0x3FD83126E0000000, float 0x3FDB333340000000]
define float @snramplitude(i32 %0) {
%2 = alloca i32
%3 = alloca [21 x float]
store i32 %0, i32* %2
%4 = bitcast [21 x float]* %3 to i8*
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 10
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [21 x float], [21 x float]* %3, i64 0, i64 %7
%9 = load float, float* %8
ret float %9
}

LLVM IR (-O2):
@__const.snramplitude.snrlookup = [21 x float] [float 0x3FA5810620000000, float 0x3FA851EB80000000, float 0x3FAB4A2340000000, float 0x3FAEAB3680000000, float 0x3FB126E980000000, float 0x3FB3333340000000, float 0x3FB5810620000000, float 0x3FB8106240000000, float 0x3FBB020C40000000, float 0x3FBE631F80000000, float 0x3FC126E980000000, float 0x3FC3333340000000, float 0x3FC5810620000000, float 0x3FC851EB80000000, float 0x3FCB439580000000, float 0x3FCE76C8C0000000, float 0x3FD1168720000000, float 0x3FD3333340000000, float 0x3FD570A3E0000000, float 0x3FD83126E0000000, float 0x3FDB333340000000]
define float @snramplitude(i32 %0) {
%2 = add nsw i32 %0, 10
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds [21 x float], [21 x float]* @__const.snramplitude.snrlookup, i64 0, i64 %3
%5 = load float, float* %4
ret float %5
}
/* Type definitions */
struct chanfd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ chanfd_recv(struct chanfd *, int *);
void chanfd_recv_int(struct chanfd *channel, int *elem) {
  chanfd_recv(channel, elem);
}


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

x86 assembly (clang, -O2):
<chanfd_recv_int>:
jmp    1030 <chanfd_recv@plt>

LLVM IR (-O0):
%struct.chanfd = type { i32 }
define void @chanfd_recv_int(%struct.chanfd* %0, i32* %1) {
%3 = alloca %struct.chanfd*
%4 = alloca i32*
store %struct.chanfd* %0, %struct.chanfd** %3
store i32* %1, i32** %4
%5 = load %struct.chanfd*, %struct.chanfd** %3
%6 = load i32*, i32** %4
%7 = call i32 @chanfd_recv(%struct.chanfd* %5, i32* %6)
ret void
}

LLVM IR (-O2):
%struct.chanfd = type { i32 }
define void @chanfd_recv_int(%struct.chanfd* %0, i32* %1) {
%3 = tail call i32 @chanfd_recv(%struct.chanfd* %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nogo();
void emulate_off(void) { nogo(); }


x86 assembly (clang, -O0):
<emulate_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <nogo@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @emulate_off() {
%1 = call i32 (...) @nogo()
ret void
}

LLVM IR (-O2):
define void @emulate_off() {
%1 = tail call i32 (...) @nogo()
ret void
}
void avio_rb32() {}


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

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

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

LLVM IR (-O2):
define void @avio_rb32() {
ret void
}
int util_base64_encoded_size(int length) { return 4 * ((length + 2) / 3); }


x86 assembly (clang, -O0):
<util_base64_encoded_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_base64_encoded_size>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @util_base64_encoded_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @util_base64_encoded_size(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
ret i32 %4
}
/* Variables and functions */
scalar_t__ isHighWaterSensorDry();
int isHighWaterLevel(void) {
  if (isHighWaterSensorDry()) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isHighWaterLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <isHighWaterSensorDry@plt>
cmp    $0x0,%rax
je     1135 <isHighWaterLevel+0x25>
movl   $0x0,-0x4(%rbp)
jmp    113c <isHighWaterLevel+0x2c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHighWaterLevel>:
push   %rax
xor    %eax,%eax
call   1030 <isHighWaterSensorDry@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isHighWaterLevel() {
%1 = alloca i32
%2 = call i64 (...) @isHighWaterSensorDry()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 0, i32* %1
br label %6
5: ; preds = %0
store i32 1, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @isHighWaterLevel() {
%1 = tail call i64 (...) @isHighWaterSensorDry()
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
Jputstr(s) register char *s;
{
  while (*s)
    Jputch(*s++);
}


x86 assembly (clang, -O0):
<Jputstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <Jputstr+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <Jputch@plt>
jmp    111c <Jputstr+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Jputstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <Jputstr+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <Jputch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <Jputstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @Jputstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @Jputch to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 undef
}
/* Variables and functions */
int yahoo_M1Common(unsigned int, int);
int yahoo_f01_2c(int Salt, int Parameter) {
  unsigned b = Salt * 0xB4C3D13 + 0x1597;
  return yahoo_M1Common(b, Parameter);
}


x86 assembly (clang, -O0):
<yahoo_f01_2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xb4c3d13,-0x4(%rbp),%eax
add    $0x1597,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <yahoo_M1Common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_2c>:
imul   $0xb4c3d13,%edi,%edi
add    $0x1597,%edi
jmp    1030 <yahoo_M1Common@plt>

LLVM IR (-O0):
define i32 @yahoo_f01_2c(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 189545747
%8 = add nsw i32 %7, 5527
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = call i32 @yahoo_M1Common(i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @yahoo_f01_2c(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 189545747
%4 = add nsw i32 %3, 5527
%5 = tail call i32 @yahoo_M1Common(i32 %4, i32 %1)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void set(char *ts, int val) {
  *ts = val;
  printf("ts val %d\n", *ts);
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
lea    0xecb(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
mov    %sil,(%rdi)
movsbl %sil,%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ts val %d\0A\00"
define void @set(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 = trunc i32 %5 to i8
%7 = load i8*, i8** %3
store i8 %6, i8* %7
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"ts val %d\0A\00"
define void @set(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}
int main(int argc, char *argv[]) {
  int a = 5, b, c;
  do {
    c = a + b;
    int var;
  } while (1 == 2);
  if (1)
    1 + 1;
  else
    2 + 2;
  if (1)
    1;
  if (0 || 1)
    ;
  else
    ;
  if (0 && 1) {
    a;
  } else {
    if (0) {
      b;
    } else {
      if (1) {
        c;
        int a;
      }
    }
  }
  if (2 == 3) {
  } else if (2 == 2) {
    const int a[] = {1, 2, 3};
    int b = 0;
    b + 1;
  }
  while (0) {
    1 + 1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x34(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    114c <main+0x4c>
jmp    1151 <main+0x51>
jmp    113d <main+0x3d>
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [3 x i32]
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 5, i32* %6
br label %13
13: ; preds = %2
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = add nsw i32 %14, %15
store i32 %16, i32* %8
br label %17
17: ; preds = %13
%18 = load i32, i32* %8
%19 = bitcast [3 x i32]* %11 to i8*
store i32 0, i32* %12
%20 = load i32, i32* %12
%21 = add nsw i32 %20, 1
br label %22
22: ; preds = %23, %17
br i1 false, label %23, label %24
23: ; preds = %22
br label %22
24: ; preds = %22
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_cog_pc(int cog, uint32_t addr) {}


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

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

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

LLVM IR (-O2):
define void @set_cog_pc(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t dhara_r16(const uint8_t *data) {
  return ((uint16_t)data[0]) | (((uint16_t)data[1]) << 8);
}


x86 assembly (clang, -O0):
<dhara_r16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhara_r16>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @dhara_r16(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @dhara_r16(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int a, char **b) {
  int i;
  for (i = 1; i < a; i++) {
    printf("%d : %s\n", i, b[i]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%d : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ g(int *, int *);
void f(int *a, int *b) {
  *b = *a - 1;
  while (*a > 1) {
    g(a, b);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jle    114e <f+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <g@plt>
jmp    112f <f+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%eax
add    $0xffffffff,%eax
mov    %eax,(%rsi)
cmpl   $0x2,(%rdi)
jl     1140 <f+0x30>
mov    %rsi,%r14
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <g@plt>
cmpl   $0x1,(%rbx)
jg     1130 <f+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @f(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = add nsw i32 %3, -1
store i32 %4, i32* %1
%5 = load i32, i32* %0
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %2, %7
%8 = tail call i32 @g(i32* %0, i32* %1)
%9 = load i32, i32* %0
%10 = icmp sgt i32 %9, 1
br i1 %10, label %7, label %11
11: ; preds = %7, %2
ret void
}