xunge/DecIR huggingface dataset:
int test_imm_51uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x51 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_51uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x51,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_51uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 81
%7 = icmp ne i64 %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_51uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 347892350976
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_CFint64_midword_reg(long long val) {
  return ((val >> 16) & (0xCF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_CFint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0xcf,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_CFint64_midword_reg>:
test   $0xcf0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_CFint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 207
%6 = icmp ne i64 %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_CFint64_midword_reg(i64 %0) {
%2 = and i64 %0, 13565952
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void rop3_66_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ *D;
  stk2 = T ^ *D;
  stk1 = stk1 & stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_66_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_66_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = xor i32 %10, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %7
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = xor i32 %17, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8, i8* %7
%24 = zext i8 %23 to i32
%25 = load i8, i8* %8
%26 = zext i8 %25 to i32
%27 = and i32 %24, %26
%28 = trunc i32 %27 to i8
store i8 %28, i8* %7
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = xor i32 %32, -1
%34 = and i32 %30, %33
%35 = load i8, i8* %6
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = load i8*, i8** %4
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = load i8, i8* %6
%50 = zext i8 %49 to i32
%51 = and i32 %48, %50
%52 = or i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = load i8*, i8** %4
store i8 %53, i8* %54
ret void
}

LLVM IR (-O2):
define void @rop3_66_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ test_ADV();
int /*<<< orphan*/ test_INFO();
int /*<<< orphan*/ test_REQ_LIST();
int /*<<< orphan*/ test_comm();
int /*<<< orphan*/ test_sn();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srandom(time(NULL));
  test_REQ_LIST();
  test_INFO();
  test_ADV();
  test_sn();
  test_comm();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
mov    $0x0,%al
call   1090 <test_REQ_LIST@plt>
mov    $0x0,%al
call   1050 <test_INFO@plt>
mov    $0x0,%al
call   1080 <test_ADV@plt>
mov    $0x0,%al
call   1070 <test_sn@plt>
mov    $0x0,%al
call   1040 <test_comm@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %eax,%eax
call   1090 <test_REQ_LIST@plt>
xor    %eax,%eax
call   1050 <test_INFO@plt>
xor    %eax,%eax
call   1080 <test_ADV@plt>
xor    %eax,%eax
call   1070 <test_sn@plt>
xor    %eax,%eax
call   1040 <test_comm@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srandom(i32 %2)
%4 = call i32 (...) @test_REQ_LIST()
%5 = call i32 (...) @test_INFO()
%6 = call i32 (...) @test_ADV()
%7 = call i32 (...) @test_sn()
%8 = call i32 (...) @test_comm()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srandom(i32 %1)
%3 = tail call i32 (...) @test_REQ_LIST()
%4 = tail call i32 (...) @test_INFO()
%5 = tail call i32 (...) @test_ADV()
%6 = tail call i32 (...) @test_sn()
%7 = tail call i32 (...) @test_comm()
ret i32 0
}
void name() {}


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

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

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

LLVM IR (-O2):
define void @name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void label_plot(int n, const char *name, int y0) {
  printf("4 2 0 50 0 0 12 0.0 4 135 345 ");
  printf("%d %d ", 450 + 225, 1000 * n - (int)(0.2 * 1000) + 1800 + y0);
  printf("%s\\001\n", name);
}


x86 assembly (clang, -O0):
<label_plot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0x3e8,-0x4(%rbp),%edx
sub    $0xc8,%edx
add    $0x708,%edx
add    -0x14(%rbp),%edx
lea    0xed2(%rip),%rdi
mov    $0x2a3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<label_plot>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
imul   $0x3e8,%ebp,%eax
lea    (%rax,%rbx,1),%edx
add    $0x640,%edx
lea    0xee0(%rip),%rdi
mov    $0x2a3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"4 2 0 50 0 0 12 0.0 4 135 345 \00"
@.str.1 = [7 x i8] c"%d %d \00"
@.str.2 = [8 x i8] c"%s\\001\0A\00"
define void @label_plot(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %4
%9 = mul nsw i32 1000, %8
%10 = sub nsw i32 %9, 200
%11 = add nsw i32 %10, 1800
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 675, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %15)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"4 2 0 50 0 0 12 0.0 4 135 345 \00"
@.str.1 = [7 x i8] c"%d %d \00"
@.str.2 = [8 x i8] c"%s\\001\0A\00"
define void @label_plot(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = mul nsw i32 %0, 1000
%6 = add nsw i32 %5, 1600
%7 = add nsw i32 %6, %2
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 675, i32 %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xb6() {
  Assert_real((isalpha(182) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              915, ("isalpha should be 0 for 0xb6"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xb6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb6,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x393,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xb6>:
push   %rax
mov    $0xb6,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x393,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xb6\00"
define void @t_isalpha_0xb6() {
%1 = call i64 @isalpha(i32 182)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 915, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xb6\00"
define void @t_isalpha_0xb6() {
%1 = tail call i64 @isalpha(i32 182)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 915, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void OS_Assert(void) {}


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

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

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

LLVM IR (-O2):
define void @OS_Assert() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *virtual_machine_resource_pool_plain_malloc(void *pool_ptr, size_t size) {
  (void)pool_ptr;
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<virtual_machine_resource_pool_plain_malloc>:
mov    %rsi,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @virtual_machine_resource_pool_plain_malloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @virtual_machine_resource_pool_plain_malloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
unsigned int f82(unsigned int x, unsigned long int y) {
  return (x << (8 * 4 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f82>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f82>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f82(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = sub i64 32, %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %5, %8
%10 = load i32, i32* %3
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = lshr i32 %10, %12
%14 = add i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @f82(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = sub i32 32, %3
%5 = shl i32 %0, %4
%6 = lshr i32 %0, %3
%7 = add i32 %5, %6
ret i32 %7
}
int test_imm_2Fuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x2F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Fuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0x2f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_2Fuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 47
%7 = icmp ne i64 %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_2Fuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3080192
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void set_cpu_numa_mem(int cpu, int node) {}


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

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

LLVM IR (-O0):
define void @set_cpu_numa_mem(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_cpu_numa_mem(i32 %0, i32 %1) {
ret void
}
int index_of(int *a, int s, int n) {
  int i;
  for (i = 0; i < n; i++) {
    if (a[i] == s)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<index_of>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1153 <index_of+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x14(%rbp),%eax
jne    1140 <index_of+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <index_of+0x5a>
jmp    1145 <index_of+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <index_of+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_of>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    111e <index_of+0x1e>
mov    %edx,%edx
xor    %ecx,%ecx
nopl   (%rax)
cmp    %esi,(%rdi,%rcx,4)
je     111f <index_of+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    1110 <index_of+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @index_of(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
int main() {
  asm("main_label: .globl main_label");
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
tail call void asm sideeffect "main_label: .globl main_label", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int write(int, char *, int);
int sendMessage(int sockfd, char *msg) {
  int n;
  n = write(sockfd, msg, 4);
  if (n < 0)
    error("ERROR writing to socket");
  return 0;
}


x86 assembly (clang, -O0):
<sendMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1159 <sendMessage+0x39>
lea    0xeac(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendMessage>:
push   %rax
mov    $0x4,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    113b <sendMessage+0x1b>
lea    0xeca(%rip),%rdi
call   1040 <error@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"ERROR writing to socket\00"
define i32 @sendMessage(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @write(i32 %6, i8* %7, i32 4)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"ERROR writing to socket\00"
define i32 @sendMessage(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @write(i32 %0, i8* %1, i32 4)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
void switch_thread(void) { syscall(4, 0, 0, 0); }


x86 assembly (clang, -O0):
<switch_thread>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_thread>:
mov    $0x4,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define void @switch_thread() {
%1 = call i32 @syscall(i32 4, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @switch_thread() {
%1 = tail call i32 @syscall(i32 4, i32 0, i32 0, i32 0)
ret void
}
/* Variables and functions */
int strcasecmp(char *, char *);
int charIcCmpFunction(const void *pointer1, const void *pointer2) {
  return strcasecmp((char *)pointer1, (char *)pointer2);
}


x86 assembly (clang, -O0):
<charIcCmpFunction>:
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 <strcasecmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charIcCmpFunction>:
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @charIcCmpFunction(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 i32 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @charIcCmpFunction(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %0, i8* %1)
ret i32 %3
}
unsigned supertwoxsai_generic_input_fmts() { return (1 << 0) | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @supertwoxsai_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @supertwoxsai_generic_input_fmts() {
ret i32 3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *getfile(int);
int /*<<< orphan*/ *getfilebyname(char *);
FILE *getfileparam(char *name, int *arg) {
  FILE *f = getfile(*arg);
  if (f) {
    (*arg)++;
    return f;
  } else
    return getfilebyname(name);
}


x86 assembly (clang, -O0):
<getfileparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <getfile@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1162 <getfileparam+0x42>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116f <getfileparam+0x4f>
mov    -0x10(%rbp),%rdi
call   1030 <getfilebyname@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getfileparam>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%edi
call   1040 <getfile@plt>
test   %rax,%rax
je     1141 <getfileparam+0x21>
addl   $0x1,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <getfilebyname@plt>

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

LLVM IR (-O2):
define i32* @getfileparam(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32* @getfile(i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %11
9: ; preds = %2
%10 = tail call i32* @getfilebyname(i8* %0)
br label %11
11: ; preds = %9, %6
%12 = phi i32* [ %4, %6 ], [ %10, %9 ]
ret i32* %12
}
/* Variables and functions */
void __swpfunc(void *user_data, void *a, void *b, size_t size) {
  int *ia = (int *)a;
  int *ib = (int *)b;
  int t;
  t = *ia;
  *ia = *ib;
  *ib = t;
}


x86 assembly (clang, -O0):
<__swpfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__swpfunc>:
mov    (%rsi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @__swpfunc(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%12 = load i8*, i8** %6
%13 = bitcast i8* %12 to i32*
store i32* %13, i32** %9
%14 = load i8*, i8** %7
%15 = bitcast i8* %14 to i32*
store i32* %15, i32** %10
%16 = load i32*, i32** %9
%17 = load i32, i32* %16
store i32 %17, i32* %11
%18 = load i32*, i32** %10
%19 = load i32, i32* %18
%20 = load i32*, i32** %9
store i32 %19, i32* %20
%21 = load i32, i32* %11
%22 = load i32*, i32** %10
store i32 %21, i32* %22
ret void
}

LLVM IR (-O2):
define void @__swpfunc(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2, i64 %3) {
%5 = bitcast i8* %1 to i32*
%6 = bitcast i8* %2 to i32*
%7 = load i32, i32* %5
%8 = load i32, i32* %6
store i32 %8, i32* %5
store i32 %7, i32* %6
ret void
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
unsigned int shortHash(unsigned int x) {
  char stringNum[10 * 2];
  char stringShort[6 + 1];
  int i;
  sprintf(stringNum, "%u", x);
  memcpy(stringShort, stringNum, 6);
  stringShort[6] = '\0';
  return atoi(stringShort);
}


x86 assembly (clang, -O0):
<shortHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeb7(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x27(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x21(%rbp)
lea    -0x27(%rbp),%rdi
call   1040 <atoi@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortHash>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %edi,%edx
lea    0xec0(%rip),%rsi
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
lea    0x9(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
call   1030 <memcpy@plt>
movb   $0x0,0xf(%rsp)
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @shortHash(i32 %0) {
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca [7 x i8]
%5 = alloca i32
store i32 %0, i32* %2
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 6)
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 6
store i8 0, i8* %12
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%14 = call i32 @atoi(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @shortHash(i32 %0) {
%2 = alloca [20 x i8]
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = call i32 @memcpy(i8* %5, i8* %4, i32 6)
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 6
store i8 0, i8* %8
%9 = call i32 @atoi(i8* %5)
ret i32 %9
}
void gtk_notebook_get_show_border() {}


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

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

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

LLVM IR (-O2):
define void @gtk_notebook_get_show_border() {
ret void
}
void RTTarCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTarCreate() {
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
int check_newline(char *buf, int *index) {
  return (strncmp(buf, "\r\n\r\n", 4) == 0) || (strncmp(buf, "\n\n", 2) == 0);
}


x86 assembly (clang, -O0):
<check_newline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
je     1166 <check_newline+0x56>
mov    -0x8(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_newline>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     114b <check_newline+0x3b>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @check_newline(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = call i64 @strncmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i8*, i8** %3
%10 = call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%11 = icmp eq i64 %10, 0
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ true, %2 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define i32 @check_newline(i8* %0, i32* nocapture readnone %1) {
%3 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 2)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 1, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void win() { printf("code flow successfully changed\n"); }


x86 assembly (clang, -O0):
<win>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<win>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"code flow successfully changed\0A\00"
define void @win() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"code flow successfully changed\00"
define void @win() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: todoc [-vvv] [-!*afpt] [-D dir] [-T date]"
                  " [filter ...]\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [63 x i8] c"usage: todoc [-vvv] [-!*afpt] [-D dir] [-T date] [filter ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [63 x i8] c"usage: todoc [-vvv] [-!*afpt] [-D dir] [-T date] [filter ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 2)
unreachable
}
void foo822(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo822(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NLMSG_ALIGN(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void nlmsg_put_mem(void **ctx, const void *mem, size_t len) {
  memcpy(*ctx, mem, len);
  *(char **)ctx += NLMSG_ALIGN(len);
}


x86 assembly (clang, -O0):
<nlmsg_put_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <NLMSG_ALIGN@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlmsg_put_mem>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    (%rdi),%rdi
call   1040 <memcpy@plt>
mov    %rbx,%rdi
call   1030 <NLMSG_ALIGN@plt>
cltq
add    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @nlmsg_put_mem(i8** %0, i8* %1, i64 %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i64
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @memcpy(i8* %8, i8* %9, i64 %10)
%12 = load i64, i64* %6
%13 = call i32 @NLMSG_ALIGN(i64 %12)
%14 = load i8**, i8*** %4
%15 = load i8*, i8** %14
%16 = sext i32 %13 to i64
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8* %17, i8** %14
ret void
}

LLVM IR (-O2):
define void @nlmsg_put_mem(i8** nocapture %0, i8* %1, i64 %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @memcpy(i8* %4, i8* %1, i64 %2)
%6 = tail call i32 @NLMSG_ALIGN(i64 %2)
%7 = load i8*, i8** %0
%8 = sext i32 %6 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ _OSSwapInt16(int /*<<< orphan*/);
uint16_t OSReadSwapInt16(volatile void *base, uintptr_t offset) {
  uint16_t result;
  result = *(uint16_t *)((uintptr_t)base + offset);
  return _OSSwapInt16(result);
}


x86 assembly (clang, -O0):
<OSReadSwapInt16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <_OSSwapInt16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OSReadSwapInt16>:
mov    (%rdi,%rsi,1),%edi
jmp    1030 <_OSSwapInt16@plt>

LLVM IR (-O0):
define i32 @OSReadSwapInt16(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i64, i64* %4
%9 = add i64 %7, %8
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @_OSSwapInt16(i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @OSReadSwapInt16(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = add i64 %3, %1
%5 = inttoptr i64 %4 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @_OSSwapInt16(i32 %6)
ret i32 %7
}
void ft_foreach(int *tab, int length, void (*f)(int)) {
  int i;
  i = 0;
  while (i < length)
    f(tab[i++]);
}


x86 assembly (clang, -O0):
<ft_foreach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1146 <ft_foreach+0x46>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
jmp    111a <ft_foreach+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_foreach>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <ft_foreach+0x30>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
add    $0x1,%rbx
call   *%r14
cmp    %rbx,%r12
jne    1120 <ft_foreach+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_foreach(i32* nocapture %0, i32 %1, void (i32)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %9, %7 ]
%9 = add nuw nsw i64 %8, 1
%10 = getelementptr inbounds i32, i32* %0, i64 %8
%11 = load i32, i32* %10
tail call void %2(i32 %11)
%12 = icmp eq i64 %9, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
void integrator_part1() {}


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

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

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

LLVM IR (-O2):
define void @integrator_part1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *getprogname();
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: %s [name-of-domain]\n", getprogname());
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getprogname@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea8(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getprogname@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"usage: %s [name-of-domain]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i8* (...) @getprogname()
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"usage: %s [name-of-domain]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i8* (...) @getprogname()
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ acceptSet(int *);
int /*<<< orphan*/ modifyValues(int *);
int /*<<< orphan*/ printSet(int *);
int main() {
  int set[20];
  acceptSet(set);
  modifyValues(set);
  printSet(set);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <acceptSet@plt>
lea    -0x60(%rbp),%rdi
call   1040 <modifyValues@plt>
lea    -0x60(%rbp),%rdi
call   1050 <printSet@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <acceptSet@plt>
mov    %rbx,%rdi
call   1040 <modifyValues@plt>
mov    %rbx,%rdi
call   1050 <printSet@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i32]
store i32 0, i32* %1
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%4 = call i32 @acceptSet(i32* %3)
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%6 = call i32 @modifyValues(i32* %5)
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%8 = call i32 @printSet(i32* %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i32]
%2 = bitcast [20 x i32]* %1 to i8*
%3 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%4 = call i32 @acceptSet(i32* %3)
%5 = call i32 @modifyValues(i32* %3)
%6 = call i32 @printSet(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ blinkdash();
int /*<<< orphan*/ blinkdot();
int /*<<< orphan*/ sleep(double);
int blinkJ() {
  blinkdot();
  int c = 0;
  while (c != 3) {
    blinkdash();
    c++;
  }
  sleep(1.5);
  return 0;
}


x86 assembly (clang, -O0):
<blinkJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <blinkdot@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
je     1165 <blinkJ+0x35>
mov    $0x0,%al
call   1040 <blinkdash@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <blinkJ+0x16>
movsd  0xe93(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blinkJ>:
push   %rax
xor    %eax,%eax
call   1030 <blinkdot@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
xor    %eax,%eax
call   1040 <blinkdash@plt>
movsd  0xeab(%rip),%xmm0
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @blinkJ() {
%1 = alloca i32
%2 = call i32 (...) @blinkdot()
store i32 0, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 3
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 (...) @blinkdash()
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %3
10: ; preds = %3
%11 = call i32 @sleep(double 1.500000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @blinkJ() {
%1 = tail call i32 (...) @blinkdot()
%2 = tail call i32 (...) @blinkdash()
%3 = tail call i32 (...) @blinkdash()
%4 = tail call i32 (...) @blinkdash()
%5 = tail call i32 @sleep(double 1.500000e+00)
ret i32 0
}
void rop3_221_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~*D;
  stk1 = S | stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_221_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_221_1_0>:
xor    (%rdi),%sil
not    %sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_221_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %8
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = or i32 %25, %31
%33 = trunc i32 %32 to i8
%34 = load i8*, i8** %4
store i8 %33, i8* %34
ret void
}

LLVM IR (-O2):
define void @rop3_221_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %5, -1
store i8 %6, i8* %0
ret void
}
void inputs(int pas, int ncell, int ntry) {}


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

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

LLVM IR (-O0):
define void @inputs(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 @inputs(i32 %0, i32 %1, i32 %2) {
ret void
}