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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void join_thread(pthread_t thread) {
  int ret = pthread_join(thread, NULL);
  if (ret == -1) {
    perror("pthread_join failed");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<join_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_join@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    116a <join_thread+0x3a>
lea    0xea5(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<join_thread>:
push   %rax
xor    %esi,%esi
call   1050 <pthread_join@plt>
cmp    $0xffffffff,%eax
je     113f <join_thread+0xf>
pop    %rax
ret
lea    0xeba(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"pthread_join failed\00"
define void @join_thread(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @pthread_join(i32 %4, i32* null)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"pthread_join failed\00"
define void @join_thread(i32 %0) {
%2 = tail call i32 @pthread_join(i32 %0, i32* null)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret void
}
int foo12() { return 12; }


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

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

LLVM IR (-O0):
define i32 @foo12() {
ret i32 12
}

LLVM IR (-O2):
define i32 @foo12() {
ret i32 12
}
void nseel_asm_assign_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_assign_end() {
ret void
}
/* Variables and functions */
int add(int, int);
int main(void) {
  int i;
  i = add(20, 22);
  return i;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x14,%edi
mov    $0x16,%esi
jmp    1030 <add@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @add(i32 20, i32 22)
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 20, i32 22)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t SysCtlNMIStatus(void) {
  return ((*((volatile uint32_t *)(0x400FE064))));
}


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

x86 assembly (clang, -O2):
<SysCtlNMIStatus>:
mov    0x400fe064,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlNMIStatus() {
%1 = load volatile i32, i32* inttoptr (i64 1074782308 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @SysCtlNMIStatus() {
%1 = load volatile i32, i32* inttoptr (i64 1074782308 to i32*)
ret i32 %1
}
int drain_fds(int fd1, int fd2, long timeout) { return -1; }


x86 assembly (clang, -O0):
<drain_fds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @drain_fds(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @drain_fds(i32 %0, i32 %1, i64 %2) {
ret i32 -1
}
struct max_heap *heap_merge(struct max_heap *h1, struct max_heap *h2) {}


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

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

LLVM IR (-O0):
%struct.max_heap = type opaque
define %struct.max_heap* @heap_merge(%struct.max_heap* %0, %struct.max_heap* %1) {
%3 = alloca %struct.max_heap*
%4 = alloca %struct.max_heap*
%5 = alloca %struct.max_heap*
store %struct.max_heap* %0, %struct.max_heap** %4
store %struct.max_heap* %1, %struct.max_heap** %5
%6 = load %struct.max_heap*, %struct.max_heap** %3
ret %struct.max_heap* %6
}

LLVM IR (-O2):
%struct.max_heap = type opaque
define noalias %struct.max_heap* @heap_merge(%struct.max_heap* nocapture readnone %0, %struct.max_heap* nocapture readnone %1) {
ret %struct.max_heap* undef
}
int __is_smt_capable(int threads_per_cpu) { return threads_per_cpu > 1; }


x86 assembly (clang, -O0):
<__is_smt_capable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__is_smt_capable>:
xor    %eax,%eax
cmp    $0x2,%edi
setge  %al
ret

LLVM IR (-O0):
define i32 @__is_smt_capable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @__is_smt_capable(i32 %0) {
%2 = icmp sgt i32 %0, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_jam_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("jam", " #comment"),
                            "comment", "#comment");
}


x86 assembly (clang, -O0):
<test_jam_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec6(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_jam_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"jam\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_jam_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"jam\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_jam_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_sec;
  int /*<<< orphan*/ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ round(double);
scalar_t__ trunc(double);
void dtime2mtimespec(double dtime, struct timespec *mtime) {
  ((mtime)->tv_sec) = trunc(dtime);
  ((mtime)->tv_nsec) =
      round((double)1000000000L * (dtime - (double)((mtime)->tv_sec)));
}


x86 assembly (clang, -O0):
<dtime2mtimespec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <trunc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
subsd  %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <round@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtime2mtimespec>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <trunc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    %rax,(%rbx)
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xeb0(%rip),%xmm1
movapd %xmm1,%xmm0
call   1040 <round@plt>
mov    %eax,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
define void @dtime2mtimespec(double %0, %struct.timespec* %1) {
%3 = alloca double
%4 = alloca %struct.timespec*
store double %0, double* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load double, double* %3
%6 = call i64 @trunc(double %5)
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
store i64 %6, i64* %8
%9 = load double, double* %3
%10 = load %struct.timespec*, %struct.timespec** %4
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fsub double %9, %13
%15 = fmul double 1.000000e+09, %14
%16 = call i32 @round(double %15)
%17 = load %struct.timespec*, %struct.timespec** %4
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 1
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
define void @dtime2mtimespec(double %0, %struct.timespec* nocapture writeonly %1) {
%3 = tail call i64 @trunc(double %0)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
store i64 %3, i64* %4
%5 = sitofp i64 %3 to double
%6 = fsub double %0, %5
%7 = fmul double %6, 1.000000e+09
%8 = tail call i32 @round(double %7)
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ run_echo_server(char *);
void *spawn_server(void *arg) {
  (void)arg;
  run_echo_server("8880");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"8880\00"
define i8* @spawn_server(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @run_echo_server(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [5 x i8] c"8880\00"
define noalias i8* @spawn_server(i8* nocapture readnone %0) {
%2 = tail call i32 @run_echo_server(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
char *malloc(int);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *timetostr(time_t t) {
  char *buffer;
  buffer = malloc(sizeof(char) * 20);
  struct tm *tm_info;
  tm_info = localtime(&t);
  strftime(buffer, 19, "%Y-%m-%d %H:%M:%S", tm_info);
  return buffer;
}


x86 assembly (clang, -O0):
<timetostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x13,%esi
lea    0xe96(%rip),%rdx
call   1050 <strftime@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timetostr>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0xc(%rsp)
mov    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xea9(%rip),%rdx
mov    %rbx,%rdi
mov    $0x13,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @timetostr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.tm*
store i32 %0, i32* %2
%5 = call i8* @malloc(i32 20)
store i8* %5, i8** %3
%6 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %6, %struct.tm** %4
%7 = load i8*, i8** %3
%8 = load %struct.tm*, %struct.tm** %4
%9 = call i32 @strftime(i8* %7, i32 19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i8* @timetostr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call dereferenceable_or_null(20) i8* @malloc(i32 20)
%4 = call %struct.tm* @localtime(i32* %2)
%5 = call i32 @strftime(i8* %3, i32 19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ putcurrent();
int thread_wait(void) {
  putcurrent();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @thread_wait() {
%1 = call i32 (...) @putcurrent()
ret i32 0
}

LLVM IR (-O2):
define i32 @thread_wait() {
%1 = tail call i32 (...) @putcurrent()
ret i32 0
}
long long llrint(double x) {
  long long r;
  __asm__("fistpll %0" : "=m"(r) : "t"(x) : "st");
  return r;
}


x86 assembly (clang, -O0):
<llrint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fistpll -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrint>:
movsd  %xmm0,-0x10(%rsp)
fldl   -0x10(%rsp)
fistpll -0x8(%rsp)
mov    -0x8(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i64, i64* %2
ret i64 %4
}
/* Type definitions */
struct macioDevice {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int compareDevice(struct device *, struct device *);
int macioCompareDevice(struct macioDevice *dev1, struct macioDevice *dev2) {
  return compareDevice((struct device *)dev1, (struct device *)dev2);
}


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

x86 assembly (clang, -O2):
<macioCompareDevice>:
jmp    1030 <compareDevice@plt>

LLVM IR (-O0):
%struct.macioDevice = type { i32 }
%struct.device = type { i32 }
define i32 @macioCompareDevice(%struct.macioDevice* %0, %struct.macioDevice* %1) {
%3 = alloca %struct.macioDevice*
%4 = alloca %struct.macioDevice*
store %struct.macioDevice* %0, %struct.macioDevice** %3
store %struct.macioDevice* %1, %struct.macioDevice** %4
%5 = load %struct.macioDevice*, %struct.macioDevice** %3
%6 = bitcast %struct.macioDevice* %5 to %struct.device*
%7 = load %struct.macioDevice*, %struct.macioDevice** %4
%8 = bitcast %struct.macioDevice* %7 to %struct.device*
%9 = call i32 @compareDevice(%struct.device* %6, %struct.device* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.macioDevice = type { i32 }
%struct.device = type { i32 }
define i32 @macioCompareDevice(%struct.macioDevice* %0, %struct.macioDevice* %1) {
%3 = bitcast %struct.macioDevice* %0 to %struct.device*
%4 = bitcast %struct.macioDevice* %1 to %struct.device*
%5 = tail call i32 @compareDevice(%struct.device* %3, %struct.device* %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int transfer(uint8_t data, uint8_t *recv, int ext) { return 0; }


x86 assembly (clang, -O0):
<transfer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @transfer(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @transfer(i32 %0, i32* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  a(0, 0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1030 <a@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <a@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @a(i32 0, i32 0)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a(i32 0, i32 0)
%2 = tail call i32 @exit(i32 0)
unreachable
}
const char *loader_TAPE_get_type(void) { return "TAPE"; }


x86 assembly (clang, -O0):
<loader_TAPE_get_type>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loader_TAPE_get_type>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TAPE\00"
define i8* @loader_TAPE_get_type() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"TAPE\00"
define i8* @loader_TAPE_get_type() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
void class_device_initialize(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<class_device_initialize>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_device_initialize>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.class_device_initialize = [24 x i8] c"class_device_initialize\00"
define void @class_device_initialize() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.class_device_initialize, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.class_device_initialize = [24 x i8] c"class_device_initialize\00"
define void @class_device_initialize() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.class_device_initialize, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bits_per_uint32(uint32_t value) { return (value >> 5); }


x86 assembly (clang, -O0):
<bits_per_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_per_uint32>:
mov    %edi,%eax
sar    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @bits_per_uint32(i32 %0) {
%2 = ashr i32 %0, 5
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double sin(double);
int main(void) {
  double a;
  a = 1;
  double b;
  b = sin(a);
  printf("%f\n", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.000000e+00, double* %2
%4 = load double, double* %2
%5 = call double @sin(double %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x3FEAED548F090CEE)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void die(const char *s) {
  perror(s);
  exit(127);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <perror@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
define void @die(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 127)
unreachable
}
/* Variables and functions */
double sin(double const);
double sin_activate(const double x) { return sin(x); }


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

x86 assembly (clang, -O2):
<sin_activate>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @sin_activate(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Type definitions */
struct sha256_ctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha256_conclude_ctx(struct sha256_ctx *);
void *sha256_read_ctx(struct sha256_ctx *, void *);
void *sha256_finish_ctx(struct sha256_ctx *ctx, void *resbuf) {
  sha256_conclude_ctx(ctx);
  return sha256_read_ctx(ctx, resbuf);
}


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

x86 assembly (clang, -O2):
<sha256_finish_ctx>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <sha256_conclude_ctx@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <sha256_read_ctx@plt>

LLVM IR (-O0):
%struct.sha256_ctx = type { i32 }
define i8* @sha256_finish_ctx(%struct.sha256_ctx* %0, i8* %1) {
%3 = alloca %struct.sha256_ctx*
%4 = alloca i8*
store %struct.sha256_ctx* %0, %struct.sha256_ctx** %3
store i8* %1, i8** %4
%5 = load %struct.sha256_ctx*, %struct.sha256_ctx** %3
%6 = call i32 @sha256_conclude_ctx(%struct.sha256_ctx* %5)
%7 = load %struct.sha256_ctx*, %struct.sha256_ctx** %3
%8 = load i8*, i8** %4
%9 = call i8* @sha256_read_ctx(%struct.sha256_ctx* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.sha256_ctx = type { i32 }
define i8* @sha256_finish_ctx(%struct.sha256_ctx* %0, i8* %1) {
%3 = tail call i32 @sha256_conclude_ctx(%struct.sha256_ctx* %0)
%4 = tail call i8* @sha256_read_ctx(%struct.sha256_ctx* %0, i8* %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void shl_pty_bridge_free(int bridge) {
  if (bridge < 0)
    return;
  close(bridge);
}


x86 assembly (clang, -O0):
<shl_pty_bridge_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112a <shl_pty_bridge_free+0x1a>
jmp    1132 <shl_pty_bridge_free+0x22>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_pty_bridge_free>:
test   %edi,%edi
js     1119 <shl_pty_bridge_free+0x9>
jmp    1030 <close@plt>
ret

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

LLVM IR (-O2):
define void @shl_pty_bridge_free(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *);
char *getsectorscmd(const char *path, char *cmdresult) {
  sprintf(cmdresult,
          "fdisk -l | grep %s |grep 'Disk'| awk '{print$7}' 1>/dev/null "
          "2>/dev/null",
          path);
  return cmdresult;
}


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

x86 assembly (clang, -O2):
<getsectorscmd>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rdx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [73 x i8] c"fdisk -l | grep %s |grep 'Disk'| awk '{print$7}' 1>/dev/null 2>/dev/null\00"
define i8* @getsectorscmd(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
@.str = [73 x i8] c"fdisk -l | grep %s |grep 'Disk'| awk '{print$7}' 1>/dev/null 2>/dev/null\00"
define i8* @getsectorscmd(i8* %0, i8* returned writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %1
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
void CarryOver(int *valTo, int *valFrom, uint wrapPoint) {
  if (*valFrom > (int)wrapPoint) {
    *valTo = *valFrom - wrapPoint;
    *valFrom = -1;
  }
}


x86 assembly (clang, -O0):
<CarryOver>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jle    1137 <CarryOver+0x37>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xffffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CarryOver>:
mov    (%rsi),%eax
sub    %edx,%eax
jle    110e <CarryOver+0xe>
mov    %eax,(%rdi)
movl   $0xffffffff,(%rsi)
ret

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

LLVM IR (-O2):
define void @CarryOver(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, %2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = sub nsw i32 %4, %2
store i32 %7, i32* %0
store i32 -1, i32* %1
br label %8
8: ; preds = %6, %3
ret void
}
int f_bgt_rr1(float a1, float a2) { return (__builtin_isgreater(a1, a2)); }


x86 assembly (clang, -O0):
<f_bgt_rr1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_bgt_rr1>:
xor    %eax,%eax
ucomiss %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @f_bgt_rr1(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* %4
%7 = fcmp ogt float %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @f_bgt_rr1(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int yes_no() {
  char yes_no[4];
  fgets(yes_no, 4, stdin);
  switch (yes_no[0]) {
  case 'y':
  case 'Y':
    return 1;
  case 'n':
  case 'N':
    return 0;
  }
}


x86 assembly (clang, -O0):
<yes_no>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rdi
mov    $0x4,%esi
call   1030 <fgets@plt>
movsbl -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4e,%eax
je     1183 <yes_no+0x73>
jmp    1144 <yes_no+0x34>
mov    -0xc(%rbp),%eax
sub    $0x59,%eax
je     1177 <yes_no+0x67>
jmp    1155 <yes_no+0x45>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     1183 <yes_no+0x73>
jmp    1166 <yes_no+0x56>
mov    -0xc(%rbp),%eax
sub    $0x79,%eax
jne    118a <yes_no+0x7a>
jmp    1177 <yes_no+0x67>
movl   $0x1,-0x4(%rbp)
jmp    118a <yes_no+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yes_no>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <fgets@plt>
mov    0x4(%rsp),%cl
and    $0xdf,%cl
xor    %eax,%eax
cmp    $0x4e,%cl
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @yes_no() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 4, i32 %4)
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
switch i32 %8, label %11 [
i32 121, label %9
i32 89, label %9
i32 110, label %10
i32 78, label %10
]
9: ; preds = %0, %0
store i32 1, i32* %1
br label %11
10: ; preds = %0, %0
store i32 0, i32* %1
br label %11
11: ; preds = %9, %10, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @yes_no() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 4, i32 %3)
%5 = load i8, i8* %2
%6 = and i8 %5, -33
%7 = icmp ne i8 %6, 78
%8 = zext i1 %7 to i32
ret i32 %8
}
int div16(int num) {
  int bias = (num >> 31) & 0xF;
  return (num + bias) >> 4;
}


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

x86 assembly (clang, -O2):
<div16>:
mov    %edi,%eax
sar    $0x1f,%eax
and    $0xf,%eax
add    %edi,%eax
sar    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @div16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
%6 = and i32 %5, 15
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = ashr i32 %9, 4
ret i32 %10
}

LLVM IR (-O2):
define i32 @div16(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i32 15, i32 0
%4 = add nsw i32 %3, %0
%5 = ashr i32 %4, 4
ret i32 %5
}
/* Type definitions */
typedef unsigned long long off_t;

/* Variables and functions */
int /*<<< orphan*/ BLKGETSIZE64;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/, unsigned long long *);
int open(char const *, int /*<<< orphan*/);
off_t diskfile_device_size(const char *path) {
  unsigned long long size;
  int fd = open(path, O_RDONLY);
  ioctl(fd, BLKGETSIZE64, &size);
  close(fd);
  return size;
}


x86 assembly (clang, -O0):
<diskfile_device_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diskfile_device_size>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1050 <open@plt>
mov    %eax,%ebx
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
mov    %ebx,%edi
call   1030 <ioctl@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@BLKGETSIZE64 = global i32 0
define i64 @diskfile_device_size(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = load i32, i32* @O_RDONLY
%7 = call i32 @open(i8* %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* @BLKGETSIZE64
%10 = call i32 @ioctl(i32 %8, i32 %9, i64* %3)
%11 = load i32, i32* %4
%12 = call i32 @close(i32 %11)
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@BLKGETSIZE64 = global i32 0
define i64 @diskfile_device_size(i8* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i32, i32* @O_RDONLY
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = load i32, i32* @BLKGETSIZE64
%7 = call i32 @ioctl(i32 %5, i32 %6, i64* %2)
%8 = call i32 @close(i32 %5)
%9 = load i64, i64* %2
ret i64 %9
}
int str2expmode(s)
char const *s;
{ return strn2expmode(s, strlen(s)); }


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

x86 assembly (clang, -O2):
<str2expmode>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1040 <strn2expmode@plt>

LLVM IR (-O0):
define i32 @str2expmode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = call i32 (i8*, i64, ...) bitcast (i32 (...)* @strn2expmode to i32 (i8*, i64, ...)*)(i8* %3, i64 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @str2expmode(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i32 (i8*, i64, ...) bitcast (i32 (...)* @strn2expmode to i32 (i8*, i64, ...)*)(i8* %0, i64 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int inputValue(int value) {
  printf("Please enter a value that is non-negative: ");
  scanf("%d", &value);
  return value;
}


x86 assembly (clang, -O0):
<inputValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputValue>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Please enter a value that is non-negative: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [44 x i8] c"Please enter a value that is non-negative: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @inputValue(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int check_longdoubleComplex() { return sizeof(long double _Complex); }


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

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

LLVM IR (-O0):
define i32 @check_longdoubleComplex() {
ret i32 32
}

LLVM IR (-O2):
define i32 @check_longdoubleComplex() {
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ arch_local_irq_disable();
unsigned long arch_local_save_flags();
unsigned long arch_local_irq_save(void) {
  unsigned long flags;
  flags = arch_local_save_flags();
  arch_local_irq_disable();
  return flags;
}


x86 assembly (clang, -O0):
<arch_local_irq_save>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <arch_local_save_flags@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <arch_local_irq_disable@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_local_irq_save>:
push   %rbx
xor    %eax,%eax
call   1040 <arch_local_save_flags@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <arch_local_irq_disable@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @arch_local_irq_save() {
%1 = alloca i64
%2 = call i64 (...) @arch_local_save_flags()
store i64 %2, i64* %1
%3 = call i32 (...) @arch_local_irq_disable()
%4 = load i64, i64* %1
ret i64 %4
}

LLVM IR (-O2):
define i64 @arch_local_irq_save() {
%1 = tail call i64 (...) @arch_local_save_flags()
%2 = tail call i32 (...) @arch_local_irq_disable()
ret i64 %1
}
double ari(int letters, int words, int sentences) {
  return 4.71 * (((double)letters) / words) +
         0.5 * (((double)words) / sentences) - 21.43;
}


x86 assembly (clang, -O0):
<ari>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x8(%rbp),%xmm2
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm2
movsd  0xedf(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ari>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
cvtsi2sd %edx,%xmm2
divsd  %xmm2,%xmm1
mulsd  0xee4(%rip),%xmm1
mulsd  0xee4(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xee0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @ari(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 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to double
%16 = fdiv double %13, %15
%17 = fmul double 5.000000e-01, %16
%18 = call double @llvm.fmuladd.f64(double 4.710000e+00, double %11, double %17)
%19 = fsub double %18, 2.143000e+01
ret double %19
}

LLVM IR (-O2):
define double @ari(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fdiv double %4, %5
%7 = sitofp i32 %2 to double
%8 = fdiv double %5, %7
%9 = fmul double %8, 5.000000e-01
%10 = tail call double @llvm.fmuladd.f64(double %6, double 4.710000e+00, double %9)
%11 = fadd double %10, -2.143000e+01
ret double %11
}
void close_shm_log(void) {}


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

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

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

LLVM IR (-O2):
define void @close_shm_log() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
char *strdup(char *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
char *timetoa(time_t stamp) {
  char buffer[BUFSIZ];
  strftime(buffer, BUFSIZ, "%Y-%m-%dT%H:%M:%S", localtime(&stamp));
  return strdup(buffer);
}


x86 assembly (clang, -O0):
<timetoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdi
mov    %eax,%ecx
lea    0xe74(%rip),%rdx
call   1040 <strftime@plt>
mov    -0x20(%rbp),%rdi
call   1050 <strdup@plt>
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timetoa>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edi,-0x14(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%r14d
mov    %rsp,%rbx
mov    %r14,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
lea    0xe94(%rip),%rdx
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %eax,%ecx
call   1040 <strftime@plt>
mov    %rbx,%rdi
call   1050 <strdup@plt>
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@.str = [18 x i8] c"%Y-%m-%dT%H:%M:%S\00"
define i8* @timetoa(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* @BUFSIZ
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i32, i32* @BUFSIZ
%10 = call i32 @localtime(i32* %2)
%11 = call i32 @strftime(i8* %8, i32 %9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i8* @strdup(i8* %8)
%13 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@.str = [18 x i8] c"%Y-%m-%dT%H:%M:%S\00"
define noalias i8* @timetoa(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @BUFSIZ
%4 = zext i32 %3 to i64
%5 = alloca i8, i64 %4
%6 = call i32 @localtime(i32* %2)
%7 = call i32 @strftime(i8* %5, i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i8* @strdup(i8* %5)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void baz(void) { printf("weak_as_needed_c: baz\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"weak_as_needed_c: baz\00"
define void @baz() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_BDuint8_reg(unsigned char val) {
  return ((val) & (-0xBD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BDuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff43,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BDuint8_reg>:
test   $0x43,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BDuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -189
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_BDuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 67
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ local_laplacian_internal(float const *const, float *const,
                                            int const, int const, float const,
                                            float const, float const,
                                            float const, int);
void local_laplacian_sse2(const float *const input, float *const out,
                          const int wd, const int ht, const float sigma,
                          const float shadows, const float highlights,
                          const float clarity) {
  local_laplacian_internal(input, out, wd, ht, sigma, shadows, highlights,
                           clarity, 1);
}


x86 assembly (clang, -O0):
<local_laplacian_sse2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
movss  %xmm2,-0x24(%rbp)
movss  %xmm3,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
movss  -0x1c(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
movss  -0x28(%rbp),%xmm3
mov    $0x1,%r8d
call   1030 <local_laplacian_internal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<local_laplacian_sse2>:
mov    $0x1,%r8d
jmp    1030 <local_laplacian_internal@plt>

LLVM IR (-O0):
define void @local_laplacian_sse2(float* %0, float* %1, i32 %2, i32 %3, float %4, float %5, float %6, float %7) {
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
store float* %0, float** %9
store float* %1, float** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store float %4, float* %13
store float %5, float* %14
store float %6, float* %15
store float %7, float* %16
%17 = load float*, float** %9
%18 = load float*, float** %10
%19 = load i32, i32* %11
%20 = load i32, i32* %12
%21 = load float, float* %13
%22 = load float, float* %14
%23 = load float, float* %15
%24 = load float, float* %16
%25 = call i32 @local_laplacian_internal(float* %17, float* %18, i32 %19, i32 %20, float %21, float %22, float %23, float %24, i32 1)
ret void
}

LLVM IR (-O2):
define void @local_laplacian_sse2(float* %0, float* %1, i32 %2, i32 %3, float %4, float %5, float %6, float %7) {
%9 = tail call i32 @local_laplacian_internal(float* %0, float* %1, i32 %2, i32 %3, float %4, float %5, float %6, float %7, i32 1)
ret void
}