xunge/DecIR huggingface dataset:
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double gettime(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + (double)tv.tv_usec / 1000000.;
}


x86 assembly (clang, -O0):
<gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
movsd  0xec8(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %4, %8
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @gettime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ ceil(double);
double log(unsigned int);
scalar_t__ pow(unsigned int, int /*<<< orphan*/);
unsigned int roundup_power(unsigned int n, unsigned int exp) {
  double l = log(n) / log(exp);
  return (unsigned int)pow(exp, ceil(l));
}


x86 assembly (clang, -O0):
<roundup_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <log@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <ceil@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1050 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roundup_power>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1040 <log@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1040 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1050 <pow@plt>

LLVM IR (-O0):
define i32 @roundup_power(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = call double @log(i32 %6)
%8 = load i32, i32* %4
%9 = call double @log(i32 %8)
%10 = fdiv double %7, %9
store double %10, double* %5
%11 = load i32, i32* %4
%12 = load double, double* %5
%13 = call i32 @ceil(double %12)
%14 = call i64 @pow(i32 %11, i32 %13)
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @roundup_power(i32 %0, i32 %1) {
%3 = tail call double @log(i32 %0)
%4 = tail call double @log(i32 %1)
%5 = fdiv double %3, %4
%6 = tail call i32 @ceil(double %5)
%7 = tail call i64 @pow(i32 %1, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}
void XCreateGC() {}


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

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

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

LLVM IR (-O2):
define void @XCreateGC() {
ret void
}
void nfs_fscache_init_cookie(struct inode *inode) {}


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define void @nfs_fscache_init_cookie(%struct.inode* nocapture %0) {
ret void
}
int alpha(char *stream, long offset) {
  char c = stream[offset];
  return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z');
}


x86 assembly (clang, -O0):
<alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     113d <alpha+0x3d>
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x12(%rbp)
jle    1166 <alpha+0x66>
movsbl -0x11(%rbp),%edx
xor    %eax,%eax
mov    $0x41,%ecx
cmp    %edx,%ecx
mov    %al,-0x13(%rbp)
jg     1160 <alpha+0x60>
movsbl -0x11(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alpha>:
mov    (%rdi,%rsi,1),%cl
and    $0xdf,%cl
add    $0xbf,%cl
xor    %eax,%eax
cmp    $0x1a,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @alpha(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 i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp sle i32 97, %11
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = icmp sle i32 %15, 122
br i1 %16, label %27, label %17
17: ; preds = %13, %2
%18 = load i8, i8* %5
%19 = sext i8 %18 to i32
%20 = icmp sle i32 65, %19
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp sle i32 %23, 90
br label %25
25: ; preds = %21, %17
%26 = phi i1 [ false, %17 ], [ %24, %21 ]
br label %27
27: ; preds = %25, %13
%28 = phi i1 [ true, %13 ], [ %26, %25 ]
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @alpha(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = load i8, i8* %3
%5 = and i8 %4, -33
%6 = add i8 %5, -65
%7 = icmp ult i8 %6, 26
%8 = zext i1 %7 to i32
ret i32 %8
}
int __fe_raise_inexact() { return 0; }


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

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

LLVM IR (-O0):
define i32 @__fe_raise_inexact() {
ret i32 0
}

LLVM IR (-O2):
define i32 @__fe_raise_inexact() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
void *udev_queue_get_failed_list_entry(void *udev_queue) {
  errno = ENOSYS;
  return NULL;
}


x86 assembly (clang, -O0):
<udev_queue_get_failed_list_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<udev_queue_get_failed_list_entry>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @udev_queue_get_failed_list_entry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @udev_queue_get_failed_list_entry(i8* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void report(char *label) {
  fprintf(stderr, "edparams: %s: %s\n", label, strerror(errno));
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"edparams: %s: %s\0A\00"
@errno = global i32 0
define void @report(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"edparams: %s: %s\0A\00"
@errno = global i32 0
define void @report(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StudentModel_modifyStudentSubjectGrade(char *, char *,
                                                          double);
void Controller_updateStudentSubjectGrade(char studentNumber[],
                                          char subjectName[],
                                          double subjectGrade) {
  StudentModel_modifyStudentSubjectGrade(studentNumber, subjectName,
                                         subjectGrade);
  return;
}


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

x86 assembly (clang, -O2):
<Controller_updateStudentSubjectGrade>:
jmp    1030 <StudentModel_modifyStudentSubjectGrade@plt>

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

LLVM IR (-O2):
define void @Controller_updateStudentSubjectGrade(i8* %0, i8* %1, double %2) {
%4 = tail call i32 @StudentModel_modifyStudentSubjectGrade(i8* %0, i8* %1, double %2)
ret void
}
/* Variables and functions */
float tanhf(float);
float r_tanh(float *x) { return (tanhf(*x)); }


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

x86 assembly (clang, -O2):
<r_tanh>:
movss  (%rdi),%xmm0
jmp    1030 <tanhf@plt>

LLVM IR (-O0):
define float @r_tanh(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @tanhf(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_tanh(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @tanhf(float %2)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_append();
int /*<<< orphan*/ test_append_n();
int /*<<< orphan*/ test_append_set();
int /*<<< orphan*/ test_appendf();
int /*<<< orphan*/ test_buffer();
int /*<<< orphan*/ test_clear();
int /*<<< orphan*/ test_new_delete();
int main(int argc, char const *argv[]) {
  test_new_delete();
  test_append();
  test_append_n();
  test_appendf();
  test_append_set();
  test_clear();
  test_buffer();
  printf("test ok\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <test_new_delete@plt>
mov    $0x0,%al
call   1090 <test_append@plt>
mov    $0x0,%al
call   1080 <test_append_n@plt>
mov    $0x0,%al
call   1040 <test_appendf@plt>
mov    $0x0,%al
call   1070 <test_append_set@plt>
mov    $0x0,%al
call   10a0 <test_clear@plt>
mov    $0x0,%al
call   1030 <test_buffer@plt>
lea    0xe32(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_new_delete@plt>
xor    %eax,%eax
call   1090 <test_append@plt>
xor    %eax,%eax
call   1080 <test_append_n@plt>
xor    %eax,%eax
call   1050 <test_appendf@plt>
xor    %eax,%eax
call   1070 <test_append_set@plt>
xor    %eax,%eax
call   10a0 <test_clear@plt>
xor    %eax,%eax
call   1040 <test_buffer@plt>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test ok\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_new_delete()
%7 = call i32 (...) @test_append()
%8 = call i32 (...) @test_append_n()
%9 = call i32 (...) @test_appendf()
%10 = call i32 (...) @test_append_set()
%11 = call i32 (...) @test_clear()
%12 = call i32 (...) @test_buffer()
%13 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"test ok\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_new_delete()
%4 = tail call i32 (...) @test_append()
%5 = tail call i32 (...) @test_append_n()
%6 = tail call i32 (...) @test_appendf()
%7 = tail call i32 (...) @test_append_set()
%8 = tail call i32 (...) @test_clear()
%9 = tail call i32 (...) @test_buffer()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ round_down_2power(unsigned long);
scalar_t__ round_up_2power(unsigned long);
long is_2power(unsigned long val) {
  return round_up_2power(val) == round_down_2power(val);
}


x86 assembly (clang, -O0):
<is_2power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <round_up_2power@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <round_down_2power@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_2power>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <round_up_2power@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <round_down_2power@plt>
xor    %ecx,%ecx
cmp    %rax,%r14
sete   %cl
mov    %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @is_2power(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @round_up_2power(i64 %3)
%5 = load i64, i64* %2
%6 = call i64 @round_down_2power(i64 %5)
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @is_2power(i64 %0) {
%2 = tail call i64 @round_up_2power(i64 %0)
%3 = tail call i64 @round_down_2power(i64 %0)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ b1(int, int);
void f5(void) {
  int a27 = 27, a28 = 28, a29 = 29, a30 = 30;
#pragma omp target data map(tofrom : a27, a28)
  {
#pragma omp target map(tofrom : a27)
    a27++;
#pragma omp parallel shared(a27, a28)
    {
#pragma omp critical
      {
#pragma omp target update to(a27)
#pragma omp target map(always, from : a28) private(a30)
        {
          a28++;
          a29++;
          a30 = a29;
        }
      }
#pragma omp barrier
      b1(a27, a28);
    }
  }
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1b,-0x4(%rbp)
movl   $0x1c,-0x8(%rbp)
movl   $0x1d,-0xc(%rbp)
movl   $0x1e,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <b1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    $0x1c,%edi
mov    $0x1d,%esi
jmp    1030 <b1@plt>

LLVM IR (-O0):
define void @f5() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 27, i32* %1
store i32 28, i32* %2
store i32 29, i32* %3
store i32 30, i32* %4
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 1
store i32 %6, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
store i32 %11, i32* %4
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @b1(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @f5() {
%1 = tail call i32 @b1(i32 28, i32 29)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void printf_log_func(int level, const char *msg) { printf("%s\n", msg); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @printf_log_func(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
struct timex {
  long constant;
};

/* Variables and functions */
void setter_tai(struct timex *txc, long v) { txc->constant = v; }


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

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

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

LLVM IR (-O2):
%struct.timex = type { i64 }
define void @setter_tai(%struct.timex* nocapture writeonly %0, i64 %1) {
%3 = getelementptr inbounds %struct.timex, %struct.timex* %0, i64 0, i32 0
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ printf(char *, char *);
char *solve(int);
void load(FILE *in) {
  int N;
  fscanf(in, "%d\n", &N);
  printf("%s\n", solve(N));
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <fscanf@plt>
mov    -0xc(%rbp),%edi
call   1030 <solve@plt>
mov    %rax,%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
push   %rax
lea    0xec8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1050 <fscanf@plt>
mov    0x4(%rsp),%edi
call   1030 <solve@plt>
lea    0xeb2(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @load(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i8* @solve(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @load(i32* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i8* @solve(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char, int, char const *);
void index__checkstring(const char *str) {
  int i;
  for (i = 0; str[i]; i++) {
    int ch = str[i];
    if (ch >= 128)
      fatal("Module index: bad character '%c'=0x%x - only 7-bit ASCII is "
            "supported:"
            "\n%s\n",
            (char)ch, (int)ch, str);
  }
}


x86 assembly (clang, -O0):
<index__checkstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     117d <index__checkstring+0x6d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x80,-0x10(%rbp)
jl     116a <index__checkstring+0x5a>
mov    -0x10(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xe9e(%rip),%rdi
movsbl %al,%esi
call   1030 <fatal@plt>
jmp    116f <index__checkstring+0x5f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <index__checkstring+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [75 x i8] c"Module index: bad character '%c'=0x%x - only 7-bit ASCII is supported:\0A%s\0A\00"
define void @index__checkstring(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %28, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %31
12: ; preds = %5
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = icmp sge i32 %19, 128
br i1 %20, label %21, label %27
21: ; preds = %12
%22 = load i32, i32* %4
%23 = trunc i32 %22 to i8
%24 = load i32, i32* %4
%25 = load i8*, i8** %2
%26 = call i32 @fatal(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str, i64 0, i64 0), i8 signext %23, i32 %24, i8* %25)
br label %27
27: ; preds = %21, %12
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %5
31: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @index__checkstring(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitanoperand(int, char *, int);
int /*<<< orphan*/ printf(char *);
void emitoneoperandl(void) {
  printf(" ");
  emitanoperand(1, "ds:dword ptr", 1);
}


x86 assembly (clang, -O0):
<emitoneoperandl>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edx
lea    0xec6(%rip),%rsi
mov    %edx,%edi
call   1040 <emitanoperand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emitoneoperandl>:
push   %rax
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0xece(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
pop    %rax
jmp    1040 <emitanoperand@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [13 x i8] c"ds:dword ptr\00"
define void @emitoneoperandl() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"ds:dword ptr\00"
define void @emitoneoperandl() {
%1 = tail call i32 @putchar(i32 32)
%2 = tail call i32 @emitanoperand(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}
int test_imm_52uint32_reg(unsigned int val) {
  return ((val) & (0x52 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_52uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x52,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_52uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 82
%5 = icmp ne i32 %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_52uint32_reg(i32 %0) {
%2 = and i32 %0, 82
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double floor(int);
scalar_t__ rand();
double random2d(double i, double j) {
  return i + floor((1 + j - i) * (double)rand() / (((double)RAND_MAX) + 1));
}


x86 assembly (clang, -O0):
<random2d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xebc(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
mov    0x2e79(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xe84(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random2d>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
addsd  0xece(%rip),%xmm1
subsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %eax,%eax
call   1040 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0x8(%rsp),%xmm0
mov    0x2e90(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
addsd  0xe98(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <floor@plt>
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @random2d(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 = fadd double 1.000000e+00, %6
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = call i64 (...) @rand()
%11 = sitofp i64 %10 to double
%12 = fmul double %9, %11
%13 = load i64, i64* @RAND_MAX
%14 = sitofp i64 %13 to double
%15 = fadd double %14, 1.000000e+00
%16 = fdiv double %12, %15
%17 = fptosi double %16 to i32
%18 = call double @floor(i32 %17)
%19 = fadd double %5, %18
ret double %19
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @random2d(double %0, double %1) {
%3 = fadd double %1, 1.000000e+00
%4 = fsub double %3, %0
%5 = tail call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = fmul double %4, %6
%8 = load i64, i64* @RAND_MAX
%9 = sitofp i64 %8 to double
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double %7, %10
%12 = fptosi double %11 to i32
%13 = tail call double @floor(i32 %12)
%14 = fadd double %13, %0
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello_c(void) { printf("Hello from C code!\n"); }


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

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

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

LLVM IR (-O2):
@str = [19 x i8] c"Hello from C code!\00"
define void @hello_c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pali(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m, n;
  scanf("%d", &n);
  do {
    m = pali(n);
    if (!m) {
      n++;
    }
  } while (m == 0);
  printf("%X", n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1040 <pali@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    116d <main+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1172 <main+0x42>
cmpl   $0x0,-0x8(%rbp)
je     114f <main+0x1f>
mov    -0xc(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
cs nopw 0x0(%rax,%rax,1)
call   1040 <pali@plt>
test   %eax,%eax
jne    1166 <main+0x36>
mov    0x4(%rsp),%edi
add    $0x1,%edi
mov    %edi,0x4(%rsp)
jmp    1150 <main+0x20>
mov    0x4(%rsp),%esi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%X\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 = call i32 @pali(i32 %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %0, %7
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
%10 = call i32 @pali(i32 %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %0
%13 = load i32, i32* %1
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ gmtime(int /*<<< orphan*/ const *);
size_t strftime(char *, int, char *, int /*<<< orphan*/);
size_t date2str(char *s, const time_t date) {
  return strftime(s, 8 + 1, "%Y%m%d", gmtime(&date));
}


x86 assembly (clang, -O0):
<date2str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <gmtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x9,%esi
lea    0xeae(%rip),%rdx
call   1030 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date2str>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1040 <gmtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    %eax,%ecx
call   1030 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%Y%m%d\00"
define i64 @date2str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @gmtime(i32* %4)
%7 = call i64 @strftime(i8* %5, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i64 %7
}

LLVM IR (-O2):
@.str = [7 x i8] c"%Y%m%d\00"
define i64 @date2str(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @gmtime(i32* %3)
%5 = call i64 @strftime(i8* %0, i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_fill_array_open_close(double *, int);
void fill_array_open_close(double array[], int size) {
  dsfmt_gv_fill_array_open_close(array, size);
}


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

x86 assembly (clang, -O2):
<fill_array_open_close>:
jmp    1030 <dsfmt_gv_fill_array_open_close@plt>

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

LLVM IR (-O2):
define void @fill_array_open_close(double* %0, i32 %1) {
%3 = tail call i32 @dsfmt_gv_fill_array_open_close(double* %0, i32 %1)
ret void
}
float square(float x) { return (float)x * x; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @square(float %0) {
%2 = fmul float %0, %0
ret float %2
}
void *fdGetBuffer(void) { return (void *)0x1000; }


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

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

LLVM IR (-O0):
define i8* @fdGetBuffer() {
ret i8* inttoptr (i64 4096 to i8*)
}

LLVM IR (-O2):
define i8* @fdGetBuffer() {
ret i8* inttoptr (i64 4096 to i8*)
}
/* Variables and functions */
unsigned short icrc(unsigned short, unsigned long, short, int);
int benchmark(void) {
  unsigned short i1, i2;
  unsigned long n;
  n = 40;
  i1 = icrc(0, n, (short)0, 1);
  i2 = icrc(i1, n + 2, (short)0, 1);
  (void)i2;
  return 0;
}


x86 assembly (clang, -O0):
<benchmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x28,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%edi
call   1030 <icrc@plt>
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x10(%rbp),%rsi
add    $0x2,%rsi
xor    %edx,%edx
mov    $0x1,%ecx
movzwl %ax,%edi
call   1030 <icrc@plt>
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark>:
push   %rax
mov    $0x28,%esi
xor    %edi,%edi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <icrc@plt>
movzwl %ax,%edi
mov    $0x2a,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <icrc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @benchmark() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i64
store i64 40, i64* %3
%4 = load i64, i64* %3
%5 = call zeroext i16 @icrc(i16 zeroext 0, i64 %4, i16 signext 0, i32 1)
store i16 %5, i16* %1
%6 = load i16, i16* %1
%7 = load i64, i64* %3
%8 = add i64 %7, 2
%9 = call zeroext i16 @icrc(i16 zeroext %6, i64 %8, i16 signext 0, i32 1)
store i16 %9, i16* %2
%10 = load i16, i16* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @benchmark() {
%1 = tail call zeroext i16 @icrc(i16 zeroext 0, i64 40, i16 signext 0, i32 1)
%2 = tail call zeroext i16 @icrc(i16 zeroext %1, i64 42, i16 signext 0, i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ tss_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ pthread_key_delete(int /*<<< orphan*/);
void tss_delete(tss_t key) { assert(pthread_key_delete(key) == 0); }


x86 assembly (clang, -O0):
<tss_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pthread_key_delete@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tss_delete>:
push   %rax
call   1030 <pthread_key_delete@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
define void @tss_delete(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @pthread_key_delete(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}

LLVM IR (-O2):
define void @tss_delete(i32 %0) {
%2 = tail call i64 @pthread_key_delete(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Variables and functions */
int fcntl(int, int, long);
int __fcntl(int fd, int cmd, long arg) { return fcntl(fd, cmd, arg); }


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

x86 assembly (clang, -O2):
<__fcntl>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @__fcntl(i32 %0, i32 %1, i64 %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
int read_msg(int, int /*<<< orphan*/ *);
ssize_t read_uint64(uint64_t *data) {
  ssize_t r;
  r = read_msg(sizeof(uint64_t), data);
  if (r != -1)
    *data = be64toh(*data);
  return r;
}


x86 assembly (clang, -O0):
<read_uint64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x4,%edi
call   1040 <read_msg@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     115a <read_uint64+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <be64toh@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint64>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x4,%edi
mov    %rbx,%rsi
call   1040 <read_msg@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1143 <read_uint64+0x23>
mov    (%rbx),%edi
call   1030 <be64toh@plt>
mov    %eax,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @read_uint64(i32* %0) {
%2 = tail call i32 @read_msg(i32 4, i32* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* %0
%6 = tail call i32 @be64toh(i32 %5)
store i32 %6, i32* %0
br label %7
7: ; preds = %4, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, int /*<<< orphan*/ *);
int main(void) {
  execl("/usr/lib/latch/system/latchPluginGUI.py", "latchPluginGUI.py", NULL);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"/usr/lib/latch/system/latchPluginGUI.py\00"
@.str.1 = [18 x i8] c"latchPluginGUI.py\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @execl(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"/usr/lib/latch/system/latchPluginGUI.py\00"
@.str.1 = [18 x i8] c"latchPluginGUI.py\00"
define i32 @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret i32 0
}
/* Variables and functions */
char const *dymosimResources2(int /*<<< orphan*/);
const char *dymosimResources() { return dymosimResources2(0); }


x86 assembly (clang, -O0):
<dymosimResources>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <dymosimResources2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dymosimResources>:
xor    %edi,%edi
jmp    1030 <dymosimResources2@plt>

LLVM IR (-O0):
define i8* @dymosimResources() {
%1 = call i8* @dymosimResources2(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @dymosimResources() {
%1 = tail call i8* @dymosimResources2(i32 0)
ret i8* %1
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t get_time() {
  uint64_t x[2];
  __asm__ volatile("rdtsc" : "=a"(x[0]), "=d"(x[1]));
  return x[0];
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %rax,-0x10(%rbp)
mov    %rdx,-0x8(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @get_time() {
%1 = alloca [2 x i8*]
%2 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
%4 = call { i8*, i8* } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%5 = extractvalue { i8*, i8* } %4, 0
%6 = extractvalue { i8*, i8* } %4, 1
store i8* %5, i8** %2
store i8* %6, i8** %3
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%8 = load i8*, i8** %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_time() {
%1 = tail call { i8*, i8* } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i8*, i8* } %1, 0
ret i8* %2
}
/* Variables and functions */
int get_vars(char const *);
int init(const char *str) { return get_vars(str); }


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

x86 assembly (clang, -O2):
<init>:
jmp    1030 <get_vars@plt>

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

LLVM IR (-O2):
define i32 @init(i8* %0) {
%2 = tail call i32 @get_vars(i8* %0)
ret i32 %2
}
/* Variables and functions */
int readl(int);
int /*<<< orphan*/ writel(unsigned char, int);
void oldland_serial_putc(char c) {
  if (c == '\n')
    oldland_serial_putc('\r');
  while (!(readl(0x80000000 + 0x4) & (1 << 0)))
    continue;
  writel((unsigned char)c, 0x80000000 + 0x0);
}


x86 assembly (clang, -O0):
<oldland_serial_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1155 <oldland_serial_putc+0x25>
mov    $0xd,%edi
call   1030 <oldland_serial_putc@plt>
jmp    115a <oldland_serial_putc+0x2a>
mov    $0x80000004,%edi
call   1040 <readl@plt>
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117c <oldland_serial_putc+0x4c>
jmp    1181 <oldland_serial_putc+0x51>
jmp    115a <oldland_serial_putc+0x2a>
mov    $0x80000000,%esi
movzbl -0x1(%rbp),%edi
call   1050 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oldland_serial_putc>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1150 <oldland_serial_putc+0x30>
nopl   0x0(%rax,%rax,1)
mov    $0x80000004,%edi
call   1030 <readl@plt>
test   $0x1,%al
je     1130 <oldland_serial_putc+0x10>
mov    $0xd,%edi
mov    $0x80000000,%esi
call   1040 <writel@plt>
nopl   (%rax)
mov    $0x80000004,%edi
call   1030 <readl@plt>
test   $0x1,%al
je     1150 <oldland_serial_putc+0x30>
movzbl %bl,%edi
mov    $0x80000000,%esi
pop    %rbx
jmp    1040 <writel@plt>

LLVM IR (-O0):
define void @oldland_serial_putc(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %1
br label %7
7: ; preds = %6, %1
br label %8
8: ; preds = %13, %7
%9 = call i32 @readl(i32 -2147483644)
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %8
br label %8
14: ; preds = %8
%15 = load i8, i8* %2
%16 = call i32 @writel(i8 zeroext %15, i32 -2147483648)
ret void
}

LLVM IR (-O2):
define void @oldland_serial_putc(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = tail call i32 @readl(i32 -2147483644)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = tail call i32 @writel(i8 zeroext 13, i32 -2147483648)
br label %9
9: ; preds = %7, %1
br label %10
10: ; preds = %9, %10
%11 = tail call i32 @readl(i32 -2147483644)
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %10, label %14
14: ; preds = %10
%15 = tail call i32 @writel(i8 zeroext %0, i32 -2147483648)
ret void
}
int mt_lbprof_enable(void) {}


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

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

LLVM IR (-O0):
define i32 @mt_lbprof_enable() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @mt_lbprof_enable() {
ret i32 undef
}
double divi(double a, double b) { return a / b; }


x86 assembly (clang, -O0):
<divi>:
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):
<divi>:
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @divi(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 @divi(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}