xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *osdialog_strndup(const char *s, size_t n) {
  char *d = malloc(n + 1);
  memcpy(d, s, n);
  d[n] = '\0';
  return d;
}


x86 assembly (clang, -O0):
<osdialog_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osdialog_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @osdialog_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @osdialog_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %1)
%6 = getelementptr inbounds i8, i8* %4, i64 %1
store i8 0, i8* %6
ret i8* %4
}
/* Variables and functions */
int getSize(int, int, char);
int getsizeEnemy(int level, char y, int whichEnemy) {
  if ((whichEnemy < 0) || (whichEnemy > 3)) {
    return 0;
  }
  return getSize(level, (3 + whichEnemy), y);
}


x86 assembly (clang, -O0):
<getsizeEnemy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1138 <getsizeEnemy+0x28>
cmpl   $0x3,-0x10(%rbp)
jle    1144 <getsizeEnemy+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1159 <getsizeEnemy+0x49>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
add    $0x3,%esi
movsbl -0x9(%rbp),%edx
call   1030 <getSize@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsizeEnemy>:
cmp    $0x3,%edx
jbe    1118 <getsizeEnemy+0x8>
xor    %eax,%eax
ret
add    $0x3,%edx
movsbl %sil,%eax
mov    %edx,%esi
mov    %eax,%edx
jmp    1030 <getSize@plt>

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

LLVM IR (-O2):
define i32 @getsizeEnemy(i32 %0, i8 signext %1, i32 %2) {
%4 = icmp ugt i32 %2, 3
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = add nuw nsw i32 %2, 3
%7 = tail call i32 @getSize(i32 %0, i32 %6, i8 signext %1)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ DebugCleanup();
int /*<<< orphan*/ HeapCleanup();
int /*<<< orphan*/ IncludeCleanup();
int /*<<< orphan*/ LexCleanup();
int /*<<< orphan*/ ParseCleanup();
int /*<<< orphan*/ PlatformCleanup();
int /*<<< orphan*/ TableStrFree();
int /*<<< orphan*/ TypeCleanup();
int /*<<< orphan*/ VariableCleanup();
void PicocCleanup() {
  DebugCleanup();
  IncludeCleanup();
  ParseCleanup();
  LexCleanup();
  VariableCleanup();
  TypeCleanup();
  TableStrFree();
  HeapCleanup();
  PlatformCleanup();
}


x86 assembly (clang, -O0):
<PicocCleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <DebugCleanup@plt>
mov    $0x0,%al
call   1090 <IncludeCleanup@plt>
mov    $0x0,%al
call   1070 <ParseCleanup@plt>
mov    $0x0,%al
call   1040 <LexCleanup@plt>
mov    $0x0,%al
call   1060 <VariableCleanup@plt>
mov    $0x0,%al
call   10b0 <TypeCleanup@plt>
mov    $0x0,%al
call   10a0 <TableStrFree@plt>
mov    $0x0,%al
call   1030 <HeapCleanup@plt>
mov    $0x0,%al
call   1050 <PlatformCleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PicocCleanup>:
push   %rax
xor    %eax,%eax
call   1080 <DebugCleanup@plt>
xor    %eax,%eax
call   1090 <IncludeCleanup@plt>
xor    %eax,%eax
call   1070 <ParseCleanup@plt>
xor    %eax,%eax
call   1040 <LexCleanup@plt>
xor    %eax,%eax
call   1060 <VariableCleanup@plt>
xor    %eax,%eax
call   10b0 <TypeCleanup@plt>
xor    %eax,%eax
call   10a0 <TableStrFree@plt>
xor    %eax,%eax
call   1030 <HeapCleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <PlatformCleanup@plt>

LLVM IR (-O0):
define void @PicocCleanup() {
%1 = call i32 (...) @DebugCleanup()
%2 = call i32 (...) @IncludeCleanup()
%3 = call i32 (...) @ParseCleanup()
%4 = call i32 (...) @LexCleanup()
%5 = call i32 (...) @VariableCleanup()
%6 = call i32 (...) @TypeCleanup()
%7 = call i32 (...) @TableStrFree()
%8 = call i32 (...) @HeapCleanup()
%9 = call i32 (...) @PlatformCleanup()
ret void
}

LLVM IR (-O2):
define void @PicocCleanup() {
%1 = tail call i32 (...) @DebugCleanup()
%2 = tail call i32 (...) @IncludeCleanup()
%3 = tail call i32 (...) @ParseCleanup()
%4 = tail call i32 (...) @LexCleanup()
%5 = tail call i32 (...) @VariableCleanup()
%6 = tail call i32 (...) @TypeCleanup()
%7 = tail call i32 (...) @TableStrFree()
%8 = tail call i32 (...) @HeapCleanup()
%9 = tail call i32 (...) @PlatformCleanup()
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int cmp_str(const void *e1, const void *e2) {
  char **s1, **s2;
  s1 = (char **)e1;
  s2 = (char **)e2;
  return strcmp(*s1, *s2);
}


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

x86 assembly (clang, -O2):
<cmp_str>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @cmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
void flush_vsx_to_thread(struct task_struct *t) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @flush_vsx_to_thread(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mf_devicemgr_create();
int /*<<< orphan*/ mf_topomgr_create();
int /*<<< orphan*/ msg_handlers_init();
int /*<<< orphan*/ parse_thread_start(int);
int /*<<< orphan*/ start_stopwatch_thread();
int /*<<< orphan*/ wr_init();
void mf_controller_init() {
  parse_thread_start(2);
  start_stopwatch_thread();
  mf_devicemgr_create();
  mf_topomgr_create();
  msg_handlers_init();
  wr_init();
}


x86 assembly (clang, -O0):
<mf_controller_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1070 <parse_thread_start@plt>
mov    $0x0,%al
call   1050 <start_stopwatch_thread@plt>
mov    $0x0,%al
call   1040 <mf_devicemgr_create@plt>
mov    $0x0,%al
call   1080 <mf_topomgr_create@plt>
mov    $0x0,%al
call   1030 <msg_handlers_init@plt>
mov    $0x0,%al
call   1060 <wr_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mf_controller_init>:
push   %rax
mov    $0x2,%edi
call   1070 <parse_thread_start@plt>
xor    %eax,%eax
call   1050 <start_stopwatch_thread@plt>
xor    %eax,%eax
call   1040 <mf_devicemgr_create@plt>
xor    %eax,%eax
call   1080 <mf_topomgr_create@plt>
xor    %eax,%eax
call   1030 <msg_handlers_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <wr_init@plt>

LLVM IR (-O0):
define void @mf_controller_init() {
%1 = call i32 @parse_thread_start(i32 2)
%2 = call i32 (...) @start_stopwatch_thread()
%3 = call i32 (...) @mf_devicemgr_create()
%4 = call i32 (...) @mf_topomgr_create()
%5 = call i32 (...) @msg_handlers_init()
%6 = call i32 (...) @wr_init()
ret void
}

LLVM IR (-O2):
define void @mf_controller_init() {
%1 = tail call i32 @parse_thread_start(i32 2)
%2 = tail call i32 (...) @start_stopwatch_thread()
%3 = tail call i32 (...) @mf_devicemgr_create()
%4 = tail call i32 (...) @mf_topomgr_create()
%5 = tail call i32 (...) @msg_handlers_init()
%6 = tail call i32 (...) @wr_init()
ret void
}
int stub_math_is_nan(double value) { return value != value; }


x86 assembly (clang, -O0):
<stub_math_is_nan>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_math_is_nan>:
xor    %eax,%eax
ucomisd %xmm0,%xmm0
setp   %al
ret

LLVM IR (-O0):
define i32 @stub_math_is_nan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fcmp une double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @stub_math_is_nan(double %0) {
%2 = fcmp uno double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
float pow(int, double);
float db_inv(float db) { return pow(10, 0.1 * db); }


x86 assembly (clang, -O0):
<db_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_inv>:
cvtss2sd %xmm0,%xmm0
mulsd  0xee4(%rip),%xmm0
mov    $0xa,%edi
jmp    1030 <pow@plt>

LLVM IR (-O0):
define float @db_inv(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double 1.000000e-01, %4
%6 = call float @pow(i32 10, double %5)
ret float %6
}

LLVM IR (-O2):
define float @db_inv(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 1.000000e-01
%4 = tail call float @pow(i32 10, double %3)
ret float %4
}
void AM335X_DEVICE_setPad() {}


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

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

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

LLVM IR (-O2):
define void @AM335X_DEVICE_setPad() {
ret void
}
/* Variables and functions */
void *malloc(size_t);
int main(int argc, char **argv) {
  size_t size = 15;
  void *p = malloc(size + argc);
  ((char *)p)[size] = **argv;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xf,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x4(%rbp),%rax
add    %rax,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%dl
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i64 15, i64* %5
%7 = load i64, i64* %5
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = add i64 %7, %9
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = load i8, i8* %13
%15 = load i8*, i8** %6
%16 = load i64, i64* %5
%17 = getelementptr inbounds i8, i8* %15, i64 %16
store i8 %14, i8* %17
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int test_imm_1Euint8_mem(unsigned char *val) {
  return ((*val) & (-0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Euint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffffe2,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Euint8_mem>:
testb  $0xe2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Euint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -30
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
scalar_t__ pthread_self();
void dummy_func() {
  pthread_t ptid = pthread_self();
  if (ptid == 0)
    return;
}


x86 assembly (clang, -O0):
<dummy_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pthread_self@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1133 <dummy_func+0x23>
jmp    1133 <dummy_func+0x23>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dummy_func() {
%1 = alloca i64
%2 = call i64 (...) @pthread_self()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
define void @dummy_func() {
%1 = tail call i64 (...) @pthread_self()
ret void
}
int __crow_lte(int a, int b) { return a <= b; }


x86 assembly (clang, -O0):
<__crow_lte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__crow_lte>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @__crow_lte(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @__crow_lte(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void constructor() {}


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

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

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

LLVM IR (-O2):
define void @constructor() {
ret void
}
/* Variables and functions */
double *malloc(int);
void create0(double **vx, double **vy, double **vz, size_t size) {
  *vx = malloc(sizeof(double) * size);
  *vy = malloc(sizeof(double) * size);
  *vz = malloc(sizeof(double) * size);
}


x86 assembly (clang, -O0):
<create0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create0>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x0(,%rcx,8),%ebp
mov    %ebp,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
mov    %ebp,%edi
call   1030 <malloc@plt>
mov    %rax,(%r15)
mov    %ebp,%edi
call   1030 <malloc@plt>
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @create0(double** %0, double** %1, double** %2, i64 %3) {
%5 = alloca double**
%6 = alloca double**
%7 = alloca double**
%8 = alloca i64
store double** %0, double*** %5
store double** %1, double*** %6
store double** %2, double*** %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = mul i64 8, %9
%11 = trunc i64 %10 to i32
%12 = call double* @malloc(i32 %11)
%13 = load double**, double*** %5
store double* %12, double** %13
%14 = load i64, i64* %8
%15 = mul i64 8, %14
%16 = trunc i64 %15 to i32
%17 = call double* @malloc(i32 %16)
%18 = load double**, double*** %6
store double* %17, double** %18
%19 = load i64, i64* %8
%20 = mul i64 8, %19
%21 = trunc i64 %20 to i32
%22 = call double* @malloc(i32 %21)
%23 = load double**, double*** %7
store double* %22, double** %23
ret void
}

LLVM IR (-O2):
define void @create0(double** nocapture writeonly %0, double** nocapture writeonly %1, double** nocapture writeonly %2, i64 %3) {
%5 = trunc i64 %3 to i32
%6 = shl i32 %5, 3
%7 = tail call double* @malloc(i32 %6)
store double* %7, double** %0
%8 = tail call double* @malloc(i32 %6)
store double* %8, double** %1
%9 = tail call double* @malloc(i32 %6)
store double* %9, double** %2
ret void
}
float function1(int radius) {
  float result = radius * radius * 3.14159;
  return result;
}


x86 assembly (clang, -O0):
<function1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<function1>:
imul   %edi,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @function1(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = sitofp i32 %6 to double
%8 = fmul double %7, 3.141590e+00
%9 = fptrunc double %8 to float
store float %9, float* %3
%10 = load float, float* %3
ret float %10
}

LLVM IR (-O2):
define float @function1(i32 %0) {
%2 = mul nsw i32 %0, %0
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 3.141590e+00
%5 = fptrunc double %4 to float
ret float %5
}
/* Type definitions */
typedef int uint8_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
uint8_t clamp8_from_float(float f) {
  static const float offset = (float)((3 << (22 - 7)) + 1);
  static const int32_t limneg = (0x11f << 22);
  static const int32_t limpos = (0x11f << 22) + 255;
  union {
    float f;
    int32_t i;
  } u;
  u.f = f + offset;
  if (u.i < limneg)
    return 0;
  if (u.i > limpos)
    return 255;
  return u.i;
}


x86 assembly (clang, -O0):
<clamp8_from_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  0xeef(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
cmpq   $0x47c00000,-0x10(%rbp)
47
jge    1135 <clamp8_from_float+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1156 <clamp8_from_float+0x56>
cmpq   $0x47c000ff,-0x10(%rbp)
47
jle    114f <clamp8_from_float+0x4f>
movl   $0xff,-0x4(%rbp)
jmp    1156 <clamp8_from_float+0x56>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp8_from_float>:
addss  0xef8(%rip),%xmm0
movd   %xmm0,%ecx
cmp    $0x47c00100,%ecx
mov    $0xff,%edx
cmovb  %ecx,%edx
xor    %eax,%eax
cmp    $0x47c00000,%ecx
cmovae %edx,%eax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
@clamp8_from_float.offset = internal constant float 9.830500e+04
@clamp8_from_float.limneg = internal constant i64 1203765248
@clamp8_from_float.limpos = internal constant i64 1203765503
define i32 @clamp8_from_float(float %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca %union.anon
store float %0, float* %3
%5 = load float, float* %3
%6 = fadd float %5, 9.830500e+04
%7 = bitcast %union.anon* %4 to float*
store float %6, float* %7
%8 = bitcast %union.anon* %4 to i64*
%9 = load i64, i64* %8
%10 = icmp slt i64 %9, 1203765248
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %21
12: ; preds = %1
%13 = bitcast %union.anon* %4 to i64*
%14 = load i64, i64* %13
%15 = icmp sgt i64 %14, 1203765503
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 255, i32* %2
br label %21
17: ; preds = %12
%18 = bitcast %union.anon* %4 to i64*
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %2
br label %21
21: ; preds = %17, %16, %11
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @clamp8_from_float(float %0) {
%2 = fadd float %0, 9.830500e+04
%3 = bitcast float %2 to i32
%4 = icmp ult i32 %3, 1203765248
%5 = icmp ugt i32 %3, 1203765503
%6 = select i1 %5, i32 255, i32 %3
%7 = select i1 %4, i32 0, i32 %6
ret i32 %7
}
char *findSlashBefore(char *start, char *e) {
  while (--e >= start) {
    if (*e == '/')
      return e;
  }
  return start;
}


x86 assembly (clang, -O0):
<findSlashBefore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
cmp    -0x10(%rbp),%rax
jb     1144 <findSlashBefore+0x44>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    113f <findSlashBefore+0x3f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <findSlashBefore+0x4c>
jmp    110c <findSlashBefore+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findSlashBefore>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rsi
nopw   0x0(%rax,%rax,1)
cmp    %rax,%rsi
jb     1128 <findSlashBefore+0x28>
lea    -0x1(%rsi),%rcx
cmpb   $0x2f,(%rsi)
mov    %rcx,%rsi
jne    1110 <findSlashBefore+0x10>
add    $0x1,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i8* @findSlashBefore(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %18, %2
%7 = load i8*, i8** %5
%8 = getelementptr inbounds i8, i8* %7, i32 -1
store i8* %8, i8** %5
%9 = load i8*, i8** %4
%10 = icmp uge i8* %8, %9
br i1 %10, label %11, label %19
11: ; preds = %6
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 47
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i8*, i8** %5
store i8* %17, i8** %3
br label %21
18: ; preds = %11
br label %6
19: ; preds = %6
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %21
21: ; preds = %19, %16
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @findSlashBefore(i8* readnone %0, i8* %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %1, %2 ], [ %5, %7 ]
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ult i8* %5, %0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i8, i8* %5
%9 = icmp eq i8 %8, 47
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i8* [ %5, %7 ], [ %0, %3 ]
ret i8* %11
}
int register_hdmi_cable_notification(struct hdmi_cable_notify *handler) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.hdmi_cable_notify = type opaque
define i32 @register_hdmi_cable_notification(%struct.hdmi_cable_notify* nocapture readnone %0) {
ret i32 0
}
unsigned int bit_group_starts_uint(unsigned int val) {
  return ((val) & ((val) ^ ((val) >> 1)));
}


x86 assembly (clang, -O0):
<bit_group_starts_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
shr    $0x1,%edx
xor    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_group_starts_uint>:
mov    %edi,%eax
shr    %eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bit_group_starts_uint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = xor i32 %4, %6
%8 = and i32 %3, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @bit_group_starts_uint(i32 %0) {
%2 = lshr i32 %0, 1
%3 = xor i32 %2, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int a = 5, b = 6;
  printf("%d + %d = %d\n", a, b, a + b);
  printf("%d\n", 'A');
  printf("%c\n", 65);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0xc(%rbp),%ecx
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x41,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x41,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
mov    $0xb,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 5, i32 6, i32 11)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 65)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 65)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, char const *);
void log_event(const char *message) { syslog(LOG_INFO, "%s", message); }


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

x86 assembly (clang, -O2):
<log_event>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <syslog@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_event(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LOG_INFO
%4 = load i8*, i8** %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [3 x i8] c"%s\00"
define void @log_event(i8* %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int stringTerminatorCheck(char *, int, char *, int, int);
int crlfcrlfCheck(char *buffer, int dataLength, int newDataStartIndex) {
  return stringTerminatorCheck("\r\n\r\n", 4, buffer, dataLength,
                               newDataStartIndex);
}


x86 assembly (clang, -O0):
<crlfcrlfCheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xecc(%rip),%rdi
mov    $0x4,%esi
call   1030 <stringTerminatorCheck@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crlfcrlfCheck>:
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee1(%rip),%rdi
mov    $0x4,%esi
jmp    1030 <stringTerminatorCheck@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0D\0A\0D\0A\00"
define i32 @crlfcrlfCheck(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @stringTerminatorCheck(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4, i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
struct rusage {
  int dummy;
};
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ wait4(int, int *, int, struct rusage *);
pid_t wait3(int *status, int options, struct rusage *rusage) {
  return wait4(-1, status, options, rusage);
}


x86 assembly (clang, -O0):
<wait3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0xffffffff,%edi
call   1030 <wait4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait3>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffffff,%edi
jmp    1030 <wait4@plt>

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @wait3(i32* %0, i32 %1, %struct.rusage* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca %struct.rusage*
store i32* %0, i32** %4
store i32 %1, i32* %5
store %struct.rusage* %2, %struct.rusage** %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load %struct.rusage*, %struct.rusage** %6
%10 = call i32 @wait4(i32 -1, i32* %7, i32 %8, %struct.rusage* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @wait3(i32* %0, i32 %1, %struct.rusage* %2) {
%4 = tail call i32 @wait4(i32 -1, i32* %0, i32 %1, %struct.rusage* %2)
ret i32 %4
}
/* Type definitions */
struct cfbuf_obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ cfbuf__close(struct cfbuf_obj *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void handle_io_fail(struct cfbuf_obj *f) {
  perror("Error reading the file1\n");
  cfbuf__close(f);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<handle_io_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    -0x8(%rbp),%rdi
call   1030 <cfbuf__close@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handle_io_fail>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
mov    %rbx,%rdi
call   1030 <cfbuf__close@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.cfbuf_obj = type { i32 }
@.str = [25 x i8] c"Error reading the file1\0A\00"
@EXIT_FAILURE = global i32 0
define void @handle_io_fail(%struct.cfbuf_obj* %0) {
%2 = alloca %struct.cfbuf_obj*
store %struct.cfbuf_obj* %0, %struct.cfbuf_obj** %2
%3 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.cfbuf_obj*, %struct.cfbuf_obj** %2
%5 = call i32 @cfbuf__close(%struct.cfbuf_obj* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
%struct.cfbuf_obj = type { i32 }
@.str = [25 x i8] c"Error reading the file1\0A\00"
@EXIT_FAILURE = global i32 0
define void @handle_io_fail(%struct.cfbuf_obj* %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @cfbuf__close(%struct.cfbuf_obj* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
char *read_read(p, left, data)
char *p;
long left;
void *data;
{
  long got;
  do
    if (0 >= (got = rread(0, p, left)))
      return p;
  while (p += got, left -= got);
  return 0;
}


x86 assembly (clang, -O0):
<read_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
mov    $0x0,%al
call   1030 <rread@plt>
movslq %eax,%rcx
mov    %rcx,-0x28(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jl     1154 <read_read+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1186 <read_read+0x76>
jmp    1159 <read_read+0x49>
mov    -0x28(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1124 <read_read+0x14>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_read>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <rread@plt>
test   %eax,%eax
jle    1140 <read_read+0x30>
cltq
add    %rax,%r14
sub    %rax,%rbx
jne    1120 <read_read+0x10>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @read_read(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
br label %9
9: ; preds = %18, %3
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @rread to i32 (i32, i8*, i64, ...)*)(i32 0, i8* %10, i64 %11)
%13 = sext i32 %12 to i64
store i64 %13, i64* %8
%14 = icmp sge i64 0, %13
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = load i8*, i8** %5
store i8* %16, i8** %4
br label %27
17: ; preds = %9
br label %18
18: ; preds = %17
%19 = load i64, i64* %8
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i64 %19
store i8* %21, i8** %5
%22 = load i64, i64* %8
%23 = load i64, i64* %6
%24 = sub nsw i64 %23, %22
store i64 %24, i64* %6
%25 = icmp ne i64 %24, 0
br i1 %25, label %9, label %26
26: ; preds = %18
store i8* null, i8** %4
br label %27
27: ; preds = %26, %15
%28 = load i8*, i8** %4
ret i8* %28
}

LLVM IR (-O2):
define i8* @read_read(i8* %0, i64 %1, i8* nocapture readnone %2) {
br label %4
4: ; preds = %10, %3
%5 = phi i64 [ %1, %3 ], [ %12, %10 ]
%6 = phi i8* [ %0, %3 ], [ %11, %10 ]
%7 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @rread to i32 (i32, i8*, i64, ...)*)(i32 0, i8* %6, i64 %5)
%8 = sext i32 %7 to i64
%9 = icmp slt i32 %7, 1
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 %8
%12 = sub nsw i64 %5, %8
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %10, %4
%15 = phi i8* [ %6, %4 ], [ null, %10 ]
ret i8* %15
}
void spin_unlock(unsigned char volatile *lock) { __sync_lock_release(lock); }


x86 assembly (clang, -O0):
<spin_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<spin_unlock>:
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @spin_unlock(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store atomic i8 0, i8* %3 release
ret void
}

LLVM IR (-O2):
define void @spin_unlock(i8* nocapture writeonly %0) {
store atomic i8 0, i8* %0 release
ret void
}
int test_imm_48uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x48,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_48uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 72
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *strcpy(int /*<<< orphan*/, char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ xmalloc(scalar_t__);
char *xstrdup(const char *str) {
  if (str == NULL)
    return NULL;
  else
    return strcpy(xmalloc(strlen(str) + 1), str);
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1178 <xstrdup+0x48>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
test   %rdi,%rdi
je     1152 <xstrdup+0x22>
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <xmalloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <strcpy@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %14
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %9, 1
%11 = call i32 @xmalloc(i64 %10)
%12 = load i8*, i8** %3
%13 = call i8* @strcpy(i32 %11, i8* %12)
store i8* %13, i8** %2
br label %14
14: ; preds = %7, %6
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i32 @xmalloc(i64 %5)
%7 = tail call i8* @strcpy(i32 %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %7, %3 ], [ null, %1 ]
ret i8* %9
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ keyboard_outputWait();
unsigned char keyboard_getData() {
  keyboard_outputWait();
  return inb(0x60);
}


x86 assembly (clang, -O0):
<keyboard_getData>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <keyboard_outputWait@plt>
mov    $0x60,%edi
call   1030 <inb@plt>
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyboard_getData>:
push   %rax
xor    %eax,%eax
call   1040 <keyboard_outputWait@plt>
mov    $0x60,%edi
pop    %rax
jmp    1030 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @keyboard_getData() {
%1 = call i32 (...) @keyboard_outputWait()
%2 = call zeroext i8 @inb(i32 96)
ret i8 %2
}

LLVM IR (-O2):
define zeroext i8 @keyboard_getData() {
%1 = tail call i32 (...) @keyboard_outputWait()
%2 = tail call zeroext i8 @inb(i32 96)
ret i8 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t additional_len(uint8_t additional) {
  if (24 <= additional && additional <= 27) {
    return 1 << (additional - 24);
  }
  return 0;
}


x86 assembly (clang, -O0):
<additional_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x18,%eax
cmp    -0x8(%rbp),%eax
jg     1134 <additional_len+0x34>
cmpl   $0x1b,-0x8(%rbp)
jg     1134 <additional_len+0x34>
mov    -0x8(%rbp),%ecx
sub    $0x18,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <additional_len+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<additional_len>:
lea    -0x18(%rdi),%ecx
mov    %edi,%edx
and    $0xfffffffc,%edx
mov    $0x1,%esi
shl    %cl,%esi
xor    %eax,%eax
cmp    $0x18,%edx
cmove  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @additional_len(i32 %0) {
%2 = and i32 %0, -4
%3 = icmp eq i32 %2, 24
%4 = add nsw i32 %0, -24
%5 = shl nuw i32 1, %4
%6 = select i1 %3, i32 %5, i32 0
ret i32 %6
}
/* Variables and functions */
long double atanh(long double);
long double atanhl(long double a1) { return atanh(a1); }


x86 assembly (clang, -O0):
<atanhl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <atanh@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanhl>:
jmp    1030 <atanh@plt>

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

LLVM IR (-O2):
define x86_fp80 @atanhl(x86_fp80 %0) {
%2 = tail call x86_fp80 @atanh(x86_fp80 %0)
ret x86_fp80 %2
}
/* Type definitions */
struct buildopt {
  int dummy;
};

/* Variables and functions */
struct buildopt *cli_buildopt_find(char *);
int /*<<< orphan*/ fatal(char *);
struct buildopt *cli_buildopt_default(void) {
  struct buildopt *bopt;
  if ((bopt = cli_buildopt_find("_default")) == NULL)
    fatal("no _default buildopt options");
  return (bopt);
}


x86 assembly (clang, -O0):
<cli_buildopt_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <cli_buildopt_find@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    114e <cli_buildopt_default+0x2e>
lea    0xec0(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_buildopt_default>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <cli_buildopt_find@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1141 <cli_buildopt_default+0x21>
lea    0xecd(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.buildopt = type { i32 }
@.str = [9 x i8] c"_default\00"
@.str.1 = [29 x i8] c"no _default buildopt options\00"
define %struct.buildopt* @cli_buildopt_default() {
%1 = alloca %struct.buildopt*
%2 = call %struct.buildopt* @cli_buildopt_find(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store %struct.buildopt* %2, %struct.buildopt** %1
%3 = icmp eq %struct.buildopt* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @fatal(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = load %struct.buildopt*, %struct.buildopt** %1
ret %struct.buildopt* %7
}

LLVM IR (-O2):
%struct.buildopt = type { i32 }
@.str = [9 x i8] c"_default\00"
@.str.1 = [29 x i8] c"no _default buildopt options\00"
define %struct.buildopt* @cli_buildopt_default() {
%1 = tail call %struct.buildopt* @cli_buildopt_find(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq %struct.buildopt* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @fatal(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret %struct.buildopt* %1
}
int test_imm_48uint16_reg(unsigned short val) {
  return ((val) & (0x48 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_48uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x48,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_48uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 72
%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_48uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 72
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double fdiv(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<fdiv>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdiv>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fdiv(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
double _G_R_INF(const double rr, const double Dx) { const double r = rr / Dx; }


x86 assembly (clang, -O0):
<_G_R_INF>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @_G_R_INF(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fdiv double %7, %8
store double %9, double* %6
%10 = load double, double* %3
ret double %10
}

LLVM IR (-O2):
define double @_G_R_INF(double %0, double %1) {
ret double undef
}