xunge/DecIR huggingface dataset:
/* Variables and functions */
int mkstemps(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
int get_temp_name(char *target, char *suffix) {
  strcpy(target, "amk_XXXXXX");
  strcat(target, suffix);
  return mkstemps(target, strlen(suffix)) == -1;
}


x86 assembly (clang, -O0):
<get_temp_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1030 <mkstemps@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_temp_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeaf(%rip),%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <mkstemps@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"amk_XXXXXX\00"
define i32 @get_temp_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @strcat(i8* %7, i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @mkstemps(i8* %10, i32 %12)
%14 = icmp eq i32 %13, -1
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"amk_XXXXXX\00"
define i32 @get_temp_name(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* %0, i8* %1)
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @mkstemps(i8* %0, i32 %5)
%7 = icmp eq i32 %6, -1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ lnxcDisplaySetScreen();
void linuxDisplaySetScreen(int window) {
  if (window) {
  } else {
    lnxcDisplaySetScreen();
  }
}


x86 assembly (clang, -O0):
<linuxDisplaySetScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112a <linuxDisplaySetScreen+0x1a>
jmp    1131 <linuxDisplaySetScreen+0x21>
mov    $0x0,%al
call   1030 <lnxcDisplaySetScreen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linuxDisplaySetScreen>:
test   %edi,%edi
je     1115 <linuxDisplaySetScreen+0x5>
ret
xor    %eax,%eax
jmp    1030 <lnxcDisplaySetScreen@plt>

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

LLVM IR (-O2):
define void @linuxDisplaySetScreen(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @lnxcDisplaySetScreen()
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void part_1_1() {
  printf("hello, !!!! ooooa aaa ");
  printf("world");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<part_1_1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"hello, !!!! ooooa aaa \00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @part_1_1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"hello, !!!! ooooa aaa \00"
@.str.1 = [6 x i8] c"world\00"
define void @part_1_1() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanUpAndFail(int);
void compressedStreamEOF(void) { cleanUpAndFail(2); }


x86 assembly (clang, -O0):
<compressedStreamEOF>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <cleanUpAndFail@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<compressedStreamEOF>:
mov    $0x2,%edi
jmp    1030 <cleanUpAndFail@plt>

LLVM IR (-O0):
define void @compressedStreamEOF() {
%1 = call i32 @cleanUpAndFail(i32 2)
ret void
}

LLVM IR (-O2):
define void @compressedStreamEOF() {
%1 = tail call i32 @cleanUpAndFail(i32 2)
ret void
}
/* Variables and functions */
int a_cas(int volatile *, int, int);
int a_swap(volatile int *p, int v) {
  int old;
  do
    old = *p;
  while (a_cas(p, old, v) != old);
  return old;
}


x86 assembly (clang, -O0):
<a_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <a_cas@plt>
cmp    -0x10(%rbp),%eax
jne    111f <a_swap+0xf>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_swap>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <a_cas@plt>
cmp    %ebp,%eax
jne    1120 <a_swap+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @a_swap(i32* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = load volatile i32, i32* %0
%5 = tail call i32 @a_cas(i32* %0, i32 %4, i32 %1)
%6 = icmp eq i32 %5, %4
br i1 %6, label %7, label %3
7: ; preds = %3
ret i32 %4
}
void free_4d(int ****ptr) {
  free(ptr[0][0][0]);
  free(ptr[0][0]);
  free(ptr[0]);
  free(ptr);
}


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

x86 assembly (clang, -O2):
<free_4d>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_4d(i32**** nocapture %0) {
%2 = bitcast i32**** %0 to i8****
%3 = load i8***, i8**** %2
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = bitcast i32**** %0 to i8***
%7 = load i8**, i8*** %6
%8 = load i8*, i8** %7
tail call void @free(i8* %8)
%9 = bitcast i32**** %0 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = bitcast i32**** %0 to i8*
tail call void @free(i8* %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ICPrint() { printf("Hello, mama!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, mama!\0A\00"
define void @ICPrint() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello, mama!\00"
define void @ICPrint() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
void target_sound_signal(void) {}


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

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

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

LLVM IR (-O2):
define void @target_sound_signal() {
ret void
}
void replaceClientCommandVector(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               106, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<replaceClientCommandVector>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6a,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<replaceClientCommandVector>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x6a,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.replaceClientCommandVector = [27 x i8] c"replaceClientCommandVector\00"
define void @replaceClientCommandVector() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.replaceClientCommandVector, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.replaceClientCommandVector = [27 x i8] c"replaceClientCommandVector\00"
define void @replaceClientCommandVector() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 106, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__func__.replaceClientCommandVector, i64 0, i64 0))
ret void
}
int main() {
  const unsigned N = 1 << 5;
  unsigned A[N];
  for (unsigned i = 0; i < N; ++i) {
    A[i] = i;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jae    1149 <main+0x49>
mov    -0x14(%rbp),%ecx
mov    -0x14(%rbp),%eax
mov    %ecx,-0xa0(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1124 <main+0x24>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
store i32 32, i32* %2
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %3
%6 = alloca i32, i64 32
store i32 0, i32* %4
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %4
%9 = icmp ult i32 %8, 32
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %6, i64 %13
store i32 %11, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %4
%17 = add i32 %16, 1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
%19 = load i8*, i8** %3
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ R(int);
int /*<<< orphan*/ U();
void step2c() {
  R(2);
  U();
  R(2);
}


x86 assembly (clang, -O0):
<step2c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <R@plt>
mov    $0x0,%al
call   1040 <U@plt>
mov    $0x2,%edi
call   1030 <R@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<step2c>:
push   %rax
mov    $0x2,%edi
call   1030 <R@plt>
xor    %eax,%eax
call   1040 <U@plt>
mov    $0x2,%edi
pop    %rax
jmp    1030 <R@plt>

LLVM IR (-O0):
define void @step2c() {
%1 = call i32 @R(i32 2)
%2 = call i32 (...) @U()
%3 = call i32 @R(i32 2)
ret void
}

LLVM IR (-O2):
define void @step2c() {
%1 = tail call i32 @R(i32 2)
%2 = tail call i32 (...) @U()
%3 = tail call i32 @R(i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int ID;
#pragma omp parallel private(ID)
  {
    ID = 0;
    printf("Hello(%d)", ID);
    printf("World(%d)\n", ID);
  }
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello(%d)\00"
@.str.1 = [11 x i8] c"World(%d)\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
ret i32 0
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
double wi_tvtod(struct timeval tv) {
  return tv.tv_sec + ((double)tv.tv_usec / 1000000.0);
}


x86 assembly (clang, -O0):
<wi_tvtod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %rdi,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wi_tvtod>:
cvtsi2sd %rdi,%xmm1
divsd  0xef3(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @wi_tvtod(double %0, i64 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { double, i64 }*
%5 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i64 }, { double, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+06
%13 = fadd double %8, %12
ret double %13
}

LLVM IR (-O2):
define double @wi_tvtod(double %0, i64 %1) {
%3 = sitofp i64 %1 to double
%4 = fdiv double %3, 1.000000e+06
%5 = fadd double %4, %0
ret double %5
}
void gtk_text_view_place_cursor_onscreen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_place_cursor_onscreen() {
ret void
}
void g721_test(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct xlist_node_t *);
int xlist_node_destroy(struct xlist_node_t *n) {
  free(n);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.xlist_node_t = type { i32 }
define i32 @xlist_node_destroy(%struct.xlist_node_t* nocapture %0) {
%2 = tail call i32 @free(%struct.xlist_node_t* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ floor(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_floor(void) { lua_pushnumber(floor(luaL_check_number(1))); }


x86 assembly (clang, -O0):
<math_floor>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    %eax,%edi
call   1040 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_floor>:
push   %rax
mov    $0x1,%edi
call   1030 <luaL_check_number@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_floor() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @floor(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @math_floor() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @floor(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRA7_set(void) { return U_WMRCORENONE_set("U_WMRA7"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRA7\00"
define i8* @U_WMRA7_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRA7\00"
define i8* @U_WMRA7_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
char *dcgettext(const char *domainname, const char *msgid, int category) {
  (void)domainname;
  (void)category;
  return (char *)msgid;
}


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

x86 assembly (clang, -O2):
<dcgettext>:
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i8* @dcgettext(i8* nocapture readnone %0, i8* readnone returned %1, i32 %2) {
ret i8* %1
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ lstat(char const *, struct stat *);
int is_file(const char *path) {
  struct stat statbuf;
  if (lstat(path, &statbuf) == 0)
    return S_ISREG(statbuf.st_mode) != 0;
  return 0;
}


x86 assembly (clang, -O0):
<is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <lstat@plt>
cmp    $0x0,%rax
jne    115f <is_file+0x3f>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <is_file+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <lstat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <is_file+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @is_file(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 @lstat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i64 @S_ISREG(i32 %10)
%12 = icmp ne i64 %11, 0
%13 = zext i1 %12 to i32
store i32 %13, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_file(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @lstat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %1, %6
%13 = phi i32 [ %11, %6 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
unsigned char *hmac_haval256(unsigned char *, unsigned char const *, size_t,
                             unsigned char const *, size_t);
unsigned char *mac_hmac_haval256(unsigned char *out, const unsigned char *key,
                                 size_t key_len, const unsigned char *msg,
                                 size_t msg_len) {
  return hmac_haval256(out, key, key_len, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_hmac_haval256>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <hmac_haval256@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_hmac_haval256>:
jmp    1030 <hmac_haval256@plt>

LLVM IR (-O0):
define i8* @mac_hmac_haval256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i8* @hmac_haval256(i8* %11, i8* %12, i64 %13, i8* %14, i64 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @mac_hmac_haval256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i8* @hmac_haval256(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4)
ret i8* %6
}
/* Type definitions */
struct t_config_option {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ config_change_save_config_layout_on_exit();
void config_change_save_layout_on_exit(void *data,
                                       struct t_config_option *option) {
  (void)data;
  (void)option;
  config_change_save_config_layout_on_exit();
}


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

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

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

LLVM IR (-O2):
%struct.t_config_option = type { i32 }
define void @config_change_save_layout_on_exit(i8* nocapture readnone %0, %struct.t_config_option* nocapture readnone %1) {
%3 = tail call i32 (...) @config_change_save_config_layout_on_exit()
ret void
}
int atTop(int *stack, int top) { return stack[top]; }


x86 assembly (clang, -O0):
<atTop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atTop>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @atTop(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @atTop(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xbc() {
  Assert_real((islower(188) == 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_islower.c",
              945, ("islower should be 0 for 0xbc"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xbc>:
push   %rax
mov    $0xbc,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3b1,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xbc\00"
define void @t_islower_0xbc() {
%1 = call i64 @islower(i32 188)
%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 945, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xbc\00"
define void @t_islower_0xbc() {
%1 = tail call i64 @islower(i32 188)
%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 945, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
long int get_stat_birthtime_ns(struct stat const *st) {
  (void)st;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i64 @get_stat_birthtime_ns(%struct.stat* %0) {
%2 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %2
%3 = load %struct.stat*, %struct.stat** %2
ret i64 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i64 @get_stat_birthtime_ns(%struct.stat* nocapture readnone %0) {
ret i64 0
}
/* Variables and functions */
void *cbmap_nop_allocator(void *data, size_t data_len) { return data; }


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

x86 assembly (clang, -O2):
<cbmap_nop_allocator>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @cbmap_nop_allocator(i8* readnone returned %0, i64 %1) {
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ optval;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEPORT;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void socket_pre_bind(int fd) {
  int optval = 1;
  assert(!setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &optval, sizeof(optval)));
}


x86 assembly (clang, -O0):
<socket_pre_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_pre_bind>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEPORT = global i32 0
define void @socket_pre_bind(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @SOL_SOCKET
%6 = load i32, i32* @SO_REUSEPORT
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEPORT = global i32 0
define void @socket_pre_bind(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEPORT
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret void
}
/* Variables and functions */
double gsl_stats_mean(double *, int, int);
double mean(double data[], int n) { return gsl_stats_mean(data, 1, n); }


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

x86 assembly (clang, -O2):
<mean>:
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <gsl_stats_mean@plt>

LLVM IR (-O0):
define double @mean(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call double @gsl_stats_mean(double* %5, i32 1, i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @mean(double* %0, i32 %1) {
%3 = tail call double @gsl_stats_mean(double* %0, i32 1, i32 %1)
ret double %3
}
void gtk_widget_add_events() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_add_events() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void mtd_write_firmware(char *filename, int offset, int len) {
  char cmd[512];
  fprintf(stderr, "goahead: no CONFIG_RT2880_ROOTFS defined!");
  return;
}


x86 assembly (clang, -O0):
<mtd_write_firmware>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eb4(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtd_write_firmware>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"goahead: no CONFIG_RT2880_ROOTFS defined!\00"
define void @mtd_write_firmware(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [512 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"goahead: no CONFIG_RT2880_ROOTFS defined!\00"
define void @mtd_write_firmware(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ concat_rpn(char *, char *);
void concat_operator(char *str, char *op) { concat_rpn(str, op); }


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

x86 assembly (clang, -O2):
<concat_operator>:
jmp    1030 <concat_rpn@plt>

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

LLVM IR (-O2):
define void @concat_operator(i8* %0, i8* %1) {
%3 = tail call i32 @concat_rpn(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main() {
  char *t = "XXX";
  printf("Length of <%s> is %lu.\n", t, strlen(t));
  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)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"XXX\00"
@.str.1 = [24 x i8] c"Length of <%s> is %lu.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"XXX\00"
@.str.1 = [24 x i8] c"Length of <%s> is %lu.\0A\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
struct ldv_kref {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ldv_kobject_cleanup(void *);
void ldv_kobject_release(struct ldv_kref *kref) {
  ldv_kobject_cleanup((void *)kref);
}


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

x86 assembly (clang, -O2):
<ldv_kobject_release>:
jmp    1030 <ldv_kobject_cleanup@plt>

LLVM IR (-O0):
%struct.ldv_kref = type { i32 }
define void @ldv_kobject_release(%struct.ldv_kref* %0) {
%2 = alloca %struct.ldv_kref*
store %struct.ldv_kref* %0, %struct.ldv_kref** %2
%3 = load %struct.ldv_kref*, %struct.ldv_kref** %2
%4 = bitcast %struct.ldv_kref* %3 to i8*
%5 = call i32 @ldv_kobject_cleanup(i8* %4)
ret void
}

LLVM IR (-O2):
%struct.ldv_kref = type { i32 }
define void @ldv_kobject_release(%struct.ldv_kref* %0) {
%2 = bitcast %struct.ldv_kref* %0 to i8*
%3 = tail call i32 @ldv_kobject_cleanup(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t hci_event_authentication_complete_event_get_connection_handle(
    const uint8_t *event) {
  return little_endian_read_16(event, 3);
}


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

x86 assembly (clang, -O2):
<hci_event_authentication_complete_event_get_connection_handle>:
mov    $0x3,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @hci_event_authentication_complete_event_get_connection_handle(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 3)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void handler(int signo __attribute__((unused))) {
  raise(SIGKILL);
  exit(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGKILL = global i32 0
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGKILL
%4 = call i32 @raise(i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIGKILL = global i32 0
define void @handler(i32 %0) {
%2 = load i32, i32* @SIGKILL
%3 = tail call i32 @raise(i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
void RTPRINT(struct rtl_priv *rtlpriv, int dbgtype, int dbgflag,
             const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
%struct.rtl_priv = type opaque
define void @RTPRINT(%struct.rtl_priv* nocapture %0, i32 %1, i32 %2, i8* nocapture %3, ...) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *memset(char *, int, int);
char *initMap(void) {
  char *map = (char *)malloc(sizeof(char) * 9);
  map = memset(map, 0x30, 9);
  return map;
}


x86 assembly (clang, -O0):
<initMap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x30,%esi
mov    $0x9,%edx
call   1030 <memset@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initMap>:
push   %rax
mov    $0x9,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0x30,%esi
mov    $0x9,%edx
pop    %rax
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @initMap() {
%1 = alloca i8*
%2 = call i64 @malloc(i32 9)
%3 = inttoptr i64 %2 to i8*
store i8* %3, i8** %1
%4 = load i8*, i8** %1
%5 = call i8* @memset(i8* %4, i32 48, i32 9)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
define i8* @initMap() {
%1 = tail call i64 @malloc(i32 9)
%2 = inttoptr i64 %1 to i8*
%3 = tail call i8* @memset(i8* %2, i32 48, i32 9)
ret i8* %3
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t byte_order(uint32_t i) {
  uint32_t x;
  uint8_t *bytes = (uint8_t *)&x;
  bytes[0] = i >> 24 & 0xFF;
  bytes[1] = i >> 16 & 0xFF;
  bytes[2] = i >> 8 & 0xFF;
  bytes[3] = i & 0xFF;
  return x;
}


x86 assembly (clang, -O0):
<byte_order>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byte_order>:
mov    %edi,%eax
shr    $0x18,%eax
ret

LLVM IR (-O0):
define i32 @byte_order(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
store i32* %3, i32** %4
%5 = load i32, i32* %2
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %4
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %2
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %2
%21 = and i32 %20, 255
%22 = load i32*, i32** %4
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @byte_order(i32 %0) {
%2 = lshr i32 %0, 24
ret i32 %2
}
void set_max_history(n) { stifle_history(n); }


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

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

LLVM IR (-O0):
define void @set_max_history(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @stifle_history to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @set_max_history(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @stifle_history to i32 (i32, ...)*)(i32 %0)
ret void
}
unsigned long DCSMZone1CSMSecurityStatus(void) {
  unsigned long status;
  status = (*((volatile unsigned long *)(0x400FB400 + 0x00000080)));
  if ((status & 0x0800) && ((status & 0x0200) || (status & 0x0080))) {
    return (0);
  } else {
    return (1);
  }
}


x86 assembly (clang, -O0):
<DCSMZone1CSMSecurityStatus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fb480,%eax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x800,%rax
cmp    $0x0,%rax
je     1159 <DCSMZone1CSMSecurityStatus+0x59>
mov    -0x10(%rbp),%rax
and    $0x200,%rax
cmp    $0x0,%rax
jne    114c <DCSMZone1CSMSecurityStatus+0x4c>
mov    -0x10(%rbp),%rax
and    $0x80,%rax
cmp    $0x0,%rax
je     1159 <DCSMZone1CSMSecurityStatus+0x59>
movq   $0x0,-0x8(%rbp)
jmp    1161 <DCSMZone1CSMSecurityStatus+0x61>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCSMZone1CSMSecurityStatus>:
mov    0x400fb480,%rax
40
test   $0x800,%eax
sete   %cl
test   $0x280,%eax
sete   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i64 @DCSMZone1CSMSecurityStatus() {
%1 = alloca i64
%2 = alloca i64
%3 = load volatile i64, i64* inttoptr (i64 1074771072 to i64*)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = and i64 %4, 2048
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %0
%8 = load i64, i64* %2
%9 = and i64 %8, 512
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i64, i64* %2
%13 = and i64 %12, 128
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11, %7
store i64 0, i64* %1
br label %17
16: ; preds = %11, %0
store i64 1, i64* %1
br label %17
17: ; preds = %16, %15
%18 = load i64, i64* %1
ret i64 %18
}

LLVM IR (-O2):
define i64 @DCSMZone1CSMSecurityStatus() {
%1 = load volatile i64, i64* inttoptr (i64 1074771072 to i64*)
%2 = and i64 %1, 2048
%3 = icmp eq i64 %2, 0
%4 = and i64 %1, 640
%5 = icmp eq i64 %4, 0
%6 = or i1 %3, %5
%7 = zext i1 %6 to i64
ret i64 %7
}