xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *thread(void *arg) {
  int *num;
  num = (int *)arg;
  printf("thread parameter is %i\n", *num);
  return (void *)0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"thread parameter is %i\0A\00"
define i8* @thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i8* null
}

LLVM IR (-O2):
@.str = [24 x i8] c"thread parameter is %i\0A\00"
define noalias i8* @thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void close_log(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @close_log() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_speed_2();
void test() { test_speed_2(); }


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

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

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

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @test_speed_2()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
scalar_t__ time(int /*<<< orphan*/ *);
void stop_counting(FILE *fd) {
  int tnow = (int)time(NULL);
  fseek(fd, -1, SEEK_END);
  fprintf(fd, " %i\n", tnow);
}


x86 assembly (clang, -O0):
<stop_counting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_counting>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %rax,%r14
mov    0x2ea0(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0xffffffff,%esi
call   1050 <fseek@plt>
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
@.str = [5 x i8] c" %i\0A\00"
define void @stop_counting(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = load i32*, i32** %2
%7 = load i32, i32* @SEEK_END
%8 = call i32 @fseek(i32* %6, i32 -1, i32 %7)
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
ret void
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@.str = [5 x i8] c" %i\0A\00"
define void @stop_counting(i32* nocapture %0) {
%2 = tail call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = load i32, i32* @SEEK_END
%5 = tail call i32 @fseek(i32* %0, i32 -1, i32 %4)
%6 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int sumToN(int n) {
  if (n != 0)
    return n + sumToN(n - 1);
}


x86 assembly (clang, -O0):
<sumToN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1140 <sumToN+0x30>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sumToN@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sumToN(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__1__IO__makeOutput();
void LedsP__Led1__makeOutput(void) {
  HplAtm128GeneralIOPinP__1__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @LedsP__Led1__makeOutput() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__1__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void copyright(void) {
  fprintf(stderr, "umkpasswd - Copyright (c) 2002 hikari\n");
  return;
}


x86 assembly (clang, -O0):
<copyright>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"umkpasswd - Copyright (c) 2002 hikari\0A\00"
define void @copyright() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"umkpasswd - Copyright (c) 2002 hikari\0A\00"
define void @copyright() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void pattern(int n) {
  n -= 5;
  printf(" %d", n);
  if (n <= 0) {
    return;
  }
  pattern(n);
  n += 5;
  printf(" %d", n);
}


x86 assembly (clang, -O0):
<pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
jg     1152 <pattern+0x32>
jmp    1172 <pattern+0x52>
mov    -0x4(%rbp),%edi
call   1040 <pattern@plt>
mov    -0x4(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pattern>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x5(%rbx),%ebp
lea    0xed1(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    $0x5,%ebx
jg     1142 <pattern+0x22>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
call   1040 <pattern@plt>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @pattern(i32 %0) {
%2 = add nsw i32 %0, -5
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp slt i32 %0, 6
br i1 %4, label %5, label %6
5: ; preds = %1, %6
ret void
6: ; preds = %1
tail call void @pattern(i32 %2)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x01() {
  Assert_real((isascii(1)),
              "/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_isascii.c",
              10, ("isascii should be 1 for 0x01"));
}


x86 assembly (clang, -O0):
<t_isascii_0x01>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xa,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x01>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0xa,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x01\00"
define void @t_isascii_0x01() {
%1 = call i32 @isascii(i32 1)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 10, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x01\00"
define void @t_isascii_0x01() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
#define EINVAL 128
int /*<<< orphan*/ printf(char *, char *);
void validaSemPost(int e) {
  char *mensaje = "\n\t-Se produjo el error";
  switch (e) {
  case EINVAL:
    printf("%s EINVAL (The sem argument does not refer to a valid semaphore.) "
           "\n\n",
           mensaje);
    break;
  }
}


x86 assembly (clang, -O0):
<validaSemPost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1149 <validaSemPost+0x39>
jmp    1139 <validaSemPost+0x29>
mov    -0x10(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validaSemPost>:
cmp    $0x80,%edi
jne    112b <validaSemPost+0x1b>
lea    0xef8(%rip),%rdi
lea    0xeda(%rip),%rsi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0A\09-Se produjo el error\00"
@.str.1 = [69 x i8] c"%s EINVAL (The sem argument does not refer to a valid semaphore.) \0A\0A\00"
define void @validaSemPost(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 128, label %5
]
5: ; preds = %1
%6 = load i8*, i8** %3
%7 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %1, %5
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0A\09-Se produjo el error\00"
@.str.1 = [69 x i8] c"%s EINVAL (The sem argument does not refer to a valid semaphore.) \0A\0A\00"
define void @validaSemPost(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ logfmt(int, char *, size_t);
void *malloc(size_t);
void *smalloc(size_t s) {
  void *p = malloc(s);
  if (!p) {
    logfmt(0x0001,
           "Out of memory. Could not allocate %zd bytes."
           "\n",
           s);
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<smalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <smalloc+0x43>
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xe9c(%rip),%rsi
call   1040 <logfmt@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1140 <smalloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rsi
mov    $0x1,%edi
mov    %rbx,%rdx
call   1040 <logfmt@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Out of memory. Could not allocate %zd bytes.\0A\00"
define i8* @smalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @logfmt(i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [46 x i8] c"Out of memory. Could not allocate %zd bytes.\0A\00"
define noalias i8* @smalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @logfmt(i32 1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret i8* %2
}
void udev_selinux_setfscreatecon(struct udev *udev, const char *file,
                                 unsigned int mode) {}


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

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

LLVM IR (-O0):
%struct.udev = type opaque
define void @udev_selinux_setfscreatecon(%struct.udev* %0, i8* %1, i32 %2) {
%4 = alloca %struct.udev*
%5 = alloca i8*
%6 = alloca i32
store %struct.udev* %0, %struct.udev** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.udev = type opaque
define void @udev_selinux_setfscreatecon(%struct.udev* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rightDropAtPos(int);
int /*<<< orphan*/ writeDebugStreamLine(char *);
void rightOuterCrate2() {
  writeDebugStreamLine("Crate 2");
  rightDropAtPos(1);
}


x86 assembly (clang, -O0):
<rightOuterCrate2>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
mov    $0x1,%edi
call   1040 <rightDropAtPos@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightOuterCrate2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeDebugStreamLine@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <rightDropAtPos@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Crate 2\00"
define void @rightOuterCrate2() {
%1 = call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @rightDropAtPos(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Crate 2\00"
define void @rightOuterCrate2() {
%1 = tail call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @rightDropAtPos(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void handler(int signo) {
  sleep(600);
  assert(0);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x258,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    $0x258,%edi
call   1040 <sleep@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sleep(i32 600)
%4 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @handler(i32 %0) {
%2 = tail call i32 @sleep(i32 600)
%3 = tail call i32 @assert(i32 0)
ret void
}
void Counter_3_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @Counter_3_SaveConfig() {
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void LCDIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000005C))) = ui32IntFlags;
}


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

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

LLVM IR (-O0):
define void @LCDIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 92
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @LCDIntClear(i64 %0, i64 %1) {
%3 = add i64 %0, 92
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cfg_get_vicmd(int *);
char *expand_macros(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
char *format_str(char *, int /*<<< orphan*/, char *const);
int /*<<< orphan*/ free(char *const);
char *format_edit_selection_cmd(int *bg) {
  char *const files = expand_macros("%f", NULL, NULL, 1);
  char *const cmd = format_str("%s %s", cfg_get_vicmd(bg), files);
  free(files);
  return cmd;
}


x86 assembly (clang, -O0):
<format_edit_selection_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x1,%ecx
mov    %rdx,%rsi
call   1060 <expand_macros@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cfg_get_vicmd@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
lea    0xe85(%rip),%rdi
call   1050 <format_str@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_edit_selection_cmd>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeb2(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1060 <expand_macros@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <cfg_get_vicmd@plt>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1050 <format_str@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [6 x i8] c"%s %s\00"
define i8* @format_edit_selection_cmd(i32* %0) {
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i8*
store i32* %0, i32** %2
%5 = call i8* @expand_macros(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32 1)
store i8* %5, i8** %3
%6 = load i32*, i32** %2
%7 = call i32 @cfg_get_vicmd(i32* %6)
%8 = load i8*, i8** %3
%9 = call i8* @format_str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %3
%11 = call i32 @free(i8* %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [6 x i8] c"%s %s\00"
define i8* @format_edit_selection_cmd(i32* %0) {
%2 = tail call i8* @expand_macros(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* null, i32* null, i32 1)
%3 = tail call i32 @cfg_get_vicmd(i32* %0)
%4 = tail call i8* @format_str(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %3, i8* %2)
%5 = tail call i32 @free(i8* %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ atomic_thread_fence(int /*<<< orphan*/);
int /*<<< orphan*/ memory_order_release;
void aeron_release() { atomic_thread_fence(memory_order_release); }


x86 assembly (clang, -O0):
<aeron_release>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <atomic_thread_fence@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_release>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <atomic_thread_fence@plt>

LLVM IR (-O0):
@memory_order_release = global i32 0
define void @aeron_release() {
%1 = load i32, i32* @memory_order_release
%2 = call i32 @atomic_thread_fence(i32 %1)
ret void
}

LLVM IR (-O2):
@memory_order_release = global i32 0
define void @aeron_release() {
%1 = load i32, i32* @memory_order_release
%2 = tail call i32 @atomic_thread_fence(i32 %1)
ret void
}
void clearRandomFlips(int *randomFlips, int framebits) {
  int i;
  for (i = 0; i < framebits; i++) {
    randomFlips[i] = 0;
  }
}


x86 assembly (clang, -O0):
<clearRandomFlips>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <clearRandomFlips+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <clearRandomFlips+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearRandomFlips>:
test   %esi,%esi
jle    1126 <clearRandomFlips+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @clearRandomFlips(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x42() {
  Assert_real((isodigit(66) == 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_isodigit.c",
              335, ("isodigit should be 0 for B"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x42>:
push   %rax
mov    $0x42,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x14f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for B\00"
define void @t_isodigit_0x42() {
%1 = call i64 @isodigit(i32 66)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [27 x i8] c"isodigit should be 0 for B\00"
define void @t_isodigit_0x42() {
%1 = tail call i64 @isodigit(i32 66)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct can_frame {
  int *data;
};

/* Variables and functions */
void sdo_end_segment(struct can_frame *frame) { frame->data[0] |= 1; }


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

x86 assembly (clang, -O2):
<sdo_end_segment>:
mov    (%rdi),%rax
orl    $0x1,(%rax)
ret

LLVM IR (-O0):
%struct.can_frame = type { i32* }
define void @sdo_end_segment(%struct.can_frame* %0) {
%2 = alloca %struct.can_frame*
store %struct.can_frame* %0, %struct.can_frame** %2
%3 = load %struct.can_frame*, %struct.can_frame** %2
%4 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = or i32 %7, 1
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
%struct.can_frame = type { i32* }
define void @sdo_end_segment(%struct.can_frame* nocapture %0) {
%2 = getelementptr inbounds %struct.can_frame, %struct.can_frame* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = or i32 %4, 1
store i32 %5, i32* %3
ret void
}
int fib(int n) {
  if (n < 2) {
    return 1;
  }
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void emit_source_includes(FILE *fp, const char *package) {
  fprintf(fp,
          "#include <errno.h>\n"
          "#include <string.h>\n"
          "#include \"qmi_%1$s.h\"\n\n",
          package);
}


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

x86 assembly (clang, -O2):
<emit_source_includes>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"#include <errno.h>\0A#include <string.h>\0A#include \22qmi_%1$s.h\22\0A\0A\00"
define void @emit_source_includes(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"#include <errno.h>\0A#include <string.h>\0A#include \22qmi_%1$s.h\22\0A\0A\00"
define void @emit_source_includes(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_fgetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int __wrap_fgetpos(FILE *stream, fpos_t *pos) {
  return dll_fgetpos(stream, pos);
}


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

x86 assembly (clang, -O2):
<__wrap_fgetpos>:
jmp    1030 <dll_fgetpos@plt>

LLVM IR (-O0):
define i32 @__wrap_fgetpos(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 = call i32 @dll_fgetpos(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__wrap_fgetpos(i32* %0, i32* %1) {
%3 = tail call i32 @dll_fgetpos(i32* %0, i32* %1)
ret i32 %3
}
int lzst0_log240(int v) {
  int i, j;
  i = 0;
  j = v;
  while (j >= 240) {
    i++;
    j = j >> 8;
  }
  return (i);
}


x86 assembly (clang, -O0):
<lzst0_log240>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xf0,-0xc(%rbp)
jl     1138 <lzst0_log240+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <lzst0_log240+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzst0_log240>:
xor    %eax,%eax
cmp    $0xf0,%edi
jl     1120 <lzst0_log240+0x20>
xor    %eax,%eax
mov    %edi,%ecx
xchg   %ax,%ax
add    $0x1,%eax
shr    $0x8,%ecx
cmp    $0xefff,%edi
mov    %ecx,%edi
ja     1110 <lzst0_log240+0x10>
ret

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

LLVM IR (-O2):
define i32 @lzst0_log240(i32 %0) {
%2 = icmp sgt i32 %0, 239
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = lshr i32 %4, 8
%8 = icmp ugt i32 %4, 61439
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
double cubic(double x) { return x * x * x; }


x86 assembly (clang, -O0):
<cubic>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubic>:
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cubic(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @cubic(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int chdir(char const *);
int /*<<< orphan*/ err(int /*<<< orphan*/, char *, char const *);
void dochdir(const char *path, const char *errmsg) {
  if (chdir(path) == -1)
    err(EXIT_FAILURE, "%s", errmsg);
}


x86 assembly (clang, -O0):
<dochdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
jne    115b <dochdir+0x3b>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeaa(%rip),%rsi
call   1040 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dochdir>:
push   %rbx
mov    %rsi,%rbx
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
je     1130 <dochdir+0x10>
pop    %rbx
ret
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <err@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"%s\00"
define void @dochdir(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 @chdir(i8* %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @EXIT_FAILURE
%10 = load i8*, i8** %4
%11 = call i32 @err(i32 %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"%s\00"
define void @dochdir(i8* %0, i8* %1) {
%3 = tail call i32 @chdir(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @err(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ x54x_outw(int, int /*<<< orphan*/, void *);
void x54x_writew(uint32_t port, uint16_t val, void *priv) {
  x54x_outw(port & 3, val, priv);
}


x86 assembly (clang, -O0):
<x54x_writew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0x3,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <x54x_outw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x54x_writew>:
and    $0x3,%edi
jmp    1030 <x54x_outw@plt>

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

LLVM IR (-O2):
define void @x54x_writew(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %0, 3
%5 = tail call i32 @x54x_outw(i32 %4, i32 %1, i8* %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
int get_wordsize(uint8_t ei_class) {
  switch (ei_class) {
  case 1:
    return 32;
  case 2:
    return 64;
  default:
    errx(1, "Unknown machine word size.");
  }
}


x86 assembly (clang, -O0):
<get_wordsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1140 <get_wordsize+0x30>
jmp    112f <get_wordsize+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     114c <get_wordsize+0x3c>
jmp    1158 <get_wordsize+0x48>
movl   $0x20,-0x4(%rbp)
jmp    1169 <get_wordsize+0x59>
movl   $0x40,-0x4(%rbp)
jmp    1169 <get_wordsize+0x59>
mov    $0x1,%edi
lea    0xe9c(%rip),%rsi
call   1030 <errx@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wordsize>:
cmp    $0x1,%edi
je     1120 <get_wordsize+0x10>
cmp    $0x2,%edi
jne    1126 <get_wordsize+0x16>
mov    $0x40,%eax
ret
mov    $0x20,%eax
ret
push   %rax
lea    0xed2(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Unknown machine word size.\00"
define i32 @get_wordsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i32 32, i32* %2
br label %9
6: ; preds = %1
store i32 64, i32* %2
br label %9
7: ; preds = %1
%8 = call i32 @errx(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %5, %6, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [27 x i8] c"Unknown machine word size.\00"
define i32 @get_wordsize(i32 %0) {
switch i32 %0, label %3 [
i32 1, label %5
i32 2, label %2
]
2: ; preds = %1
br label %5
3: ; preds = %1
%4 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %2, %3
%6 = phi i32 [ undef, %3 ], [ 64, %2 ], [ 32, %1 ]
ret i32 %6
}
float metric_square(float left, float right) {
  return left * left - right * right;
}


x86 assembly (clang, -O0):
<metric_square>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<metric_square>:
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @metric_square(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %3
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fneg float %9
%11 = call float @llvm.fmuladd.f32(float %5, float %6, float %10)
ret float %11
}

LLVM IR (-O2):
define float @metric_square(float %0, float %1) {
%3 = fneg float %1
%4 = fmul float %3, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %4)
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ UINT64_C(int);
scalar_t__ rgph_t1ha64s_mux(int /*<<< orphan*/, int /*<<< orphan*/);
void rgph_t1ha64s_fmix2(uint64_t k, uint64_t h[]) {
  h[1] += rgph_t1ha64s_mux(k, UINT64_C(0xd4f06db99d67be4b));
}


x86 assembly (clang, -O0):
<rgph_t1ha64s_fmix2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x9d67be4b,%edi
call   1030 <UINT64_C@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1040 <rgph_t1ha64s_mux@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq 0x4(%rax),%rcx
add    %rdx,%rcx
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_t1ha64s_fmix2>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x9d67be4b,%edi
call   1030 <UINT64_C@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <rgph_t1ha64s_mux@plt>
add    %eax,0x4(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @rgph_t1ha64s_fmix2(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 = call i32 @UINT64_C(i32 -1654145461)
%7 = call i64 @rgph_t1ha64s_mux(i32 %5, i32 %6)
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = add nsw i64 %11, %7
%13 = trunc i64 %12 to i32
store i32 %13, i32* %9
ret void
}

LLVM IR (-O2):
define void @rgph_t1ha64s_fmix2(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @UINT64_C(i32 -1654145461)
%4 = tail call i64 @rgph_t1ha64s_mux(i32 %0, i32 %3)
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = trunc i64 %4 to i32
%8 = add i32 %6, %7
store i32 %8, i32* %5
ret void
}
void gtk_text_view_get_iter_location() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_iter_location() {
ret void
}
void foo1(int (*o)(int p[*])) {}


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

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

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

LLVM IR (-O2):
define void @foo1(i32 (i32*)* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_bi_epel_h48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h48_10_sse4() {
ret void
}
/* Variables and functions */
scalar_t__ shim_enosys(int /*<<< orphan*/, int, int, int);
int shim_ioprio_set(int which, int who, int ioprio) {
  return (int)shim_enosys(0, which, who, ioprio);
}


x86 assembly (clang, -O0):
<shim_ioprio_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
call   1030 <shim_enosys@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shim_ioprio_set>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <shim_enosys@plt>

LLVM IR (-O0):
define i32 @shim_ioprio_set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @shim_enosys(i32 0, i32 %7, i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @shim_ioprio_set(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @shim_enosys(i32 0, i32 %0, i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
long os_atomic_set_long(volatile long *ptr, long val) {
  return __atomic_exchange_n(ptr, val, 5);
}


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

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

LLVM IR (-O0):
define i64 @os_atomic_set_long(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%7 = load i64*, i64** %3
%8 = load i64, i64* %4
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = atomicrmw volatile xchg i64* %7, i64 %9 seq_cst
store i64 %10, i64* %6
%11 = load i64, i64* %6
ret i64 %11
}

LLVM IR (-O2):
define i64 @os_atomic_set_long(i64* %0, i64 %1) {
%3 = atomicrmw volatile xchg i64* %0, i64 %1 seq_cst
ret i64 %3
}
int main(void) {
  printf("%d\n", printf("%d", printf("%d", printf("%s", "husky"))));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xeec(%rip),%rdi
lea    0xee8(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,%esi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeef(%rip),%rdi
lea    0xeeb(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"husky\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [6 x i8] c"husky\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}