xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ execle(char *, char *, char *, char **);
int main(int argc, char *argv[]) {
  char *env[2] = {"MAIL=mmmmm", (char *)NULL};
  execle("./env", "env", (char *)NULL, env);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ce3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2ce0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rcx
lea    0xec4(%rip),%rdi
lea    0xebf(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <execle@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee5(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    %rsp,%rcx
xor    %edx,%edx
call   1030 <execle@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"MAIL=mmmmm\00"
@__const.main.env = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [6 x i8] c"./env\00"
@.str.2 = [4 x i8] c"env\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [2 x i8*]* %6 to i8*
%8 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 0
%9 = call i32 @execle(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* null, i8** %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"MAIL=mmmmm\00"
@__const.main.env = [2 x i8*] [i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i8* null]
@.str.1 = [6 x i8] c"./env\00"
@.str.2 = [4 x i8] c"env\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2 x i8*]
%4 = bitcast [2 x i8*]* %3 to i8*
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 0
%6 = call i32 @execle(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* null, i8** %5)
ret i32 0
}
/* Variables and functions */
int chdir(char *);
char *getenv(char *);
int /*<<< orphan*/ perror(char *);
void builtin_cd(int argc, char *argv[]) {
  char *dir = getenv("HOME");
  if (argc > 1) {
    dir = argv[1];
  }
  if (chdir(dir) == -1) {
    perror("PSH");
  }
}


x86 assembly (clang, -O0):
<builtin_cd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1165 <builtin_cd+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <chdir@plt>
cmp    $0xffffffff,%eax
jne    1183 <builtin_cd+0x53>
lea    0xe87(%rip),%rdi
call   1050 <perror@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_cd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x2,%ebp
jl     114d <builtin_cd+0x1d>
mov    0x8(%rbx),%rax
mov    %rax,%rdi
call   1040 <chdir@plt>
cmp    $0xffffffff,%eax
je     1161 <builtin_cd+0x31>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe9d(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [4 x i8] c"PSH\00"
define void @builtin_cd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %5
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
store i8* %12, i8** %5
br label %13
13: ; preds = %9, %2
%14 = load i8*, i8** %5
%15 = call i32 @chdir(i8* %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [4 x i8] c"PSH\00"
define void @builtin_cd(i32 %0, i8** nocapture %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
br label %8
8: ; preds = %5, %2
%9 = phi i8* [ %7, %5 ], [ %3, %2 ]
%10 = tail call i32 @chdir(i8* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
ret void
}
/* Variables and functions */
char tolower(char);
void lowercase(char *s) {
  while (*s) {
    *s = tolower(*s);
    ++s;
  }
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <lowercase+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lowercase+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lowercase+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lowercase+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int test_imm_1Fuint16_mem(unsigned short *val) {
  return ((*val) & (-0x1F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Fuint16_mem>:
movzwl (%rdi),%eax
test   $0xffe1,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -31
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ gen_im32(int);
int /*<<< orphan*/ gen_op_shl_cc(int, int /*<<< orphan*/);
void gen_op_shl_im_cc(int val, int shift) {
  gen_op_shl_cc(val, gen_im32(shift));
}


x86 assembly (clang, -O0):
<gen_op_shl_im_cc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <gen_im32@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <gen_op_shl_cc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_op_shl_im_cc>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <gen_im32@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <gen_op_shl_cc@plt>

LLVM IR (-O0):
define void @gen_op_shl_im_cc(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_im32(i32 %6)
%8 = call i32 @gen_op_shl_cc(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @gen_op_shl_im_cc(i32 %0, i32 %1) {
%3 = tail call i32 @gen_im32(i32 %1)
%4 = tail call i32 @gen_op_shl_cc(i32 %0, i32 %3)
ret void
}
void insl(unsigned short port, void *addr, unsigned long count) {
  asm volatile("rep ; ins"
               "l"
               : "=D"(addr), "=c"(count)
               : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<insl>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
rep insl (%dx),%es:(%rdi)
mov    %rdi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<insl>:
mov    %rdx,%rcx
mov    %edi,%edx
mov    %rsi,%rdi
rep insl (%dx),%es:(%rdi)
ret

LLVM IR (-O0):
define void @insl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = alloca i16
%5 = alloca i8*
%6 = alloca i64
store i16 %0, i16* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i16, i16* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call { i8*, i64 } asm sideeffect "rep ; insl", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %7, i8* %8, i64 %9)
%11 = extractvalue { i8*, i64 } %10, 0
%12 = extractvalue { i8*, i64 } %10, 1
store i8* %11, i8** %5
store i64 %12, i64* %6
ret void
}

LLVM IR (-O2):
define void @insl(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "rep ; insl", "={di},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
struct scanner_state {
  int dummy;
};

/* Variables and functions */
int add_digit(struct scanner_state *, char, int);
scalar_t__ isdigit(char);
int non_digit(struct scanner_state *);
int mode_dec_more(struct scanner_state *s, char c) {
  return isdigit(c) ? add_digit(s, c, 10) : non_digit(s);
}


x86 assembly (clang, -O0):
<mode_dec_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     116f <mode_dec_more+0x3f>
mov    -0x8(%rbp),%rdi
mov    $0xa,%edx
movsbl -0x9(%rbp),%esi
call   1050 <add_digit@plt>
mov    %eax,-0x10(%rbp)
jmp    117b <mode_dec_more+0x4b>
mov    -0x8(%rbp),%rdi
call   1040 <non_digit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_dec_more>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     115b <mode_dec_more+0x2b>
movsbl %bpl,%esi
mov    %rbx,%rdi
mov    $0xa,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <add_digit@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <non_digit@plt>

LLVM IR (-O0):
%struct.scanner_state = type { i32 }
define i32 @mode_dec_more(%struct.scanner_state* %0, i8 signext %1) {
%3 = alloca %struct.scanner_state*
%4 = alloca i8
store %struct.scanner_state* %0, %struct.scanner_state** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = call i64 @isdigit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load %struct.scanner_state*, %struct.scanner_state** %3
%10 = load i8, i8* %4
%11 = call i32 @add_digit(%struct.scanner_state* %9, i8 signext %10, i32 10)
br label %15
12: ; preds = %2
%13 = load %struct.scanner_state*, %struct.scanner_state** %3
%14 = call i32 @non_digit(%struct.scanner_state* %13)
br label %15
15: ; preds = %12, %8
%16 = phi i32 [ %11, %8 ], [ %14, %12 ]
ret i32 %16
}

LLVM IR (-O2):
%struct.scanner_state = type { i32 }
define i32 @mode_dec_more(%struct.scanner_state* %0, i8 signext %1) {
%3 = tail call i64 @isdigit(i8 signext %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @add_digit(%struct.scanner_state* %0, i8 signext %1, i32 10)
br label %9
7: ; preds = %2
%8 = tail call i32 @non_digit(%struct.scanner_state* %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
struct type {
  int dummy;
};
struct expression {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ constant_integer_int(int /*<<< orphan*/);
struct expression const *expr_constant(int /*<<< orphan*/);
int /*<<< orphan*/ type_size(struct type const *);
const struct expression *expr_sizeof_typename(const struct type *type) {
  return expr_constant(constant_integer_int(type_size(type)));
}


x86 assembly (clang, -O0):
<expr_sizeof_typename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <type_size@plt>
mov    %eax,%edi
call   1030 <constant_integer_int@plt>
mov    %eax,%edi
call   1050 <expr_constant@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expr_sizeof_typename>:
push   %rax
call   1040 <type_size@plt>
mov    %eax,%edi
call   1030 <constant_integer_int@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <expr_constant@plt>

LLVM IR (-O0):
%struct.expression = type { i32 }
%struct.type = type { i32 }
define %struct.expression* @expr_sizeof_typename(%struct.type* %0) {
%2 = alloca %struct.type*
store %struct.type* %0, %struct.type** %2
%3 = load %struct.type*, %struct.type** %2
%4 = call i32 @type_size(%struct.type* %3)
%5 = call i32 @constant_integer_int(i32 %4)
%6 = call %struct.expression* @expr_constant(i32 %5)
ret %struct.expression* %6
}

LLVM IR (-O2):
%struct.expression = type { i32 }
%struct.type = type { i32 }
define %struct.expression* @expr_sizeof_typename(%struct.type* %0) {
%2 = tail call i32 @type_size(%struct.type* %0)
%3 = tail call i32 @constant_integer_int(i32 %2)
%4 = tail call %struct.expression* @expr_constant(i32 %3)
ret %struct.expression* %4
}
/* Variables and functions */
int partition(double *, int, int);
void quickSort(double arr[], int low, int high) {
  if (low < high) {
    int pi = partition(arr, low, high);
    quickSort(arr, low, pi - 1);
    quickSort(arr, pi + 1, high);
  }
}


x86 assembly (clang, -O0):
<quickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quickSort(double* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(double* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quickSort(double* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef long long uint64_t;
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t Sleef_currentTimeMicros() {
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  return (uint64_t)tp.tv_sec * 1000000LL + ((uint64_t)tp.tv_nsec / 1000);
}


x86 assembly (clang, -O0):
<Sleef_currentTimeMicros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_currentTimeMicros>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0xf4240,0x10(%rsp),%rcx
movabs $0x20c49ba5e353f7cf,%rax
9b c4 20
imulq  0x8(%rsp)
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @Sleef_currentTimeMicros() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = sdiv i64 %8, 1000
%10 = add nsw i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @Sleef_currentTimeMicros() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = mul nsw i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = sdiv i64 %9, 1000
%11 = add nsw i64 %10, %7
ret i64 %11
}
/* Variables and functions */
long long crc64_partial(void const *, int, long long);
unsigned long long crc64(const void *data, int len) {
  return crc64_partial(data, len, -1LL) ^ -1LL;
}


x86 assembly (clang, -O0):
<crc64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xffffffffffffffff,%rdx
call   1030 <crc64_partial@plt>
xor    $0xffffffffffffffff,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc64>:
push   %rax
mov    $0xffffffffffffffff,%rdx
call   1030 <crc64_partial@plt>
not    %rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @crc64(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 = load i32, i32* %4
%7 = call i64 @crc64_partial(i8* %5, i32 %6, i64 -1)
%8 = xor i64 %7, -1
ret i64 %8
}

LLVM IR (-O2):
define i64 @crc64(i8* %0, i32 %1) {
%3 = tail call i64 @crc64_partial(i8* %0, i32 %1, i64 -1)
%4 = xor i64 %3, -1
ret i64 %4
}
void md_onsignal_default() {}


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

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

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

LLVM IR (-O2):
define void @md_onsignal_default() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stdio_helper_fake_printf(char *);
int strcmp(char const *, char const *);
void soru_6(const char s1[], const char s2[]) {
  int deger;
  deger = strcmp(s1, s2);
  if (deger == 0) {
    stdio_helper_fake_printf("esit");
  } else {
    stdio_helper_fake_printf("farkli");
  }
}


x86 assembly (clang, -O0):
<soru_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    115b <soru_6+0x3b>
lea    0xeaf(%rip),%rdi
call   1030 <stdio_helper_fake_printf@plt>
jmp    1167 <soru_6+0x47>
lea    0xea3(%rip),%rdi
call   1030 <stdio_helper_fake_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_6>:
push   %rax
call   1040 <strcmp@plt>
test   %eax,%eax
lea    0xed1(%rip),%rax
lea    0xecf(%rip),%rdi
cmove  %rax,%rdi
pop    %rax
jmp    1030 <stdio_helper_fake_printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"esit\00"
@.str.1 = [7 x i8] c"farkli\00"
define void @soru_6(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @strcmp(i8* %6, i8* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %15
13: ; preds = %2
%14 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"esit\00"
@.str.1 = [7 x i8] c"farkli\00"
define void @soru_6(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @stdio_helper_fake_printf(i8* %5)
ret void
}
R0RX1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ r0 = (p1[x1]); }


x86 assembly (clang, -O0):
<R0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @R0RX1(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*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32*, i32** %13
%15 = load i32, i32* %11
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
store i32 %18, i32* %8
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @R0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 undef
}
char *strcat(char *s1, const char *s2) {
  char *p = s1;
  while (*p != '\0')
    p++;
  while ((*p = *s2) != '\0') {
    p++;
    s2++;
  }
  return (s1);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <strcat+0x6f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113a <strcat+0x3a>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
mov    %dl,-0x1(%rcx)
test   %dl,%dl
je     1142 <strcat+0x42>
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rsi,%rdx,1),%edi
mov    %dil,(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1130 <strcat+0x30>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
store i8 %9, i8* %4
%10 = icmp eq i8 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %8, %11
%12 = phi i8* [ %14, %11 ], [ %4, %8 ]
%13 = phi i8* [ %15, %11 ], [ %1, %8 ]
%14 = getelementptr inbounds i8, i8* %12, i64 1
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = load i8, i8* %15
store i8 %16, i8* %14
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %11
18: ; preds = %11, %8
ret i8* %0
}
/* Type definitions */
struct v4l_fd {
  int dummy;
};
struct v4l2_format {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ VIDIOC_S_FMT;
int v4l_named_ioctl(struct v4l_fd *, char *, int /*<<< orphan*/,
                    struct v4l2_format *);
int v4l_s_fmt(struct v4l_fd *f, struct v4l2_format *fmt) {
  return v4l_named_ioctl(f, "VIDIOC_S_FMT", VIDIOC_S_FMT, fmt);
}


x86 assembly (clang, -O0):
<v4l_s_fmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <v4l_named_ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4l_s_fmt>:
mov    %rsi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edx
lea    0xedd(%rip),%rsi
jmp    1030 <v4l_named_ioctl@plt>

LLVM IR (-O0):
%struct.v4l_fd = type { i32 }
%struct.v4l2_format = type { i32 }
@.str = [13 x i8] c"VIDIOC_S_FMT\00"
@VIDIOC_S_FMT = global i32 0
define i32 @v4l_s_fmt(%struct.v4l_fd* %0, %struct.v4l2_format* %1) {
%3 = alloca %struct.v4l_fd*
%4 = alloca %struct.v4l2_format*
store %struct.v4l_fd* %0, %struct.v4l_fd** %3
store %struct.v4l2_format* %1, %struct.v4l2_format** %4
%5 = load %struct.v4l_fd*, %struct.v4l_fd** %3
%6 = load i32, i32* @VIDIOC_S_FMT
%7 = load %struct.v4l2_format*, %struct.v4l2_format** %4
%8 = call i32 @v4l_named_ioctl(%struct.v4l_fd* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, %struct.v4l2_format* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.v4l_fd = type { i32 }
%struct.v4l2_format = type { i32 }
@.str = [13 x i8] c"VIDIOC_S_FMT\00"
@VIDIOC_S_FMT = global i32 0
define i32 @v4l_s_fmt(%struct.v4l_fd* %0, %struct.v4l2_format* %1) {
%3 = load i32, i32* @VIDIOC_S_FMT
%4 = tail call i32 @v4l_named_ioctl(%struct.v4l_fd* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3, %struct.v4l2_format* %1)
ret i32 %4
}
/* Type definitions */
struct buf {
  int dummy;
};
typedef size_t caddr_t;

/* Variables and functions */
size_t buf_addr(struct buf *);
size_t buf_offset(struct buf *b, void *p) { return (caddr_t)p - buf_addr(b); }


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

x86 assembly (clang, -O2):
<buf_offset>:
push   %rbx
mov    %rsi,%rbx
call   1030 <buf_addr@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.buf = type { i32 }
define i64 @buf_offset(%struct.buf* %0, i8* %1) {
%3 = alloca %struct.buf*
%4 = alloca i8*
store %struct.buf* %0, %struct.buf** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = ptrtoint i8* %5 to i64
%7 = load %struct.buf*, %struct.buf** %3
%8 = call i64 @buf_addr(%struct.buf* %7)
%9 = sub i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.buf = type { i32 }
define i64 @buf_offset(%struct.buf* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i64 @buf_addr(%struct.buf* %0)
%5 = sub i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int unix_read(int, void *, int);
void read_buffer(void *buff, int len) {
  int fd = 0;
  fd = open("/proc/mlog", O_RDONLY);
  if (fd >= 0) {
    int ret;
    ret = unix_read(fd, buff, len);
    close(fd);
  }
}


x86 assembly (clang, -O0):
<read_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xeaa(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1182 <read_buffer+0x52>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <unix_read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_buffer>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1050 <open@plt>
test   %eax,%eax
js     116d <read_buffer+0x3d>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <unix_read@plt>
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <close@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"/proc/mlog\00"
@O_RDONLY = global i32 0
define void @read_buffer(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @unix_read(i32 %12, i8* %13, i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = call i32 @close(i32 %16)
br label %18
18: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"/proc/mlog\00"
@O_RDONLY = global i32 0
define void @read_buffer(i8* %0, i32 %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @unix_read(i32 %4, i8* %0, i32 %1)
%8 = tail call i32 @close(i32 %4)
br label %9
9: ; preds = %6, %2
ret void
}
void SV_Frame(int realmsec, int gamemsec) {}


x86 assembly (clang, -O0):
<SV_Frame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SV_Frame(i32 %0, i32 %1) {
ret void
}
void u_enable_interrupts(struct Jelly *jelly) {}


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

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

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

LLVM IR (-O2):
%struct.Jelly = type opaque
define void @u_enable_interrupts(%struct.Jelly* nocapture %0) {
ret void
}
long long bit43() { return 0x0000080000000000LL; }


x86 assembly (clang, -O0):
<bit43>:
push   %rbp
mov    %rsp,%rbp
movabs $0x80000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit43>:
movabs $0x80000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit43() {
ret i64 8796093022208
}

LLVM IR (-O2):
define i64 @bit43() {
ret i64 8796093022208
}
int mystrlen(char *t) {
  char *p;
  p = t;
  while (*p != '\0')
    ++p;
  return p - t;
}


x86 assembly (clang, -O0):
<mystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1131 <mystrlen+0x31>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <mystrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <mystrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
int _no_printf(const char *format, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_no_printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
void VrefBuffer_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @VrefBuffer_SaveConfig() {
ret void
}
/* Variables and functions */
int log(double);
int /*<<< orphan*/ printf(char *, double);
double logtwo_area(double x) {
  if (x <= 0)
    printf("%e\n", x);
  return ((double)(log(x) / log(2.0)));
}


x86 assembly (clang, -O0):
<logtwo_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     114c <logtwo_area+0x2c>
movsd  -0x8(%rbp),%xmm0
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
mov    %eax,-0xc(%rbp)
movsd  0xe9f(%rip),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logtwo_area>:
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
jb     1147 <logtwo_area+0x27>
lea    0xed2(%rip),%rdi
movsd  %xmm0,0x8(%rsp)
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
call   1040 <log@plt>
mov    %eax,%ebx
movsd  0xeaa(%rip),%xmm0
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%e\0A\00"
define double @logtwo_area(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ole double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %6)
br label %8
8: ; preds = %5, %1
%9 = load double, double* %2
%10 = call i32 @log(double %9)
%11 = call i32 @log(double 2.000000e+00)
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define double @logtwo_area(double %0) {
%2 = fcmp ugt double %0, 0.000000e+00
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @log(double %0)
%7 = tail call i32 @log(double 2.000000e+00)
%8 = sdiv i32 %6, %7
%9 = sitofp i32 %8 to double
ret double %9
}
/* Variables and functions */
int write(int, unsigned char *, int);
void write_char(int fd, unsigned char c) {
  int result;
  do {
    result = write(fd, &c, 1);
  } while (!result);
}


x86 assembly (clang, -O0):
<write_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1121 <write_char+0x11>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_char>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
test   %eax,%eax
je     1120 <write_char+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @write_char(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %3
%8 = call i32 @write(i32 %7, i8* %4, i32 1)
store i32 %8, i32* %5
br label %9
9: ; preds = %6
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %6, label %13
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @write_char(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
br label %4
4: ; preds = %4, %2
%5 = call i32 @write(i32 %0, i8* %3, i32 1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, int);
void print_constant(char *name, char *type, int value) {
  printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type,
         value);
}


x86 assembly (clang, -O0):
<print_constant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_constant>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [53 x i8] c"#define %s(task) *((%s *) &(((char *) (task))[%d]))\0A\00"
define void @print_constant(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ iDoRemoteFunc(unsigned char *, unsigned int, int);
char *malloc(int);
unsigned int sprintf(char *, char *, int, int);
void vRcTSFID_RUDLL_SetOverTime(int timeout) {
  unsigned int uiDataLen;
  char *psFunCall = malloc(100);
  uiDataLen = sprintf(psFunCall, "%u(%d)", 4103, timeout);
  iDoRemoteFunc((unsigned char *)psFunCall, uiDataLen, 1);
  free(psFunCall);
}


x86 assembly (clang, -O0):
<vRcTSFID_RUDLL_SetOverTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
lea    0xe99(%rip),%rsi
mov    $0x1007,%edx
call   1060 <sprintf@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1050 <iDoRemoteFunc@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vRcTSFID_RUDLL_SetOverTime>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x64,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xea7(%rip),%rsi
mov    %rax,%rdi
mov    $0x1007,%edx
mov    %ebp,%ecx
call   1060 <sprintf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1050 <iDoRemoteFunc@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%u(%d)\00"
define void @vRcTSFID_RUDLL_SetOverTime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %2
%5 = call i8* @malloc(i32 100)
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i32, i32* %2
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4103, i32 %7)
store i32 %8, i32* %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %3
%11 = call i32 @iDoRemoteFunc(i8* %9, i32 %10, i32 1)
%12 = load i8*, i8** %4
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%u(%d)\00"
define void @vRcTSFID_RUDLL_SetOverTime(i32 %0) {
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 4103, i32 %0)
%4 = tail call i32 @iDoRemoteFunc(i8* %2, i32 %3, i32 1)
%5 = tail call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cdiDecodeTime(int, int *, int *, int *);
int time_to_sec(int time) {
  int secofday;
  int hour, minute, second;
  cdiDecodeTime(time, &hour, &minute, &second);
  secofday = hour * 3600 + minute * 60 + second;
  return (secofday);
}


x86 assembly (clang, -O0):
<time_to_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1030 <cdiDecodeTime@plt>
imul   $0xe10,-0xc(%rbp),%eax
imul   $0x3c,-0x10(%rbp),%ecx
add    %ecx,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_sec>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <cdiDecodeTime@plt>
imul   $0xe10,0x14(%rsp),%ecx
imul   $0x3c,0x10(%rsp),%eax
add    %ecx,%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @time_to_sec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @cdiDecodeTime(i32 %7, i32* %4, i32* %5, i32* %6)
%9 = load i32, i32* %4
%10 = mul nsw i32 %9, 3600
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 60
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
store i32 %15, i32* %3
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @time_to_sec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @cdiDecodeTime(i32 %0, i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, 3600
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 60
%13 = add nsw i32 %12, %10
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}
int get_gopts(int argc, char **argv, struct err *e) {}


x86 assembly (clang, -O0):
<get_gopts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.err = type opaque
define i32 @get_gopts(i32 %0, i8** %1, %struct.err* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.err*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.err* %2, %struct.err** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.err = type opaque
define i32 @get_gopts(i32 %0, i8** nocapture readnone %1, %struct.err* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, int);
void ne_one_test(void **state) {
  assert_int_equal((((1ul) << 9) & ~0x0101010101010101ul), 0x200ul);
  assert_int_equal((((0x0102040810204080ul) << 9) & ~0x0101010101010101ul),
                   0x0408102040800000ul);
}


x86 assembly (clang, -O0):
<ne_one_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x200,%esi
mov    %esi,%edi
call   1030 <assert_int_equal@plt>
mov    $0x40800000,%esi
mov    %esi,%edi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_one_test>:
push   %rax
mov    $0x200,%edi
mov    $0x200,%esi
call   1030 <assert_int_equal@plt>
mov    $0x40800000,%edi
mov    $0x40800000,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @ne_one_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @assert_int_equal(i32 512, i32 512)
%4 = call i32 @assert_int_equal(i32 1082130432, i32 1082130432)
ret void
}

LLVM IR (-O2):
define void @ne_one_test(i8** nocapture readnone %0) {
%2 = tail call i32 @assert_int_equal(i32 512, i32 512)
%3 = tail call i32 @assert_int_equal(i32 1082130432, i32 1082130432)
ret void
}