xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ errno;
int execlp(char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void my_execlp() {
  if (execlp("ls", "ls", "-l", NULL) == -1) {
    fprintf(stderr, "error : %s\n", strerror(errno));
  }
}


x86 assembly (clang, -O0):
<my_execlp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rsi
lea    0xebd(%rip),%rdx
xor    %eax,%eax
mov    %eax,%ecx
mov    %rsi,%rdi
call   1040 <execlp@plt>
cmp    $0xffffffff,%eax
jne    1187 <my_execlp+0x57>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xe84(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_execlp>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xec4(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
call   1040 <execlp@plt>
cmp    $0xffffffff,%eax
je     1150 <my_execlp+0x20>
pop    %rbx
ret
mov    0x2e89(%rip),%rax
mov    (%rax),%ebx
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe98(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.2 = [12 x i8] c"error : %s\0A\00"
@errno = global i32 0
define void @my_execlp() {
%1 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ls\00"
@.str.1 = [3 x i8] c"-l\00"
@stderr = global i32 0
@.str.2 = [12 x i8] c"error : %s\0A\00"
@errno = global i32 0
define void @my_execlp() {
%1 = tail call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i8* @strerror(i32 %5)
%7 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %3, %0
ret void
}
void RTAvlrU64RemoveBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrU64RemoveBestFit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sock_sendline(char *, char *);
void ircproto_join(char *chan_name) { sock_sendline("JOIN %s", chan_name); }


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

x86 assembly (clang, -O2):
<ircproto_join>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <sock_sendline@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"JOIN %s\00"
define void @ircproto_join(i8* %0) {
%2 = tail call i32 @sock_sendline(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
double test(unsigned X) {
  double student_t[30] = {
      0.0,   12.706, 4.303, 3.182, 2.776, 2.571, 2.447, 2.365, 2.306, 2.262,
      2.228, 2.201,  2.179, 2.160, 2.145, 2.131, 2.120, 2.110, 2.101, 2.093,
      2.086, 2.080,  2.074, 2.069, 2.064, 2.060, 2.056, 2.052, 2.048, 2.045};
  return student_t[X];
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xed4(%rip),%rsi
mov    $0xf0,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
movsd  -0x100(%rbp,%rax,8),%xmm0
ff ff
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    %edi,%eax
lea    0xef7(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
ret

LLVM IR (-O0):
@__const.test.student_t = [30 x double] [double 0.000000e+00, double 1.270600e+01, double 4.303000e+00, double 3.182000e+00, double 2.776000e+00, double 2.571000e+00, double 2.447000e+00, double 2.365000e+00, double 2.306000e+00, double 2.262000e+00, double 2.228000e+00, double 2.201000e+00, double 2.179000e+00, double 2.160000e+00, double 2.145000e+00, double 2.131000e+00, double 2.120000e+00, double 2.110000e+00, double 2.101000e+00, double 2.093000e+00, double 2.086000e+00, double 2.080000e+00, double 2.074000e+00, double 2.069000e+00, double 2.064000e+00, double 2.060000e+00, double 2.056000e+00, double 2.052000e+00, double 2.048000e+00, double 2.045000e+00]
define double @test(i32 %0) {
%2 = alloca i32
%3 = alloca [30 x double]
store i32 %0, i32* %2
%4 = bitcast [30 x double]* %3 to i8*
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [30 x double], [30 x double]* %3, i64 0, i64 %6
%8 = load double, double* %7
ret double %8
}

LLVM IR (-O2):
@__const.test.student_t = [30 x double] [double 0.000000e+00, double 1.270600e+01, double 4.303000e+00, double 3.182000e+00, double 2.776000e+00, double 2.571000e+00, double 2.447000e+00, double 2.365000e+00, double 2.306000e+00, double 2.262000e+00, double 2.228000e+00, double 2.201000e+00, double 2.179000e+00, double 2.160000e+00, double 2.145000e+00, double 2.131000e+00, double 2.120000e+00, double 2.110000e+00, double 2.101000e+00, double 2.093000e+00, double 2.086000e+00, double 2.080000e+00, double 2.074000e+00, double 2.069000e+00, double 2.064000e+00, double 2.060000e+00, double 2.056000e+00, double 2.052000e+00, double 2.048000e+00, double 2.045000e+00]
define double @test(i32 %0) {
%2 = zext i32 %0 to i64
%3 = getelementptr inbounds [30 x double], [30 x double]* @__const.test.student_t, i64 0, i64 %2
%4 = load double, double* %3
ret double %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(const void *str, size_t n) {
  void *new = malloc(n);
  if (new)
    memcpy(new, str, n);
  return new;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <memdup+0x39>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1149 <memdup+0x29>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @memdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
br label %15
15: ; preds = %10, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memcpy(i8* %3, i8* %0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_ld32_kernel(int, int);
void gen_op_ldf32_kernel(int dest, int addr) { gen_op_ld32_kernel(dest, addr); }


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

x86 assembly (clang, -O2):
<gen_op_ldf32_kernel>:
jmp    1030 <gen_op_ld32_kernel@plt>

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

LLVM IR (-O2):
define void @gen_op_ldf32_kernel(i32 %0, i32 %1) {
%3 = tail call i32 @gen_op_ld32_kernel(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
size_t strnlen(char const *, size_t);
size_t strnlen_s(const char *str, size_t numberOfElements) {
  return strnlen(str, numberOfElements);
}


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

x86 assembly (clang, -O2):
<strnlen_s>:
jmp    1030 <strnlen@plt>

LLVM IR (-O0):
define i64 @strnlen_s(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 = load i64, i64* %4
%7 = call i64 @strnlen(i8* %5, i64 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @strnlen_s(i8* nocapture %0, i64 %1) {
%3 = tail call i64 @strnlen(i8* %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
char *strcpy(char *dst, const char *src) {
__ESBMC_HIDE:;
  size_t i;
  for (i = 0; src[i] != 0; i++)
    dst[i] = src[i];
  return dst;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <strcpy+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
int instr(const char *teststr, const char key) {
  while (*teststr)
    if (*teststr++ == key)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<instr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <instr+0x4a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1145 <instr+0x45>
movl   $0x1,-0x4(%rbp)
jmp    1151 <instr+0x51>
jmp    110e <instr+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr>:
movzbl (%rdi),%eax
test   %al,%al
je     1116 <instr+0x16>
add    $0x1,%rdi
cmp    %sil,%al
jne    1100 <instr>
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @instr(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, %1
br i1 %9, label %10, label %3
10: ; preds = %3, %7
%11 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
void usb_nop_xceiv_register(void) {}


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

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

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

LLVM IR (-O2):
define void @usb_nop_xceiv_register() {
ret void
}
/* Variables and functions */
int glutGetWindow();
int /*<<< orphan*/ printf(char *, int, int, int);
void dial(int dial, int value) {
  printf("dial %d %d (%d)\n", dial, value, glutGetWindow());
}


x86 assembly (clang, -O0):
<dial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <glutGetWindow@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    %eax,%ecx
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dial>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <glutGetWindow@plt>
lea    0xecb(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [17 x i8] c"dial %d %d (%d)\0A\00"
define void @dial(i32 %0, i32 %1) {
%3 = tail call i32 (...) @glutGetWindow()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpanel_fill(int, int, int, int, int);
void fill(int color, int x, int y, int w, int h) {
  gpanel_fill(color, x, y, x + w - 1, y + h - 1);
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    -0xc(%rbp),%r8d
add    -0x14(%rbp),%r8d
sub    $0x1,%r8d
call   1030 <gpanel_fill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
add    %esi,%ecx
add    $0xffffffff,%ecx
add    %edx,%r8d
add    $0xffffffff,%r8d
jmp    1030 <gpanel_fill@plt>

LLVM IR (-O0):
define void @fill(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %7
%15 = load i32, i32* %9
%16 = add nsw i32 %14, %15
%17 = sub nsw i32 %16, 1
%18 = load i32, i32* %8
%19 = load i32, i32* %10
%20 = add nsw i32 %18, %19
%21 = sub nsw i32 %20, 1
%22 = call i32 @gpanel_fill(i32 %11, i32 %12, i32 %13, i32 %17, i32 %21)
ret void
}

LLVM IR (-O2):
define void @fill(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add i32 %1, -1
%7 = add i32 %6, %3
%8 = add i32 %2, -1
%9 = add i32 %8, %4
%10 = tail call i32 @gpanel_fill(i32 %0, i32 %1, i32 %2, i32 %7, i32 %9)
ret void
}
int ins(int i, int pos, int *table) {
  *(table + pos) = i;
  return 0;
}


x86 assembly (clang, -O0):
<ins>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ins>:
movslq %esi,%rax
mov    %edi,(%rdx,%rax,4)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ins(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %2, i64 %4
store i32 %0, i32* %5
ret i32 0
}
/* Variables and functions */
float atanf(float);
float __glsl_atan(float x) { return atanf(x); }


x86 assembly (clang, -O0):
<__glsl_atan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <atanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glsl_atan>:
jmp    1030 <atanf@plt>

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

LLVM IR (-O2):
define float @__glsl_atan(float %0) {
%2 = tail call float @atanf(float %0)
ret float %2
}
void testClosureDFDrV(void (*closure)(double, float, double), double a1,
                      float a2, double a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureDFDrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureDFDrV>:
jmp    *%rdi

LLVM IR (-O0):
define void @testClosureDFDrV(void (double, float, double)* %0, double %1, float %2, double %3) {
%5 = alloca void (double, float, double)*
%6 = alloca double
%7 = alloca float
%8 = alloca double
store void (double, float, double)* %0, void (double, float, double)** %5
store double %1, double* %6
store float %2, float* %7
store double %3, double* %8
%9 = load void (double, float, double)*, void (double, float, double)** %5
%10 = load double, double* %6
%11 = load float, float* %7
%12 = load double, double* %8
ret void
}

LLVM IR (-O2):
define void @testClosureDFDrV(void (double, float, double)* nocapture %0, double %1, float %2, double %3) {
tail call void %0(double %1, float %2, double %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ u;

/* Variables and functions */
int /*<<< orphan*/ random_bytes(int /*<<< orphan*/ *, int);
uint64_t random_u64(void) {
  uint64_t u;
  random_bytes(&u, sizeof(u));
  return u;
}


x86 assembly (clang, -O0):
<random_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <random_bytes@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_u64>:
push   %rax
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <random_bytes@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_u64() {
%1 = alloca i32
%2 = call i32 @random_bytes(i32* %1, i32 4)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @random_u64() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @random_bytes(i32* %1, i32 4)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f1();
int /*<<< orphan*/ f2();
int /*<<< orphan*/ f3();
int main(void) {
  f1();
  f2();
  f3();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <f1@plt>
mov    $0x0,%al
call   1030 <f2@plt>
mov    $0x0,%al
call   1040 <f3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <f1@plt>
xor    %eax,%eax
call   1030 <f2@plt>
xor    %eax,%eax
call   1040 <f3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @f1()
%3 = call i32 (...) @f2()
%4 = call i32 (...) @f3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f1()
%2 = tail call i32 (...) @f2()
%3 = tail call i32 (...) @f3()
ret i32 0
}
/* Variables and functions */
unsigned long __arch_copy_to_user(void *, void const *, unsigned long);
unsigned long __copy_to_user(void *to, const void *from, unsigned long n) {
  return __arch_copy_to_user(to, from, n);
}


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

x86 assembly (clang, -O2):
<__copy_to_user>:
jmp    1030 <__arch_copy_to_user@plt>

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

LLVM IR (-O2):
define i64 @__copy_to_user(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @__arch_copy_to_user(i8* %0, i8* %1, i64 %2)
ret i64 %4
}
int setTransformationBit(int i, int *transformations) {
  *transformations = *transformations | (1 << (i - 1));
}


x86 assembly (clang, -O0):
<setTransformationBit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setTransformationBit>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,(%rsi)
ret

LLVM IR (-O0):
define i32 @setTransformationBit(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
%6 = load i32*, i32** %5
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = sub nsw i32 %8, 1
%10 = shl i32 1, %9
%11 = or i32 %7, %10
%12 = load i32*, i32** %5
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @setTransformationBit(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %0, -1
%5 = shl nuw i32 1, %4
%6 = or i32 %3, %5
store i32 %6, i32* %1
ret i32 undef
}
void XSharpTextExtentsSet(void *dpy, void *fontSet, const char *str,
                          void *overall_ink_return,
                          void *overall_logical_return) {}


x86 assembly (clang, -O0):
<XSharpTextExtentsSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @XSharpTextExtentsSet(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @XSharpTextExtentsSet(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
void *dlsym(void *, char const *);
void *IMPORT_FUNC(void *HANDLE, const char *func) {
  return dlsym(HANDLE, func);
}


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

x86 assembly (clang, -O2):
<IMPORT_FUNC>:
jmp    1030 <dlsym@plt>

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

LLVM IR (-O2):
define i8* @IMPORT_FUNC(i8* %0, i8* %1) {
%3 = tail call i8* @dlsym(i8* %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int read_input() {
  char buffer[512];
  printf("Buffer = %p\n", buffer);
  read(0, buffer, 600);
  return 0;
}


x86 assembly (clang, -O0):
<read_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x200(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x200(%rbp),%rsi
xor    %edi,%edi
mov    $0x258,%edx
call   1040 <read@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_input>:
push   %rbx
sub    $0x200,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x258,%edx
call   1040 <read@plt>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Buffer = %p\0A\00"
define i32 @read_input() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 600)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Buffer = %p\0A\00"
define i32 @read_input() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @read(i32 0, i8* %2, i32 600)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void or_eax_imm32(unsigned long imm32) {
  put8(0x0D);
  put32(imm32);
}


x86 assembly (clang, -O0):
<or_eax_imm32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xd,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%rdi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<or_eax_imm32>:
push   %rbx
mov    %rdi,%rbx
mov    $0xd,%edi
call   1030 <put8@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @or_eax_imm32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = call i32 @put8(i32 13)
%4 = load i64, i64* %2
%5 = call i32 @put32(i64 %4)
ret void
}

LLVM IR (-O2):
define void @or_eax_imm32(i64 %0) {
%2 = tail call i32 @put8(i32 13)
%3 = tail call i32 @put32(i64 %0)
ret void
}
int test_imm_FEint16_reg(short val) {
  return ((val) & (-0xFE << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FEint16_reg>:
test   $0xff02,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FEint16_reg(i16 signext %0) {
%2 = and i16 %0, -254
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ ksft_print_cnts();
int ksft_exit_xpass(void) {
  ksft_print_cnts();
  exit(3);
}


x86 assembly (clang, -O0):
<ksft_exit_xpass>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ksft_print_cnts@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ksft_exit_xpass>:
push   %rax
xor    %eax,%eax
call   1030 <ksft_print_cnts@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @ksft_exit_xpass() {
%1 = call i32 (...) @ksft_print_cnts()
%2 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
define i32 @ksft_exit_xpass() {
%1 = tail call i32 (...) @ksft_print_cnts()
%2 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int snprintf(char *, int, char *, unsigned char);
int STR_MODE(char *p, int n, unsigned char mode) {
  if (mode == 0)
    return 0;
  return snprintf(p, n, "mode:%d ", mode);
}


x86 assembly (clang, -O0):
<STR_MODE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %al,-0x15(%rbp)
movzbl -0x15(%rbp),%eax
cmp    $0x0,%eax
jne    113d <STR_MODE+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1157 <STR_MODE+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    0xeb5(%rip),%rdx
movzbl -0x15(%rbp),%ecx
call   1030 <snprintf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STR_MODE>:
test   %edx,%edx
je     1123 <STR_MODE+0x13>
movzbl %dl,%ecx
lea    0xee2(%rip),%rdx
jmp    1030 <snprintf@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"mode:%d \00"
define i32 @STR_MODE(i8* %0, i32 %1, i8 zeroext %2) {
%4 = icmp eq i8 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
br label %7
7: ; preds = %3, %5
%8 = phi i32 [ %6, %5 ], [ 0, %3 ]
ret i32 %8
}
int diffdate(int DN, int MN, int AN, int DH, int MH, int AH) {
  int born = DN + (MN * 30) + (AN * 12 * 30);
  int current = DH + (MH * 30) + (AH * 12 * 30);
  int result = current - born;
  return result;
}


x86 assembly (clang, -O0):
<diffdate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x1e,-0x8(%rbp),%ecx
add    %ecx,%eax
imul   $0xc,-0xc(%rbp),%ecx
imul   $0x1e,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
imul   $0x1e,-0x14(%rbp),%ecx
add    %ecx,%eax
imul   $0xc,-0x18(%rbp),%ecx
imul   $0x1e,%ecx,%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffdate>:
sub    %edx,%r9d
imul   $0x168,%r9d,%edx
sub    %esi,%r8d
mov    %r8d,%eax
shl    $0x5,%eax
sub    %r8d,%eax
sub    %r8d,%eax
sub    %edi,%ecx
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @diffdate(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = mul nsw i32 %17, 30
%19 = add nsw i32 %16, %18
%20 = load i32, i32* %9
%21 = mul nsw i32 %20, 12
%22 = mul nsw i32 %21, 30
%23 = add nsw i32 %19, %22
store i32 %23, i32* %13
%24 = load i32, i32* %10
%25 = load i32, i32* %11
%26 = mul nsw i32 %25, 30
%27 = add nsw i32 %24, %26
%28 = load i32, i32* %12
%29 = mul nsw i32 %28, 12
%30 = mul nsw i32 %29, 30
%31 = add nsw i32 %27, %30
store i32 %31, i32* %14
%32 = load i32, i32* %14
%33 = load i32, i32* %13
%34 = sub nsw i32 %32, %33
store i32 %34, i32* %15
%35 = load i32, i32* %15
ret i32 %35
}

LLVM IR (-O2):
define i32 @diffdate(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = sub i32 %5, %2
%8 = mul i32 %7, 360
%9 = sub i32 %4, %1
%10 = mul i32 %9, 30
%11 = sub i32 %3, %0
%12 = add i32 %11, %10
%13 = add i32 %12, %8
ret i32 %13
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
struct timespec tspecNewMs(long int msec) {
  long int sec = msec / 1000;
  long int nsec = (msec % 1000) * 1000000;
  struct timespec tspec = {.tv_sec = sec, .tv_nsec = nsec};
  return tspec;
}


x86 assembly (clang, -O0):
<tspecNewMs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x7,%rax
add    %rdx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
imul   %rcx
mov    -0x30(%rbp),%rax
mov    %rdx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x7,%rcx
add    %rdx,%rcx
imul   $0x3e8,%rcx,%rcx
sub    %rcx,%rax
imul   $0xf4240,%rax,%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tspecNewMs>:
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
imul   $0x3e8,%rax,%rcx
sub    %rcx,%rdi
imul   $0xf4240,%rdi,%rdx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @tspecNewMs(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
%6 = load i64, i64* %3
%7 = sdiv i64 %6, 1000
store i64 %7, i64* %4
%8 = load i64, i64* %3
%9 = srem i64 %8, 1000
%10 = mul nsw i64 %9, 1000000
store i64 %10, i64* %5
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
%12 = load i64, i64* %4
store i64 %12, i64* %11
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
%14 = load i64, i64* %5
store i64 %14, i64* %13
%15 = bitcast %struct.timespec* %2 to { i64, i64 }*
%16 = load { i64, i64 }, { i64, i64 }* %15
ret { i64, i64 } %16
}

LLVM IR (-O2):
define { i64, i64 } @tspecNewMs(i64 %0) {
%2 = sdiv i64 %0, 1000
%3 = srem i64 %0, 1000
%4 = mul nsw i64 %3, 1000000
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
__attribute__((always_)) void SCB_CleanDCache(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @ps_print_chord_line() {
ret void
}
int test_imm_39uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x39 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_39uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 57
%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_39uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 244813135872
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
unsigned long SysCtlGetNmiFlagStatus();
void SysCtlNmiFlgClrAll() {
  unsigned long ulMWRAllow;
  unsigned long ulNmis;
  ulMWRAllow = (*((volatile unsigned long *)(0x400FB980)));
  (*((volatile unsigned long *)(0x400FB980))) = 0xA5A5A5A5;
  ulNmis = SysCtlGetNmiFlagStatus();
  (*((volatile unsigned long *)(0x400FBA00 + 0x00000008))) =
      (ulNmis | 0x00000001);
  (*((volatile unsigned long *)(0x400FB980))) = ulMWRAllow;
}


x86 assembly (clang, -O0):
<SysCtlNmiFlgClrAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x400fb980,%eax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    $0x400fb980,%eax
mov    $0xa5a5a5a5,%ecx
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <SysCtlGetNmiFlagStatus@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
or     $0x1,%rcx
mov    $0x400fba08,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    $0x400fb980,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlNmiFlgClrAll>:
push   %rbx
mov    0x400fb980,%rbx
40
mov    $0xa5a5a5a5,%eax
mov    %rax,0x400fb980
40
xor    %eax,%eax
call   1030 <SysCtlGetNmiFlagStatus@plt>
or     $0x1,%rax
mov    %rax,0x400fba08
40
mov    %rbx,0x400fb980
40
pop    %rbx
ret

LLVM IR (-O0):
define void @SysCtlNmiFlgClrAll() {
%1 = alloca i64
%2 = alloca i64
%3 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store i64 %3, i64* %1
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%4 = call i64 (...) @SysCtlGetNmiFlagStatus()
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = or i64 %5, 1
store volatile i64 %6, i64* inttoptr (i64 1074772488 to i64*)
%7 = load i64, i64* %1
store volatile i64 %7, i64* inttoptr (i64 1074772352 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlNmiFlgClrAll() {
%1 = load volatile i64, i64* inttoptr (i64 1074772352 to i64*)
store volatile i64 2779096485, i64* inttoptr (i64 1074772352 to i64*)
%2 = tail call i64 (...) @SysCtlGetNmiFlagStatus()
%3 = or i64 %2, 1
store volatile i64 %3, i64* inttoptr (i64 1074772488 to i64*)
store volatile i64 %1, i64* inttoptr (i64 1074772352 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Open Source SW Project\n");
  printf("First GitHub Tranning\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Open Source SW Project\0A\00"
@.str.1 = [23 x i8] c"First GitHub Tranning\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [23 x i8] c"Open Source SW Project\00"
@str.2 = [22 x i8] c"First GitHub Tranning\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
int main() {
  if (3) {
    return 1;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ select(int /*<<< orphan*/, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          struct timeval *);
void srSleep(int iSeconds, int iuSeconds) {
  struct timeval tvSelectTimeout;
  tvSelectTimeout.tv_sec = iSeconds;
  tvSelectTimeout.tv_usec = iuSeconds;
  select(0, NULL, NULL, NULL, &tvSelectTimeout);
}


x86 assembly (clang, -O0):
<srSleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x10(%rbp),%r8
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <select@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srSleep>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%r8
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <select@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @srSleep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %4
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
store i32 %8, i32* %9
%10 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %5)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @srSleep(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i32 %1, i32* %6
%7 = call i32 @select(i32 0, i32* null, i32* null, i32* null, %struct.timeval* %3)
ret void
}
/* Variables and functions */
float __ocml_j1_f32(float);
float j1f(float x) { return __ocml_j1_f32(x); }


x86 assembly (clang, -O0):
<j1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__ocml_j1_f32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j1f>:
jmp    1030 <__ocml_j1_f32@plt>

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

LLVM IR (-O2):
define float @j1f(float %0) {
%2 = tail call float @__ocml_j1_f32(float %0)
ret float %2
}
void wrsz(int i, char *a) {
  short s;
  s = i;
  *a++ = s & 0xff;
  *a = (s >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<wrsz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
movswl -0x12(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrsz>:
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @wrsz(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i16
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = trunc i32 %6 to i16
store i16 %7, i16* %5
%8 = load i16, i16* %5
%9 = sext i16 %8 to i32
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
store i8 %11, i8* %12
%14 = load i16, i16* %5
%15 = sext i16 %14 to i32
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %4
store i8 %18, i8* %19
ret void
}

LLVM IR (-O2):
define void @wrsz(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
%4 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %3, i8* %1
%5 = lshr i32 %0, 8
%6 = trunc i32 %5 to i8
store i8 %6, i8* %4
ret void
}
void _aic_write32(unsigned long addr, unsigned long data) {
  *(volatile unsigned *)(addr) = data;
}


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

x86 assembly (clang, -O2):
<_aic_write32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @_aic_write32(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = inttoptr i64 %0 to i32*
store volatile i32 %3, i32* %4
ret void
}