xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ evaluate_vent_c();
void evaluate_vent() { evaluate_vent_c(); }


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

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

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

LLVM IR (-O2):
define void @evaluate_vent() {
%1 = tail call i32 (...) @evaluate_vent_c()
ret void
}
/* Variables and functions */
scalar_t__ rint(double);
long double rintl(long double x) { return (long double)rint((double)x); }


x86 assembly (clang, -O0):
<rintl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <rint@plt>
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintl>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <rint@plt>
mov    %rax,0x10(%rsp)
fildll 0x10(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fptrunc x86_fp80 %3 to double
%5 = call i64 @rint(double %4)
%6 = sitofp i64 %5 to x86_fp80
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @rintl(x86_fp80 %0) {
%2 = fptrunc x86_fp80 %0 to double
%3 = tail call i64 @rint(double %2)
%4 = sitofp i64 %3 to x86_fp80
ret x86_fp80 %4
}
/* Variables and functions */
int /*<<< orphan*/ ccin_create_freq_list();
int /*<<< orphan*/ ccin_load_system_frequency();
int /*<<< orphan*/ ccin_load_system_glossary();
int /*<<< orphan*/ ccin_load_user_frequency();
int /*<<< orphan*/ ccin_load_user_glossary();
void ccin_open_imfactory() {
  ccin_load_system_glossary();
  ccin_load_system_frequency();
  ccin_load_user_glossary();
  ccin_load_user_frequency();
  ccin_create_freq_list();
}


x86 assembly (clang, -O0):
<ccin_open_imfactory>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ccin_load_system_glossary@plt>
mov    $0x0,%al
call   1060 <ccin_load_system_frequency@plt>
mov    $0x0,%al
call   1050 <ccin_load_user_glossary@plt>
mov    $0x0,%al
call   1040 <ccin_load_user_frequency@plt>
mov    $0x0,%al
call   1070 <ccin_create_freq_list@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ccin_open_imfactory>:
push   %rax
xor    %eax,%eax
call   1030 <ccin_load_system_glossary@plt>
xor    %eax,%eax
call   1060 <ccin_load_system_frequency@plt>
xor    %eax,%eax
call   1050 <ccin_load_user_glossary@plt>
xor    %eax,%eax
call   1040 <ccin_load_user_frequency@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <ccin_create_freq_list@plt>

LLVM IR (-O0):
define void @ccin_open_imfactory() {
%1 = call i32 (...) @ccin_load_system_glossary()
%2 = call i32 (...) @ccin_load_system_frequency()
%3 = call i32 (...) @ccin_load_user_glossary()
%4 = call i32 (...) @ccin_load_user_frequency()
%5 = call i32 (...) @ccin_create_freq_list()
ret void
}

LLVM IR (-O2):
define void @ccin_open_imfactory() {
%1 = tail call i32 (...) @ccin_load_system_glossary()
%2 = tail call i32 (...) @ccin_load_system_frequency()
%3 = tail call i32 (...) @ccin_load_user_glossary()
%4 = tail call i32 (...) @ccin_load_user_frequency()
%5 = tail call i32 (...) @ccin_create_freq_list()
ret void
}
void initializegetcurrenttime(void) {}


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

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

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

LLVM IR (-O2):
define void @initializegetcurrenttime() {
ret void
}
/* Variables and functions */
int strlen(char *);
void chomp(char *text) {
  int length = strlen(text);
  if (length > 0 && text[length - 1] == '\n') {
    text[length - 1] = 0;
  }
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    115d <chomp+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    115d <chomp+0x4d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112a <chomp+0x1a>
add    $0xffffffff,%eax
cmpb   $0xa,(%rbx,%rax,1)
jne    112a <chomp+0x1a>
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %4
store i8 0, i8* %7
br label %11
11: ; preds = %10, %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void impossible() { printf("Its impossible to execute this function\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"Its impossible to execute this function\0A\00"
define void @impossible() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"Its impossible to execute this function\00"
define void @impossible() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
void FS_StripExtension(char *in, char *out) {
  while (*in && *in != '.')
    *out++ = *in++;
  *out = 0;
}


x86 assembly (clang, -O0):
<FS_StripExtension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1131 <FS_StripExtension+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <FS_StripExtension+0x41>
jmp    1168 <FS_StripExtension+0x68>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <FS_StripExtension+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FS_StripExtension>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1126 <FS_StripExtension+0x26>
cmp    $0x2e,%cl
je     1126 <FS_StripExtension+0x26>
mov    %cl,(%rsi,%rax,1)
add    $0x1,%rax
jmp    1110 <FS_StripExtension+0x10>
movb   $0x0,(%rsi,%rax,1)
ret

LLVM IR (-O0):
define void @FS_StripExtension(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %17, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 46
br label %15
15: ; preds = %10, %5
%16 = phi i1 [ false, %5 ], [ %14, %10 ]
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8, i8* %18
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
store i8 %20, i8* %21
br label %5
23: ; preds = %15
%24 = load i8*, i8** %4
store i8 0, i8* %24
ret void
}

LLVM IR (-O2):
define void @FS_StripExtension(i8* nocapture %0, i8* nocapture writeonly %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = phi i8* [ %1, %2 ], [ %9, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %7 [
i8 0, label %10
i8 46, label %10
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %6, i8* %5
br label %3
10: ; preds = %3, %3
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_call(int, int, int /*<<< orphan*/);
void undoBackwards() { sys_call(9, 7, 0); }


x86 assembly (clang, -O0):
<undoBackwards>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9,%edi
mov    $0x7,%esi
xor    %edx,%edx
call   1030 <sys_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<undoBackwards>:
mov    $0x9,%edi
mov    $0x7,%esi
xor    %edx,%edx
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define void @undoBackwards() {
%1 = call i32 @sys_call(i32 9, i32 7, i32 0)
ret void
}

LLVM IR (-O2):
define void @undoBackwards() {
%1 = tail call i32 @sys_call(i32 9, i32 7, i32 0)
ret void
}
int test_imm_C0int64_highword_reg(long long val) {
  return ((val >> 32) & (0xC0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C0int64_highword_reg>:
movabs $0xc000000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C0int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 192
%6 = icmp ne i64 %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_C0int64_highword_reg(i64 %0) {
%2 = and i64 %0, 824633720832
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ Page_DenyAccess(void *, size_t);
scalar_t__ munmap(int /*<<< orphan*/, size_t);
void Page_Delete(void *address, size_t size) {
  if (munmap((caddr_t)address, size) < 0)
    Page_DenyAccess(address, size);
}


x86 assembly (clang, -O0):
<Page_Delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
cmp    $0x0,%rax
jge    1156 <Page_Delete+0x36>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <Page_DenyAccess@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Page_Delete>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <munmap@plt>
test   %rax,%rax
js     113c <Page_Delete+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Page_DenyAccess@plt>

LLVM IR (-O0):
define void @Page_Delete(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i32
%7 = load i64, i64* %4
%8 = call i64 @munmap(i32 %6, i64 %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @Page_DenyAccess(i8* %11, i64 %12)
br label %14
14: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
define void @Page_Delete(i8* %0, i64 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i64 @munmap(i32 %4, i64 %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @Page_DenyAccess(i8* %0, i64 %1)
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
int ls_costN_nm4_f0(double const **, double **, int *, double *, int);
int ls_costN_nm4(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return ls_costN_nm4_f0(arg, res, iw, w, mem);
}


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

x86 assembly (clang, -O2):
<ls_costN_nm4>:
jmp    1030 <ls_costN_nm4_f0@plt>

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

LLVM IR (-O2):
define i32 @ls_costN_nm4(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @ls_costN_nm4_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
void fdset_add(fd_set *set, int fd, int *nfds) {
  FD_SET(fd, set);
  if (fd >= *nfds)
    *nfds = fd + 1;
}


x86 assembly (clang, -O0):
<fdset_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <FD_SET@plt>
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jl     114a <fdset_add+0x3a>
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdset_add>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rsi
mov    %ebp,%edi
call   1030 <FD_SET@plt>
cmp    %ebp,(%rbx)
jg     112b <fdset_add+0x1b>
add    $0x1,%ebp
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fdset_add(i32* %0, i32 %1, i32* nocapture %2) {
%4 = tail call i32 @FD_SET(i32 %1, i32* %0)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, %1
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = add nsw i32 %1, 1
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %3
ret void
}
void bottom_printf(char *fmt, ...) { ; }


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

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

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

LLVM IR (-O2):
define void @bottom_printf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ scanf(char *, double *, double *, double *, double *, double *,
                 double *);
int main() {
  double a, b, c, d, l, r;
  while (scanf("%.2lf %.2ld %.2lf %.2lf %.2lf %.2lf", &a, &b, &c, &d, &l, &r) !=
         EOF) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x28(%rbp),%r8
lea    -0x30(%rbp),%r9
lea    -0x38(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <scanf@plt>
mov    0x2e9a(%rip),%rcx
cmp    (%rcx),%rax
je     115c <main+0x4c>
jmp    111f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0x30(%rsp),%r15
lea    0x28(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0x18(%rsp),%rbx
lea    0x10(%rsp),%rbp
mov    0x2eaa(%rip),%r14
xchg   %ax,%ax
lea    0x8(%rsp),%rax
mov    %rax,(%rsp)
lea    0xeb0(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
mov    %rbp,%r9
call   1030 <scanf@plt>
cmp    (%r14),%rax
jne    1140 <main+0x30>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [36 x i8] c"%.2lf %.2ld %.2lf %.2lf %.2lf %.2lf\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %1 to i8*
%8 = bitcast double* %2 to i8*
%9 = bitcast double* %3 to i8*
%10 = bitcast double* %4 to i8*
%11 = bitcast double* %5 to i8*
%12 = bitcast double* %6 to i8*
br label %13
13: ; preds = %13, %0
%14 = call i64 @scanf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, double* %3, double* %4, double* %5, double* %6)
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %13
17: ; preds = %13
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EOR_();
int /*<<< orphan*/ c64_memAbsoluteAddrY();
void EOR_absy(void) {
  c64_memAbsoluteAddrY();
  EOR_();
}


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

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

LLVM IR (-O0):
define void @EOR_absy() {
%1 = call i32 (...) @c64_memAbsoluteAddrY()
%2 = call i32 (...) @EOR_()
ret void
}

LLVM IR (-O2):
define void @EOR_absy() {
%1 = tail call i32 (...) @c64_memAbsoluteAddrY()
%2 = tail call i32 (...) @EOR_()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  scanf("%d", &i);
  printf("%d", 2 * i + 10 - 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0xa,%esi
sub    $0x2,%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
lea    (%rax,%rax,1),%esi
add    $0x8,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = shl nsw i32 %4, 1
%6 = add nsw i32 %5, 8
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int read(int, int *, int);
int /*<<< orphan*/ syserr(char *, int);
int readInt(int readDescriptor) {
  int *value = (int *)malloc(sizeof(int));
  if (read(readDescriptor, value, sizeof(int)) != sizeof(int)) {
    syserr("read from %d\n", readDescriptor);
  }
  return *value;
}


x86 assembly (clang, -O0):
<readInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <read@plt>
cltq
cmp    $0x4,%rax
je     1175 <readInt+0x45>
mov    -0x4(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <syserr@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInt>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
mov    $0x4,%edx
call   1040 <read@plt>
cmp    $0x4,%eax
je     1164 <readInt+0x34>
lea    0xea3(%rip),%rdi
mov    %ebp,%esi
call   1030 <syserr@plt>
mov    (%rbx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"read from %d\0A\00"
define i32 @readInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
%8 = call i32 @read(i32 %6, i32* %7, i32 4)
%9 = sext i32 %8 to i64
%10 = icmp ne i64 %9, 4
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = call i32 @syserr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11, %1
%15 = load i32*, i32** %3
%16 = load i32, i32* %15
ret i32 %16
}

LLVM IR (-O2):
@.str = [14 x i8] c"read from %d\0A\00"
define i32 @readInt(i32 %0) {
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = tail call i32 @read(i32 %0, i32* %3, i32 4)
%5 = icmp eq i32 %4, 4
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @syserr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %1
%9 = load i32, i32* %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ i2c1_read(unsigned char *, int);
int /*<<< orphan*/ i2c1_write(unsigned char *, int);
void i2c1_readregs(unsigned char reg, unsigned char *data, int length) {
  i2c1_write(&reg, 1);
  i2c1_read(data, length);
}


x86 assembly (clang, -O0):
<i2c1_readregs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <i2c1_write@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <i2c1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c1_readregs>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <i2c1_write@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <i2c1_read@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @i2c1_readregs(i8 zeroext %0, i8* %1, i32 %2) {
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i32
store i8 %0, i8* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @i2c1_write(i8* %4, i32 1)
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @i2c1_read(i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @i2c1_readregs(i8 zeroext %0, i8* %1, i32 %2) {
%4 = alloca i8
store i8 %0, i8* %4
%5 = call i32 @i2c1_write(i8* %4, i32 1)
%6 = call i32 @i2c1_read(i8* %1, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timeval {
  unsigned long tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
uint64_t current_usec() {
  struct timeval t;
  gettimeofday(&t, 0);
  return t.tv_sec * 1000000UL + t.tv_usec;
}


x86 assembly (clang, -O0):
<current_usec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_usec>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @current_usec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @current_usec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
float CConvertToF(float celius) { return celius * 9 / 5 + 32; }


x86 assembly (clang, -O0):
<CConvertToF>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee6(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xed6(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CConvertToF>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
addss  0xef0(%rip),%xmm0
ret

LLVM IR (-O0):
define float @CConvertToF(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 9.000000e+00
%5 = fdiv float %4, 5.000000e+00
%6 = fadd float %5, 3.200000e+01
ret float %6
}

LLVM IR (-O2):
define float @CConvertToF(float %0) {
%2 = fmul float %0, 9.000000e+00
%3 = fdiv float %2, 5.000000e+00
%4 = fadd float %3, 3.200000e+01
ret float %4
}
int cmp_eq(int a, int b) { return a == b; }


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

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

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

LLVM IR (-O2):
define i32 @cmp_eq(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
int pointers(int *a) {
  return a > 0;
  return a > (void *)0;
}


x86 assembly (clang, -O0):
<pointers>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pointers>:
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @pointers(i32* readnone %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void display_usage(void) {
  printf("how to use this program:\n");
  printf("run program: ut804_logger -d device \n");
  printf("program options:\n");
  printf("\t\t -d device_interface_name  	- device interface name like "
         "/dev/ttyUSB0 \n");
  printf("\t\t -h - this message\n\n");
}


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

x86 assembly (clang, -O2):
<display_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xef5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xf50(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"how to use this program:\0A\00"
@.str.1 = [38 x i8] c"run program: ut804_logger -d device \0A\00"
@.str.2 = [18 x i8] c"program options:\0A\00"
@.str.3 = [74 x i8] c"\09\09 -d device_interface_name \09- device interface name like /dev/ttyUSB0 \0A\00"
@.str.4 = [23 x i8] c"\09\09 -h - this message\0A\0A\00"
define void @display_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"how to use this program:\00"
@str.5 = [37 x i8] c"run program: ut804_logger -d device \00"
@str.6 = [17 x i8] c"program options:\00"
@str.7 = [73 x i8] c"\09\09 -d device_interface_name \09- device interface name like /dev/ttyUSB0 \00"
@str.8 = [22 x i8] c"\09\09 -h - this message\0A\00"
define void @display_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.8, i64 0, i64 0))
ret void
}
/* Variables and functions */
int calculate_checksum(char const *, int);
int supplied_checksum(char const *);
int validate_checksum(const char *buf, int buf_len, const char *expected) {
  const int calulated_checksum = calculate_checksum(buf, buf_len);
  const int compare = supplied_checksum(expected);
  return calulated_checksum - compare;
}


x86 assembly (clang, -O0):
<validate_checksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <calculate_checksum@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <supplied_checksum@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_checksum>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
call   1030 <calculate_checksum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <supplied_checksum@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @validate_checksum(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @calculate_checksum(i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @supplied_checksum(i8* %12)
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @validate_checksum(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @calculate_checksum(i8* %0, i32 %1)
%5 = tail call i32 @supplied_checksum(i8* %2)
%6 = sub nsw i32 %4, %5
ret i32 %6
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_ContentDirectory_StopTransferResource(
    struct UPnPService *Service, int ErrorCode, void *User) {
  printf("RND Invoke Response: "
         "ContentDirectory/StopTransferResource[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ContentDirectory_StopTransferResource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [77 x i8] c"RND Invoke Response: ContentDirectory/StopTransferResource[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_StopTransferResource(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [77 x i8] c"RND Invoke Response: ContentDirectory/StopTransferResource[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ContentDirectory_StopTransferResource(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct supertype {
  int dummy;
};

/* Variables and functions */
int wait_and_act(struct supertype *, int);
void do_monitor(struct supertype *container) {
  int rv;
  int first = 1;
  do {
    rv = wait_and_act(container, first);
    first = 0;
  } while (rv >= 0);
}


x86 assembly (clang, -O0):
<do_monitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <wait_and_act@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1123 <do_monitor+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_monitor>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%esi
nopl   0x0(%rax)
call   1030 <wait_and_act@plt>
test   %eax,%eax
js     1130 <do_monitor+0x20>
mov    %rbx,%rdi
xor    %esi,%esi
jmp    1120 <do_monitor+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.supertype = type { i32 }
define void @do_monitor(%struct.supertype* %0) {
%2 = alloca %struct.supertype*
%3 = alloca i32
%4 = alloca i32
store %struct.supertype* %0, %struct.supertype** %2
store i32 1, i32* %4
br label %5
5: ; preds = %9, %1
%6 = load %struct.supertype*, %struct.supertype** %2
%7 = load i32, i32* %4
%8 = call i32 @wait_and_act(%struct.supertype* %6, i32 %7)
store i32 %8, i32* %3
store i32 0, i32* %4
br label %9
9: ; preds = %5
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %9
ret void
}

LLVM IR (-O2):
%struct.supertype = type { i32 }
define void @do_monitor(%struct.supertype* %0) {
%2 = tail call i32 @wait_and_act(%struct.supertype* %0, i32 1)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1, %4
%5 = tail call i32 @wait_and_act(%struct.supertype* %0, i32 0)
%6 = icmp sgt i32 %5, -1
br i1 %6, label %4, label %7
7: ; preds = %4, %1
ret void
}
void opencmd(dir, can_ai) int dir;
int can_ai;
{
  if (dir == 4)
    openfwd(can_ai);
  else
    openbwd(can_ai);
}


x86 assembly (clang, -O0):
<opencmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x4,-0x4(%rbp)
jne    1147 <opencmd+0x27>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <openfwd@plt>
jmp    1151 <opencmd+0x31>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1040 <openbwd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opencmd>:
cmp    $0x4,%edi
jne    112e <opencmd+0xe>
mov    %esi,%edi
xor    %eax,%eax
jmp    1030 <openfwd@plt>
mov    %esi,%edi
xor    %eax,%eax
jmp    1040 <openbwd@plt>

LLVM IR (-O0):
define void @opencmd(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 = icmp eq i32 %5, 4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = call i32 (i32, ...) bitcast (i32 (...)* @openfwd to i32 (i32, ...)*)(i32 %8)
br label %13
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i32 (i32, ...) bitcast (i32 (...)* @openbwd to i32 (i32, ...)*)(i32 %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
define void @opencmd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 4
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @openfwd to i32 (i32, ...)*)(i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @openbwd to i32 (i32, ...)*)(i32 %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int S_IRUSR;
int S_IWUSR;
int __gen_tempname(char *, int /*<<< orphan*/, int /*<<< orphan*/, int);
int mkstemp(char *template) {
  return __gen_tempname(template, 0, 0, S_IRUSR | S_IWUSR);
}


x86 assembly (clang, -O0):
<mkstemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
or     (%rax),%ecx
xor    %edx,%edx
mov    %edx,%esi
call   1030 <__gen_tempname@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkstemp>:
mov    0x2ec1(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__gen_tempname@plt>

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRUSR
%5 = load i32, i32* @S_IWUSR
%6 = or i32 %4, %5
%7 = call i32 @__gen_tempname(i8* %3, i32 0, i32 0, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
define i32 @mkstemp(i8* %0) {
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IWUSR
%4 = or i32 %3, %2
%5 = tail call i32 @__gen_tempname(i8* %0, i32 0, i32 0, i32 %4)
ret i32 %5
}
float soma(float num1, float num2, float num3) { return num1 + num2 + num3; }


x86 assembly (clang, -O0):
<soma>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<soma>:
addss  %xmm1,%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @soma(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fadd float %7, %8
%10 = load float, float* %6
%11 = fadd float %9, %10
ret float %11
}

LLVM IR (-O2):
define float @soma(float %0, float %1, float %2) {
%4 = fadd float %0, %1
%5 = fadd float %4, %2
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ PIT_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void PIT_IRQHandler(void) {
  PIT_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @PIT_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @PIT_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @PIT_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @PIT_DriverIRQHandler()
ret void
}
int d_eq_rr2(double a1, double a2) { return !(((a1) == (a2))); }


x86 assembly (clang, -O0):
<d_eq_rr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_eq_rr2>:
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_eq_rr2(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 = fcmp oeq double %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_eq_rr2(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void __ipipe_init_proc(void) {}


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

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

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

LLVM IR (-O2):
define void @__ipipe_init_proc() {
ret void
}
void __lngSub(unsigned short acc[2], unsigned short subtrahend[2]) {
  acc[1] -= subtrahend[1] + (*acc < *subtrahend);
  *acc -= *subtrahend;
}


x86 assembly (clang, -O0):
<__lngSub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzwl 0x2(%rax),%edx
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%edx
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%ecx
sub    %edx,%ecx
mov    %cx,0x2(%rax)
mov    -0x10(%rbp),%rax
movzwl (%rax),%edx
mov    -0x8(%rbp),%rax
movzwl (%rax),%ecx
sub    %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lngSub>:
movzwl 0x2(%rsi),%eax
movzwl (%rdi),%ecx
cmp    (%rsi),%cx
sbb    %ax,0x2(%rdi)
sub    (%rsi),%cx
mov    %cx,(%rdi)
ret

LLVM IR (-O0):
define void @__lngSub(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %4
%6 = getelementptr inbounds i16, i16* %5, i64 1
%7 = load i16, i16* %6
%8 = zext i16 %7 to i32
%9 = load i16*, i16** %3
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = load i16*, i16** %4
%13 = load i16, i16* %12
%14 = zext i16 %13 to i32
%15 = icmp slt i32 %11, %14
%16 = zext i1 %15 to i32
%17 = add nsw i32 %8, %16
%18 = load i16*, i16** %3
%19 = getelementptr inbounds i16, i16* %18, i64 1
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = sub nsw i32 %21, %17
%23 = trunc i32 %22 to i16
store i16 %23, i16* %19
%24 = load i16*, i16** %4
%25 = load i16, i16* %24
%26 = zext i16 %25 to i32
%27 = load i16*, i16** %3
%28 = load i16, i16* %27
%29 = zext i16 %28 to i32
%30 = sub nsw i32 %29, %26
%31 = trunc i32 %30 to i16
store i16 %31, i16* %27
ret void
}

LLVM IR (-O2):
define void @__lngSub(i16* nocapture %0, i16* nocapture %1) {
%3 = getelementptr inbounds i16, i16* %1, i64 1
%4 = load i16, i16* %3
%5 = load i16, i16* %0
%6 = load i16, i16* %1
%7 = icmp ult i16 %5, %6
%8 = sext i1 %7 to i16
%9 = getelementptr inbounds i16, i16* %0, i64 1
%10 = load i16, i16* %9
%11 = sub i16 %10, %4
%12 = add i16 %11, %8
store i16 %12, i16* %9
%13 = load i16, i16* %1
%14 = sub i16 %5, %13
store i16 %14, i16* %0
ret void
}
void gc_dump_arena_stats(const char *msg, struct gc_arena *a) {
  (void)msg;
  (void)a;
}


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

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

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

LLVM IR (-O2):
%struct.gc_arena = type opaque
define void @gc_dump_arena_stats(i8* nocapture %0, %struct.gc_arena* nocapture %1) {
ret void
}
/* Variables and functions */
int test2();
int test1(void) { return test2(); }


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

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

LLVM IR (-O0):
define i32 @test1() {
%1 = call i32 (...) @test2()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test1() {
%1 = tail call i32 (...) @test2()
ret i32 %1
}
/* Variables and functions */
int exp(int);
double alpha_m(const double V) {
  return 0.1 * (50. - V) / (exp((50. - V) / 10.) - 1.);
}


x86 assembly (clang, -O0):
<alpha_m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeeb(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecd(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <exp@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
movsd  0xe92(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha_m>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  0xee3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
divsd  0xeda(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <exp@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0xeca(%rip),%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @alpha_m(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 5.000000e+01, %3
%5 = fmul double 1.000000e-01, %4
%6 = load double, double* %2
%7 = fsub double 5.000000e+01, %6
%8 = fdiv double %7, 1.000000e+01
%9 = fptosi double %8 to i32
%10 = call i32 @exp(i32 %9)
%11 = sitofp i32 %10 to double
%12 = fsub double %11, 1.000000e+00
%13 = fdiv double %5, %12
ret double %13
}

LLVM IR (-O2):
define double @alpha_m(double %0) {
%2 = fsub double 5.000000e+01, %0
%3 = fmul double %2, 1.000000e-01
%4 = fdiv double %2, 1.000000e+01
%5 = fptosi double %4 to i32
%6 = tail call i32 @exp(i32 %5)
%7 = sitofp i32 %6 to double
%8 = fadd double %7, -1.000000e+00
%9 = fdiv double %3, %8
ret double %9
}
void sw_reset_vlsi(void) {}


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

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

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

LLVM IR (-O2):
define void @sw_reset_vlsi() {
ret void
}