xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
void tell_parent(pid_t pid) { kill(pid, SIGUSR2); }


x86 assembly (clang, -O0):
<tell_parent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tell_parent>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGUSR2 = global i32 0
define void @tell_parent(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR2
%5 = call i32 @kill(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
define void @tell_parent(i32 %0) {
%2 = load i32, i32* @SIGUSR2
%3 = tail call i32 @kill(i32 %0, i32 %2)
ret void
}
int config_LCDSUPPORT(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @config_LCDSUPPORT() {
ret i32 0
}

LLVM IR (-O2):
define i32 @config_LCDSUPPORT() {
ret i32 0
}
/* Variables and functions */
void *malloc(unsigned int);
int /*<<< orphan*/ memcpy(void *, void const *, unsigned int);
void *memdup(const void *src, unsigned int size) {
  void *dup = malloc(size);
  memcpy(dup, src, size);
  return dup;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
ret i8* %3
}
void mus_bfloat_to_char(unsigned char *j, float x) {
  unsigned char *ox = (unsigned char *)&x;
  j[0] = ox[3];
  j[1] = ox[2];
  j[2] = ox[1];
  j[3] = ox[0];
}


x86 assembly (clang, -O0):
<mus_bfloat_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_bfloat_to_char>:
movd   %xmm0,%eax
bswap  %eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @mus_bfloat_to_char(i8* nocapture writeonly %0, float %1) {
%3 = bitcast float %1 to i32
%4 = lshr i32 %3, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %0
%6 = lshr i32 %3, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %3, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %3 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %12, i8* %13
ret void
}
void SwapUVRow_C() {}


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

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

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

LLVM IR (-O2):
define void @SwapUVRow_C() {
ret void
}
/* Type definitions */
struct bike {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bike_pedal(struct bike *this) {
  printf("bike pedal\n");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.bike = type { i32 }
@.str = [12 x i8] c"bike pedal\0A\00"
define i32 @bike_pedal(%struct.bike* %0) {
%2 = alloca %struct.bike*
store %struct.bike* %0, %struct.bike** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.bike = type { i32 }
@str = [11 x i8] c"bike pedal\00"
define i32 @bike_pedal(%struct.bike* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void AmiSetQword48ToLe(void *pAddr_p, long long int qwQwordVal_p) {
  ((unsigned long int *)pAddr_p)[0] = ((unsigned long int *)&qwQwordVal_p)[0];
  ((unsigned short int *)pAddr_p)[2] = ((unsigned short int *)&qwQwordVal_p)[2];
}


x86 assembly (clang, -O0):
<AmiSetQword48ToLe>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AmiSetQword48ToLe>:
mov    %rsi,(%rdi)
shr    $0x20,%rsi
mov    %si,0x4(%rdi)
ret

LLVM IR (-O0):
define void @AmiSetQword48ToLe(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = getelementptr inbounds i64, i64* %8, i64 0
store i64 %6, i64* %9
%10 = bitcast i64* %4 to i16*
%11 = getelementptr inbounds i16, i16* %10, i64 2
%12 = load i16, i16* %11
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i16*
%15 = getelementptr inbounds i16, i16* %14, i64 2
store i16 %12, i16* %15
ret void
}

LLVM IR (-O2):
define void @AmiSetQword48ToLe(i8* nocapture writeonly %0, i64 %1) {
%3 = lshr i64 %1, 32
%4 = trunc i64 %3 to i16
%5 = bitcast i8* %0 to i64*
store i64 %1, i64* %5
%6 = getelementptr inbounds i8, i8* %0, i64 4
%7 = bitcast i8* %6 to i16*
store i16 %4, i16* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prepareFun();
int /*<<< orphan*/ saveMenuSettings();
void stopMenu(void) {
  saveMenuSettings();
  prepareFun();
}


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

x86 assembly (clang, -O2):
<stopMenu>:
push   %rax
xor    %eax,%eax
call   1040 <saveMenuSettings@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <prepareFun@plt>

LLVM IR (-O0):
define void @stopMenu() {
%1 = call i32 (...) @saveMenuSettings()
%2 = call i32 (...) @prepareFun()
ret void
}

LLVM IR (-O2):
define void @stopMenu() {
%1 = tail call i32 (...) @saveMenuSettings()
%2 = tail call i32 (...) @prepareFun()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int_test();
int /*<<< orphan*/ object_test();
int /*<<< orphan*/ string_test();
int main() {
  int_test();
  string_test();
  object_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @int_test()
%2 = tail call i32 (...) @string_test()
%3 = tail call i32 (...) @object_test()
ret i32 0
}
void RTDbgModGetTag(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModGetTag() {
ret void
}
void *test_anti_range_121(long n) {
  extern void *alloc_anti_range_121(long) __attribute__((alloc_size(1)));
  if ((-0x7fffffffffffffffL - 1) + 2 <= n && n <= 0)
    n = (-0x7fffffffffffffffL - 1) + 2 - 1;
  return alloc_anti_range_121(n);
}


x86 assembly (clang, -O0):
<test_anti_range_121>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000002,%rax
cmp    -0x8(%rbp),%rax
jg     1149 <test_anti_range_121+0x39>
cmpq   $0x0,-0x8(%rbp)
jg     1149 <test_anti_range_121+0x39>
movabs $0x8000000000000001,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_121@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_121>:
movabs $0x7ffffffffffffffe,%rax
ff ff 7f
lea    (%rdi,%rax,1),%rcx
lea    0x1(%rax),%rdx
add    $0x3,%rax
cmp    %rdx,%rcx
cmovb  %rax,%rdi
jmp    1030 <alloc_anti_range_121@plt>

LLVM IR (-O0):
define i8* @test_anti_range_121(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 -9223372036854775806, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -9223372036854775807, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_121(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_121(i64 %0) {
%2 = add i64 %0, 9223372036854775806
%3 = icmp ult i64 %2, 9223372036854775807
%4 = select i1 %3, i64 -9223372036854775807, i64 %0
%5 = tail call i8* @alloc_anti_range_121(i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sendSignal();
void callSendSignal(int sig) {
  printf("callSendSignal\n");
  sendSignal();
}


x86 assembly (clang, -O0):
<callSendSignal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <sendSignal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callSendSignal>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <sendSignal@plt>

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

LLVM IR (-O2):
@str = [15 x i8] c"callSendSignal\00"
define void @callSendSignal(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @sendSignal()
ret void
}
void huff_print_char(c) int c;
{
  if (c >= 0x20 && c < 127)
    printf("'%c'", c);
  else
    printf("%3d", c);
}


x86 assembly (clang, -O0):
<huff_print_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jl     1145 <huff_print_char+0x35>
cmpl   $0x7f,-0x4(%rbp)
jge    1145 <huff_print_char+0x35>
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1156 <huff_print_char+0x46>
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<huff_print_char>:
mov    %edi,%esi
lea    -0x20(%rsi),%eax
cmp    $0x5f,%eax
lea    0xee1(%rip),%rax
lea    0xedf(%rip),%rdi
cmovb  %rax,%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"'%c'\00"
@.str.1 = [4 x i8] c"%3d\00"
define void @huff_print_char(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %4, i32 %0)
ret void
}
void s2e_disable_forking(void) {
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x0a, 0x00, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n");
}


x86 assembly (clang, -O0):
<s2e_disable_forking>:
push   %rbp
mov    %rsp,%rbp
(bad)
add    %cl,(%rdx)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_disable_forking>:
(bad)
add    %cl,(%rdx)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
ret

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

LLVM IR (-O2):
define void @s2e_disable_forking() {
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x0a, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void Timer1B_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Timer1B_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Timer1B_Handler+0x9>
jmp    1109 <Timer1B_Handler+0x9>

x86 assembly (clang, -O2):
<Timer1B_Handler>:
jmp    1100 <Timer1B_Handler>

LLVM IR (-O0):
define void @Timer1B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Timer1B_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *obdata;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
void set_XImage_obdata(void *_p, void *_v) {
  ((XImage *)_p)->obdata = (char *)_v;
}


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

x86 assembly (clang, -O2):
<set_XImage_obdata>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8* }
define void @set_XImage_obdata(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i8* %5, i8** %8
ret void
}

LLVM IR (-O2):
define void @set_XImage_obdata(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int string_hash(char const *);
void test(const char *c) { printf("hash of '%s' is %d\n", c, string_hash(c)); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_hash@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
call   1040 <string_hash@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"hash of '%s' is %d\0A\00"
define void @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @string_hash(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"hash of '%s' is %d\0A\00"
define void @test(i8* %0) {
%2 = tail call i32 @string_hash(i8* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
int func() {}


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

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

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

LLVM IR (-O2):
define i32 @func() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ sem_post(void *);
int __semaphore_post(void *h) { return sem_post(h) == 0; }


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

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

LLVM IR (-O0):
define i32 @__semaphore_post(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @sem_post(i8* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @__semaphore_post(i8* %0) {
%2 = tail call i64 @sem_post(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int double_to_d6(double x) { return (int)(x * 64); }


x86 assembly (clang, -O0):
<double_to_d6>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_to_d6>:
mulsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @double_to_d6(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 6.400000e+01
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @double_to_d6(double %0) {
%2 = fmul double %0, 6.400000e+01
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int util_thread_sleep(int msecs) {
  usleep(msecs * 1000);
  return msecs;
}


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

x86 assembly (clang, -O2):
<util_thread_sleep>:
push   %rbx
mov    %edi,%ebx
imul   $0x3e8,%edi,%edi
call   1030 <usleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @util_thread_sleep(i32 returned %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 %0
}
/* Variables and functions */
scalar_t__ grub_strcasecmp(char const *, char *);
int registerCharacterSet(const char *charset) {
  return grub_strcasecmp(charset, "UTF-8") == 0;
}


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

x86 assembly (clang, -O2):
<registerCharacterSet>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <grub_strcasecmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"UTF-8\00"
define i32 @registerCharacterSet(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @grub_strcasecmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"UTF-8\00"
define i32 @registerCharacterSet(i8* %0) {
%2 = tail call i64 @grub_strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *xrealloc(void *p, size_t size) {
  void *r = realloc(p, size);
  if (!r)
    fprintf(stderr, "realloc failed");
  return r;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <xrealloc+0x41>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xrealloc+0x23>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"realloc failed\00"
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"realloc failed\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void memory_error(void) {
  printf("Buffer memory exceeded in comptbl\n");
  printf("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/turboencabulator/tuxnes/refs/heads/master/"
         "src/comptbl.c"
         ":%d: increase ALLOC_SIZE and recompile\n",
         293);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<memory_error>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x125,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<memory_error>:
push   %rax
lea    0xf81(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
mov    $0x125,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Buffer memory exceeded in comptbl\0A\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/turboencabulator/tuxnes/refs/heads/master/src/comptbl.c:%d: increase ALLOC_SIZE and recompile\0A\00"
@EXIT_FAILURE = global i32 0
define void @memory_error() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 293)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/turboencabulator/tuxnes/refs/heads/master/src/comptbl.c:%d: increase ALLOC_SIZE and recompile\0A\00"
@EXIT_FAILURE = global i32 0
@str = [34 x i8] c"Buffer memory exceeded in comptbl\00"
define void @memory_error() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0), i32 293)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int ti_roc_start(double const *options) { return (int)options[0]; }


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

x86 assembly (clang, -O2):
<ti_roc_start>:
cvttsd2si (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ti_roc_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ti_roc_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
ret i32 %3
}
void tegra_smmu_suspend(struct tegra_smmu *smmu) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_smmu = type opaque
define void @tegra_smmu_suspend(%struct.tegra_smmu* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int print_opterr(int opt) {
  fprintf(stderr, "Invalid option: %c\n", opt);
  return 1;
}


x86 assembly (clang, -O0):
<print_opterr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_opterr>:
push   %rax
mov    %edi,%edx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Invalid option: %c\0A\00"
define i32 @print_opterr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Invalid option: %c\0A\00"
define i32 @print_opterr(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, b;
  scanf("%d", &n);
  b = n * n;
  printf("\n%d", b);
  printf("\n%d\n", b * n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
imul   -0x8(%rbp),%esi
lea    0xe9e(%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
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
imul   %ebx,%ebx
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
imul   0xc(%rsp),%ebx
lea    0xead(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
@.str.2 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %5
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tcp_veno_unregister();
void module_unregister_fake(void) {
  if (0)
    tcp_veno_unregister();
}


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

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

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

LLVM IR (-O2):
define void @module_unregister_fake() {
ret void
}
/* Variables and functions */
scalar_t__ func_81(int);
int /*<<< orphan*/ func_98(int);
void func_18(int t) {
  unsigned l_889;
  int l_895 = 1;
  for (0; 1; ++l_889) {
    int t1 = 0;
    if (func_81(1)) {
      int rhs = l_895;
      if (rhs == 0)
        rhs = 1;
      if (1 & (t % rhs))
        t1 = 1;
    }
    func_98(t1);
    l_895 = 0;
  }
}


x86 assembly (clang, -O0):
<func_18>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1141 <func_18+0x21>
jmp    11af <func_18+0x8f>
movl   $0x0,-0x10(%rbp)
mov    $0x1,%edi
call   1030 <func_81@plt>
cmp    $0x0,%rax
je     1192 <func_18+0x72>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1173 <func_18+0x53>
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x14(%rbp)
and    $0x1,%edx
cmp    $0x0,%edx
je     118d <func_18+0x6d>
movl   $0x1,-0x10(%rbp)
jmp    1192 <func_18+0x72>
mov    -0x10(%rbp),%edi
call   1040 <func_98@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <func_18+0x12>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_18>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <func_81@plt>
xor    %edi,%edi
call   1040 <func_98@plt>
jmp    1130 <func_18+0x10>

LLVM IR (-O0):
define void @func_18(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %4
br label %7
7: ; preds = %27, %1
br i1 true, label %8, label %30
8: ; preds = %7
store i32 0, i32* %5
%9 = call i64 @func_81(i32 1)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32, i32* %4
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %6
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %2
%18 = load i32, i32* %6
%19 = srem i32 %17, %18
%20 = and i32 1, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %16
store i32 1, i32* %5
br label %23
23: ; preds = %22, %16
br label %24
24: ; preds = %23, %8
%25 = load i32, i32* %5
%26 = call i32 @func_98(i32 %25)
store i32 0, i32* %4
br label %27
27: ; preds = %24
%28 = load i32, i32* %3
%29 = add i32 %28, 1
store i32 %29, i32* %3
br label %7
30: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @func_18(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 @func_81(i32 1)
%4 = tail call i32 @func_98(i32 0)
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t hci_event_inquiry_result_get_num_responses(const uint8_t *event) {
  return event[2];
}


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

x86 assembly (clang, -O2):
<hci_event_inquiry_result_get_num_responses>:
mov    0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hci_event_inquiry_result_get_num_responses(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hci_event_inquiry_result_get_num_responses(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t is_edx_inuse(uint32_t bitmap) { return (bitmap & (0x1 << 3)); }


x86 assembly (clang, -O0):
<is_edx_inuse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_edx_inuse>:
mov    %edi,%eax
and    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @is_edx_inuse(i32 %0) {
%2 = and i32 %0, 8
ret i32 %2
}
float fastLog10(int *x_bits, float *Log10LUT) {
  return (Log10LUT[(*x_bits & 0x7FFFFF) >> (23 - 8)] +
          (float)((0x0FF & ((*x_bits >> 23))) - 127) *
              0.30102999566398119521373889472449f);
}


x86 assembly (clang, -O0):
<fastLog10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    $0x7fffff,%ecx
sar    $0xf,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x17,%eax
and    $0xff,%eax
sub    $0x7f,%eax
cvtsi2ss %eax,%xmm0
movss  0xebc(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastLog10>:
mov    (%rdi),%eax
mov    %rax,%rcx
shr    $0xd,%rcx
and    $0x3fc,%ecx
shr    $0x17,%eax
movzbl %al,%eax
add    $0xffffff81,%eax
cvtsi2ss %eax,%xmm0
mulss  0xedc(%rip),%xmm0
addss  (%rsi,%rcx,1),%xmm0
ret

LLVM IR (-O0):
define float @fastLog10(i32* %0, float* %1) {
%3 = alloca i32*
%4 = alloca float*
store i32* %0, i32** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = and i32 %7, 8388607
%9 = ashr i32 %8, 15
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds float, float* %5, i64 %10
%12 = load float, float* %11
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = ashr i32 %14, 23
%16 = and i32 255, %15
%17 = sub nsw i32 %16, 127
%18 = sitofp i32 %17 to float
%19 = call float @llvm.fmuladd.f32(float %18, float 0x3FD3441360000000, float %12)
ret float %19
}

LLVM IR (-O2):
define float @fastLog10(i32* nocapture %0, float* nocapture %1) {
%3 = load i32, i32* %0
%4 = lshr i32 %3, 15
%5 = and i32 %4, 255
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds float, float* %1, i64 %6
%8 = load float, float* %7
%9 = lshr i32 %3, 23
%10 = and i32 %9, 255
%11 = add nsw i32 %10, -127
%12 = sitofp i32 %11 to float
%13 = tail call float @llvm.fmuladd.f32(float %12, float 0x3FD3441360000000, float %8)
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void g(char *x) { free(x); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @g(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_opt(int, char **);
int /*<<< orphan*/ modify_flags();
int /*<<< orphan*/ use_flags();
int main(int argc, char **argv) {
  get_opt(argc, argv);
  use_flags();
  modify_flags();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1050 <get_opt@plt>
xor    %eax,%eax
call   1030 <use_flags@plt>
xor    %eax,%eax
call   1040 <modify_flags@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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @get_opt(i32 %6, i8** %7)
%9 = call i32 (...) @use_flags()
%10 = call i32 (...) @modify_flags()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @get_opt(i32 %0, i8** %1)
%4 = tail call i32 (...) @use_flags()
%5 = tail call i32 (...) @modify_flags()
ret i32 0
}
void acpi_cmos_rtc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_cmos_rtc_init() {
ret void
}
/* Type definitions */
struct MHD_Connection {
  int dummy;
};

/* Variables and functions */
int ahc_nothing(void *cls, struct MHD_Connection *connection, const char *url,
                const char *method, const char *version,
                const char *upload_data, size_t *upload_data_size,
                void **unused) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.MHD_Connection = type { i32 }
define i32 @ahc_nothing(i8* %0, %struct.MHD_Connection* %1, i8* %2, i8* %3, i8* %4, i8* %5, i64* %6, i8** %7) {
%9 = alloca i8*
%10 = alloca %struct.MHD_Connection*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i64*
%16 = alloca i8**
store i8* %0, i8** %9
store %struct.MHD_Connection* %1, %struct.MHD_Connection** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i64* %6, i64** %15
store i8** %7, i8*** %16
ret i32 0
}

LLVM IR (-O2):
%struct.MHD_Connection = type { i32 }
define i32 @ahc_nothing(i8* nocapture readnone %0, %struct.MHD_Connection* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4, i8* nocapture readnone %5, i64* nocapture readnone %6, i8** nocapture readnone %7) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ arc4random_buf(double *, int);
double random_value() {
  double x;
  arc4random_buf(&x, sizeof x);
  return x;
}


x86 assembly (clang, -O0):
<random_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <arc4random_buf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_value>:
push   %rax
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <arc4random_buf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @random_value() {
%1 = alloca double
%2 = call i32 @arc4random_buf(double* %1, i32 8)
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @random_value() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @arc4random_buf(double* %1, i32 8)
%4 = load double, double* %1
ret double %4
}
double min(double a, double b) {
  double minimum = a < b ? a : b;
  return minimum;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    113b <min+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %4
br label %13
13: ; preds = %11, %9
%14 = phi double [ %10, %9 ], [ %12, %11 ]
store double %14, double* %5
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
double exp(double);
double pow(double, double);
FT(double FT) {
  double q5, b;
  if (FT > 10) {
    return 1;
  }
  b = -1.680 * pow(FT, 0.3325);
  q5 = 213.7 * exp(b);
  return q5;
}


x86 assembly (clang, -O0):
<FT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1150 <FT+0x30>
movl   $0x1,-0x4(%rbp)
jmp    119c <FT+0x7c>
movsd  -0x10(%rbp),%xmm0
movsd  0xebb(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe7d(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvttsd2si -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FT>:
push   %rax
mov    $0x1,%eax
ucomisd 0xed2(%rip),%xmm0
ja     1156 <FT+0x36>
movsd  0xed0(%rip),%xmm1
call   1040 <pow@plt>
mulsd  0xecb(%rip),%xmm0
call   1030 <exp@plt>
mulsd  0xec6(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @FT(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
%6 = load double, double* %3
%7 = fcmp ogt double %6, 1.000000e+01
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %18
9: ; preds = %1
%10 = load double, double* %3
%11 = call double @pow(double %10, double 3.325000e-01)
%12 = fmul double -1.680000e+00, %11
store double %12, double* %5
%13 = load double, double* %5
%14 = call double @exp(double %13)
%15 = fmul double 2.137000e+02, %14
store double %15, double* %4
%16 = load double, double* %4
%17 = fptosi double %16 to i32
store i32 %17, i32* %2
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @FT(double %0) {
%2 = fcmp ogt double %0, 1.000000e+01
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call double @pow(double %0, double 3.325000e-01)
%5 = fmul double %4, -1.680000e+00
%6 = tail call double @exp(double %5)
%7 = fmul double %6, 2.137000e+02
%8 = fptosi double %7 to i32
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ print_ch2(int /*<<< orphan*/, int, char const);
void print_text(int x, int y, const char *str) {
  int i;
  for (i = 0; i < 112; ++str, i++) {
    print_ch2(x++, y, *str);
  }
}


x86 assembly (clang, -O0):
<print_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x70,-0x14(%rbp)
jge    1167 <print_text+0x57>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
call   1030 <print_ch2@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <print_text+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_text>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %esi,%r15d
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    (%rbx,%rbp,1),%edi
movsbl (%r14,%rbp,1),%edx
mov    %r15d,%esi
call   1030 <print_ch2@plt>
add    $0x1,%rbp
cmp    $0x70,%ebp
jne    1130 <print_text+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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