xunge/DecIR huggingface dataset:
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_geteuid(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_geteuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_geteuid>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_geteuid(i32 %0, %struct.target* %1) {
%3 = alloca i32
%4 = alloca %struct.target*
%5 = alloca i8*
store i32 %0, i32* %3
store %struct.target* %1, %struct.target** %4
%6 = call i8* @malloc(i32 5)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @snprintf(i8* %7, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_geteuid(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
int any_even_one(unsigned x) {
  int mask = 0xAAAAAAAA;
  return !!(x & mask);
}


x86 assembly (clang, -O0):
<any_even_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xaaaaaaaa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_even_one>:
xor    %eax,%eax
test   $0xaaaaaaaa,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @any_even_one(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1431655766, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = and i32 %4, %5
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @any_even_one(i32 %0) {
%2 = and i32 %0, -1431655766
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ yazdir_degerle(int);
int /*<<< orphan*/ yazdir_referansla(int *);
int main() {
  int i = 1;
  yazdir_degerle(i);
  printf("main: %d\n", i);
  yazdir_referansla(&i);
  printf("main: %d\n", i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
mov    $0x1,%edi
call   1050 <yazdir_degerle@plt>
lea    0xeb2(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
call   1040 <yazdir_referansla@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"main: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = tail call i32 @yazdir_degerle(i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = call i32 @yazdir_referansla(i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
void NoInit(struct PatternGen_Params *P, struct PatternGen_Settings *S,
            struct PatternGen_Random *R,
            struct PatternGen_PatternFuncSpecific *Output) {}


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

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

LLVM IR (-O0):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
define void @NoInit(%struct.PatternGen_Params* %0, %struct.PatternGen_Settings* %1, %struct.PatternGen_Random* %2, %struct.PatternGen_PatternFuncSpecific* %3) {
%5 = alloca %struct.PatternGen_Params*
%6 = alloca %struct.PatternGen_Settings*
%7 = alloca %struct.PatternGen_Random*
%8 = alloca %struct.PatternGen_PatternFuncSpecific*
store %struct.PatternGen_Params* %0, %struct.PatternGen_Params** %5
store %struct.PatternGen_Settings* %1, %struct.PatternGen_Settings** %6
store %struct.PatternGen_Random* %2, %struct.PatternGen_Random** %7
store %struct.PatternGen_PatternFuncSpecific* %3, %struct.PatternGen_PatternFuncSpecific** %8
ret void
}

LLVM IR (-O2):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
define void @NoInit(%struct.PatternGen_Params* nocapture %0, %struct.PatternGen_Settings* nocapture %1, %struct.PatternGen_Random* nocapture %2, %struct.PatternGen_PatternFuncSpecific* nocapture %3) {
ret void
}
/* Variables and functions */
int mcfioC_EndDeclNTuples(int);
int mcfio_enddeclntuples_(int *stream) {
  return mcfioC_EndDeclNTuples(*stream);
}


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

x86 assembly (clang, -O2):
<mcfio_enddeclntuples_>:
mov    (%rdi),%edi
jmp    1030 <mcfioC_EndDeclNTuples@plt>

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

LLVM IR (-O2):
define i32 @mcfio_enddeclntuples_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @mcfioC_EndDeclNTuples(i32 %2)
ret i32 %3
}
int audio_ring_dist(int dst, int src, int len) {
  return (dst >= src) ? (dst - src) : (len - src + dst);
}


x86 assembly (clang, -O0):
<audio_ring_dist>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1127 <audio_ring_dist+0x27>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <audio_ring_dist+0x33>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_ring_dist>:
xor    %eax,%eax
sub    %esi,%edi
cmovl  %edx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @audio_ring_dist(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = select i1 %4, i32 %2, i32 0
%6 = sub i32 %0, %1
%7 = add i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char *, char *, int *);
int strlen(char *);
int extract_str_number(char *in, char *cut) {
  int out;
  int len = strlen(cut);
  sscanf((in + len), "%d", &out);
  return out;
}


x86 assembly (clang, -O0):
<extract_str_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
add    %rax,%rdi
lea    0xeb2(%rip),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <sscanf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_str_number>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
lea    0xec3(%rip),%rsi
lea    0xc(%rsp),%rdx
call   1040 <sscanf@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @extract_str_number(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %3
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = call i32 @sscanf(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @extract_str_number(i8* nocapture %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @strlen(i8* %1)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = call i32 @sscanf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
ret i32 %9
}
/* Variables and functions */
int divide(int, int);
void sort_patterndata(int start, int end) {
  int div;
  if (start < end) {
    div = divide(start, end);
    sort_patterndata(start, div - 1);
    sort_patterndata(div + 1, end);
  }
}


x86 assembly (clang, -O0):
<sort_patterndata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1164 <sort_patterndata+0x44>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <divide@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1040 <sort_patterndata@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
call   1040 <sort_patterndata@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_patterndata>:
push   %rbp
push   %r14
push   %rbx
cmp    %esi,%edi
jge    1150 <sort_patterndata+0x30>
mov    %esi,%r14d
mov    %edi,%ebp
nopl   (%rax)
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <divide@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1040 <sort_patterndata@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1130 <sort_patterndata+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @sort_patterndata(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 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @divide(i32 %10, i32 %11)
store i32 %12, i32* %5
%13 = load i32, i32* %3
%14 = load i32, i32* %5
%15 = sub nsw i32 %14, 1
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %4
br label %19
19: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
define void @sort_patterndata(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %4, label %10
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %0, %2 ]
%6 = tail call i32 @divide(i32 %5, i32 %1)
%7 = add nsw i32 %6, -1
tail call void @sort_patterndata(i32 %5, i32 %7)
%8 = add nsw i32 %6, 1
%9 = icmp slt i32 %8, %1
br i1 %9, label %4, label %10
10: ; preds = %4, %2
ret void
}
/* Variables and functions */
int _bit_scan_reverse(int);
int test_bit_scan_reverse(int a) { return _bit_scan_reverse(a); }


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

x86 assembly (clang, -O2):
<test_bit_scan_reverse>:
jmp    1030 <_bit_scan_reverse@plt>

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

LLVM IR (-O2):
define i32 @test_bit_scan_reverse(i32 %0) {
%2 = tail call i32 @_bit_scan_reverse(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int /*<<< orphan*/ sem_close(int /*<<< orphan*/ *);
int /*<<< orphan*/ *sem_open(char const *, int /*<<< orphan*/);
scalar_t__ sem_wait(int /*<<< orphan*/ *);
int sem_dec(const char *sem_name) {
  int rv = -1;
  sem_t *sp = sem_open(sem_name, O_RDWR);
  if (sp != NULL) {
    if (sem_wait(sp) == 0)
      rv = 0;
    sem_close(sp);
  }
  return rv;
}


x86 assembly (clang, -O0):
<sem_dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1040 <sem_open@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1187 <sem_dec+0x57>
mov    -0x18(%rbp),%rdi
call   1030 <sem_wait@plt>
cmp    $0x0,%rax
jne    117e <sem_dec+0x4e>
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <sem_close@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_dec>:
push   %rbp
push   %rbx
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
call   1040 <sem_open@plt>
test   %rax,%rax
je     1160 <sem_dec+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <sem_wait@plt>
neg    %rax
sbb    %ebp,%ebp
mov    %rbx,%rdi
call   1050 <sem_close@plt>
jmp    1165 <sem_dec+0x35>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @sem_dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
store i32 -1, i32* %3
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_RDWR
%7 = call i32* @sem_open(i8* %5, i32 %6)
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %18
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i64 @sem_wait(i32* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 0, i32* %3
br label %15
15: ; preds = %14, %10
%16 = load i32*, i32** %4
%17 = call i32 @sem_close(i32* %16)
br label %18
18: ; preds = %15, %1
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @sem_dec(i8* %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32* @sem_open(i8* %0, i32 %2)
%4 = icmp eq i32* %3, null
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = tail call i64 @sem_wait(i32* %3)
%7 = icmp ne i64 %6, 0
%8 = sext i1 %7 to i32
%9 = tail call i32 @sem_close(i32* %3)
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ %8, %5 ], [ -1, %1 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void google_map_output_map_thumbtack(FILE *output_file, char *click_message,
                                     double latitude, double longitude) {
  fprintf(output_file, "	point = new google.maps.LatLng(%.7lf,%.7lf);\n",
          latitude, longitude);
  fprintf(output_file, "	create_map_marker( map, point, '%s' );\n\n",
          click_message);
}


x86 assembly (clang, -O0):
<google_map_output_map_thumbtack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xec1(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<google_map_output_map_thumbtack>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xedf(%rip),%rsi
mov    $0x2,%al
call   1030 <fprintf@plt>
lea    0xf00(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"\09point = new google.maps.LatLng(%.7lf,%.7lf);\0A\00"
@.str.1 = [42 x i8] c"\09create_map_marker( map, point, '%s' );\0A\0A\00"
define void @google_map_output_map_thumbtack(i32* %0, i8* %1, double %2, double %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
store i32* %0, i32** %5
store i8* %1, i8** %6
store double %2, double* %7
store double %3, double* %8
%9 = load i32*, i32** %5
%10 = load double, double* %7
%11 = load double, double* %8
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %10, double %11)
%13 = load i32*, i32** %5
%14 = load i8*, i8** %6
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"\09point = new google.maps.LatLng(%.7lf,%.7lf);\0A\00"
@.str.1 = [42 x i8] c"\09create_map_marker( map, point, '%s' );\0A\0A\00"
define void @google_map_output_map_thumbtack(i32* nocapture %0, i8* %1, double %2, double %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), double %2, double %3)
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int build_path(char *, size_t, char *, char const *);
char *getenv(char *);
int get_adb_usb_ini(char *buff, size_t len) {
  const char *home = getenv("HOME");
  if (home == NULL)
    home = "/tmp";
  return build_path(buff, len, "%s/%s/%s", home);
}


x86 assembly (clang, -O0):
<get_adb_usb_ini>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <get_adb_usb_ini+0x36>
lea    0xeb3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xea1(%rip),%rdx
call   1040 <build_path@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_adb_usb_ini>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xec5(%rip),%rcx
cmovne %rax,%rcx
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <build_path@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [9 x i8] c"%s/%s/%s\00"
define i32 @get_adb_usb_ini(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %2
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %5
br label %10
10: ; preds = %9, %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = load i8*, i8** %5
%14 = call i32 @build_path(i8* %11, i64 %12, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [5 x i8] c"/tmp\00"
@.str.2 = [9 x i8] c"%s/%s/%s\00"
define i32 @get_adb_usb_ini(i8* %0, i64 %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %3
%6 = tail call i32 @build_path(i8* %0, i64 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret i32 %6
}
void __DELETE_java_lang_ClassLoader(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_ClassLoader(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void main(int i) {
  f(1, 2, 3);
  h(1, 2);
  h();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x0,%al
call   1040 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <h@plt>
mov    $0x0,%al
call   1030 <h@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <f@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1030 <h@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <h@plt>

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, i32, ...)*)(i32 1, i32 2, i32 3)
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @h to i32 (i32, i32, ...)*)(i32 1, i32 2)
%5 = call i32 (...) @h()
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @f to i32 (i32, i32, i32, ...)*)(i32 1, i32 2, i32 3)
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @h to i32 (i32, i32, ...)*)(i32 1, i32 2)
%4 = tail call i32 (...) @h()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(int argc, char *argv[]) {
  int counter = 0;
  while (counter != 0) {
    counter++;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1131 <main+0x31>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <main+0x19>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 0, i32* %6
br label %7
7: ; preds = %10, %2
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
br label %7
13: ; preds = %7
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
long horizontalProduct(long *gridLine, int index) {
  long prod = 1;
  if (!(index + 4 < 20))
    return prod;
  for (int i = 0; i < 4; i++) {
    prod *= gridLine[index + i];
  }
  return prod;
}


x86 assembly (clang, -O0):
<horizontalProduct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movq   $0x1,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    $0x4,%eax
cmp    $0x14,%eax
jl     112f <horizontalProduct+0x2f>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1170 <horizontalProduct+0x70>
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1168 <horizontalProduct+0x68>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
imul   -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <horizontalProduct+0x36>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<horizontalProduct>:
mov    $0x1,%eax
cmp    $0xf,%esi
jg     1123 <horizontalProduct+0x23>
movslq %esi,%rcx
mov    0x8(%rdi,%rcx,8),%rax
imul   (%rdi,%rcx,8),%rax
imul   0x10(%rdi,%rcx,8),%rax
imul   0x18(%rdi,%rcx,8),%rax
ret

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

LLVM IR (-O2):
define i64 @horizontalProduct(i64* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 16
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i64, i64* %0, i64 %5
%7 = load i64, i64* %6
%8 = add nsw i64 %5, 1
%9 = getelementptr inbounds i64, i64* %0, i64 %8
%10 = load i64, i64* %9
%11 = mul nsw i64 %10, %7
%12 = add nsw i64 %5, 2
%13 = getelementptr inbounds i64, i64* %0, i64 %12
%14 = load i64, i64* %13
%15 = mul nsw i64 %14, %11
%16 = add nsw i64 %5, 3
%17 = getelementptr inbounds i64, i64* %0, i64 %16
%18 = load i64, i64* %17
%19 = mul nsw i64 %18, %15
br label %20
20: ; preds = %4, %2
%21 = phi i64 [ 1, %2 ], [ %19, %4 ]
ret i64 %21
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xb2() {
  Assert_real((isprint(178) == 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_isprint.c",
              895, ("isprint should be 0 for 0xb2"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xb2>:
push   %rax
mov    $0xb2,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x37f,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb2\00"
define void @t_isprint_0xb2() {
%1 = call i64 @isprint(i32 178)
%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 895, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xb2\00"
define void @t_isprint_0xb2() {
%1 = tail call i64 @isprint(i32 178)
%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 895, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void emit_help(void) {
  fputs("Usage: waitornot [-I] command [args ..]\n", stderr);
  exit(EX_USAGE);
}


x86 assembly (clang, -O0):
<emit_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<emit_help>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Usage: waitornot [-I] command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"Usage: waitornot [-I] command [args ..]\0A\00"
@stderr = global i32 0
@EX_USAGE = global i32 0
define void @emit_help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EX_USAGE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int stringStat(char *, int, int *);
int main() {
  char *ch = "yuriy";
  int cnt = 8;
  int res = stringStat(ch, 5, &cnt);
  printf("res is %d and cnt is %d\n", res, cnt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
lea    -0x14(%rbp),%rdx
call   1040 <stringStat@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x8,0x4(%rsp)
lea    0xed0(%rip),%rdi
lea    0x4(%rsp),%rdx
mov    $0x5,%esi
call   1040 <stringStat@plt>
mov    0x4(%rsp),%edx
lea    0xebc(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"yuriy\00"
@.str.1 = [25 x i8] c"res is %d and cnt is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 8, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @stringStat(i8* %5, i32 5, i32* %3)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"yuriy\00"
@.str.1 = [25 x i8] c"res is %d and cnt is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 8, i32* %1
%3 = call i32 @stringStat(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5, i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Type definitions */
struct timeval {
  long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *);
void aeGetTime(long *seconds, long *milliseconds) {
  struct timeval tv;
  gettimeofday(&tv);
  *seconds = tv.tv_sec;
  *milliseconds = tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<aeGetTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <gettimeofday@plt>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeGetTime>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rax
mov    %rax,(%rbx)
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
mov    %rax,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define void @aeGetTime(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca %struct.timeval
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = call i32 @gettimeofday(%struct.timeval* %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 1000
%13 = sext i32 %12 to i64
%14 = load i64*, i64** %4
store i64 %13, i64* %14
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @aeGetTime(i64* nocapture writeonly %0, i64* nocapture writeonly %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%7 = load i64, i64* %6
store i64 %7, i64* %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
store i64 %11, i64* %1
ret void
}
void gdk_display_get_n_screens() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_get_n_screens() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ day3();
int main() {
  day3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @day3()
ret i32 0
}
void bailout() {
  int unused = 0, result = 4;
  result = result;
  for (unsigned bg = 0; bg < 1024; bg++) {
    result = bg * result;
    for (int i = 0; i < 256; i++) {
      unused *= i;
    }
  }
}


x86 assembly (clang, -O0):
<bailout>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x400,-0xc(%rbp)
jae    1175 <bailout+0x75>
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x100,-0x10(%rbp)
jge    1162 <bailout+0x62>
mov    -0x10(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <bailout+0x3d>
jmp    1167 <bailout+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <bailout+0x1f>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bailout() {
ret void
}
void exit(int errcode) { asm volatile("int $0x30" ::"a"(0), "b"(errcode)); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%ebx
xor    %eax,%eax
int    $0x30

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
int    $0x30

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
unreachable
}

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void asm sideeffect "int $$0x30", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 0, i32 %0)
unreachable
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ herror(char *);
void errorurl(char *msg, int error) {
  struct hostent *host;
  if ((host = gethostbyname(msg)) == NULL) {
    herror("gethostbyname");
    error = -1;
  } else {
    error = 1;
  }
}


x86 assembly (clang, -O0):
<errorurl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115e <errorurl+0x3e>
lea    0xeb3(%rip),%rdi
call   1040 <herror@plt>
movl   $0xffffffff,-0xc(%rbp)
jmp    1165 <errorurl+0x45>
movl   $0x1,-0xc(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorurl>:
push   %rax
call   1030 <gethostbyname@plt>
test   %rax,%rax
je     112d <errorurl+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <herror@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
@.str = [14 x i8] c"gethostbyname\00"
define void @errorurl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.hostent*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call %struct.hostent* @gethostbyname(i8* %6)
store %struct.hostent* %7, %struct.hostent** %5
%8 = icmp eq %struct.hostent* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @herror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %12
11: ; preds = %2
store i32 1, i32* %4
br label %12
12: ; preds = %11, %9
ret void
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [14 x i8] c"gethostbyname\00"
define void @errorurl(i8* %0, i32 %1) {
%3 = tail call %struct.hostent* @gethostbyname(i8* %0)
%4 = icmp eq %struct.hostent* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @herror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_colors();
int main(int argc, char **argv) {
  test_colors();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_colors@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_colors()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_colors()
ret i32 0
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
scalar_t__ stat(char *, struct stat *);
int file_size(char *filename) {
  struct stat status;
  if (stat(filename, &status) != 0)
    return -1;
  return (int)status.st_size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     113f <file_size+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <file_size+0x36>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = select i1 %5, i32 %8, i32 -1
ret i32 %9
}
float sum_imp(float taxaImposto, float custo) {
  float novoValor;
  novoValor = custo + (custo * (taxaImposto) / 100);
  return novoValor;
}


x86 assembly (clang, -O0):
<sum_imp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  0xedb(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_imp>:
mulss  %xmm1,%xmm0
divss  0xef4(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @sum_imp(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %4
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = fdiv float %9, 1.000000e+02
%11 = fadd float %6, %10
store float %11, float* %5
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
define float @sum_imp(float %0, float %1) {
%3 = fmul float %0, %1
%4 = fdiv float %3, 1.000000e+02
%5 = fadd float %4, %1
ret float %5
}
/* Type definitions */
struct utsname {
  int dummy;
};

/* Variables and functions */
int __syscall(int, struct utsname *);
int uname(struct utsname *a) { return __syscall(63, a); }


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

x86 assembly (clang, -O2):
<uname>:
mov    %rdi,%rsi
mov    $0x3f,%edi
jmp    1030 <__syscall@plt>

LLVM IR (-O0):
%struct.utsname = type { i32 }
define i32 @uname(%struct.utsname* %0) {
%2 = alloca %struct.utsname*
store %struct.utsname* %0, %struct.utsname** %2
%3 = load %struct.utsname*, %struct.utsname** %2
%4 = call i32 @__syscall(i32 63, %struct.utsname* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
define i32 @uname(%struct.utsname* %0) {
%2 = tail call i32 @__syscall(i32 63, %struct.utsname* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void fprint_setb_C(FILE *stream) {
  fprintf(stream, "SETB  C                         ");
}


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

x86 assembly (clang, -O2):
<fprint_setb_C>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x20,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [33 x i8] c"SETB C \00"
define void @fprint_setb_C(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 32, i64 1, i32* %0)
ret void
}
/* Variables and functions */
unsigned char inb_local(unsigned short);
unsigned char x_inb(unsigned short port) {
  unsigned char val;
  val = inb_local(port);
  return val;
}


x86 assembly (clang, -O0):
<x_inb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <inb_local@plt>
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_inb>:
jmp    1030 <inb_local@plt>

LLVM IR (-O0):
define zeroext i8 @x_inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call zeroext i8 @inb_local(i16 zeroext %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @x_inb(i16 zeroext %0) {
%2 = tail call zeroext i8 @inb_local(i16 zeroext %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void usart_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<usart_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @usart_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
long round_to_int(double x) { return (long)floor(x + 0.5); }


x86 assembly (clang, -O0):
<round_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_to_int>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i64 @round_to_int(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call i64 @floor(double %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @round_to_int(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call i64 @floor(double %2)
ret i64 %3
}