xunge/DecIR huggingface dataset:
/* Variables and functions */
int pow(int, int);
int countDigit(int number) {
  int digitCounter;
  int divider;
  for (int i = 1;; i++) {
    divider = pow(10, i - 1);
    if ((number / divider) == 0) {
      return i - 1;
    } else {
      continue;
    }
  }
}


x86 assembly (clang, -O0):
<countDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
mov    $0xa,%edi
call   1030 <pow@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%eax
jne    1151 <countDigit+0x41>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    1156 <countDigit+0x46>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1122 <countDigit+0x12>

x86 assembly (clang, -O2):
<countDigit>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
test   %eax,%eax
jne    1120 <countDigit+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @countDigit(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %8, %2 ]
%4 = add nsw i32 %3, -1
%5 = tail call i32 @pow(i32 10, i32 %4)
%6 = sdiv i32 %0, %5
%7 = icmp eq i32 %6, 0
%8 = add nuw nsw i32 %3, 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, scalar_t__);
void fs_util_get_path(const char *base, const char *name, char *path) {
  char dir[1024];
  sprintf(dir, "%s/%s", base, name);
  strncpy(path, dir, strlen(dir) + 1);
}


x86 assembly (clang, -O0):
<fs_util_get_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x430,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xea3(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x430(%rbp)
lea    -0x420(%rbp),%rax
mov    %rax,-0x428(%rbp)
lea    -0x420(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x430(%rbp),%rdi
mov    -0x428(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <strncpy@plt>
add    $0x430,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_util_get_path>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdx,%r14
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xeb6(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strncpy@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
define void @fs_util_get_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [1024 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i8*, i8** %6
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%15 = call i64 @strlen(i8* %14)
%16 = add nsw i64 %15, 1
%17 = call i32 @strncpy(i8* %12, i8* %13, i64 %16)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
define void @fs_util_get_path(i8* %0, i8* %1, i8* %2) {
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%7 = call i64 @strlen(i8* %5)
%8 = add nsw i64 %7, 1
%9 = call i32 @strncpy(i8* %2, i8* %5, i64 %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int is_big_endian(void) {
  union {
    uint32_t i;
    char c[4];
  } bint = {0x01020304};
  return bint.c[0] == 1;
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
mov    0xef6(%rip),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x8(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
@__const.is_big_endian.bint = %union.anon { i32 16909060 }
define i32 @is_big_endian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i8*
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
char *ttyname(int fildes) {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  return "";
}


x86 assembly (clang, -O0):
<ttyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xedc(%rip),%rsi
lea    0xee7(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
lea    0xed8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ttyname>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
lea    0xee2(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.ttyname = [8 x i8] c"ttyname\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @ttyname(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.ttyname, i64 0, i64 0))
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.ttyname = [8 x i8] c"ttyname\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @ttyname(i32 %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @__FUNCTION__.ttyname, i64 0, i64 0))
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
}
int __GLOBAL_init_789(int a) { return a * a; }


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

x86 assembly (clang, -O2):
<__GLOBAL_init_789>:
mov    %edi,%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @__GLOBAL_init_789(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @__GLOBAL_init_789(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
struct plugin {
  int dummy;
};
struct command {
  int dummy;
};

/* Variables and functions */
int disconnect(char const *, int, char **);
int disconnect_cmd(int argc, char **argv, struct command *command,
                   struct plugin *plugin) {
  const char *desc = "Disconnect from NVMeoF subsystem";
  return disconnect(desc, argc, argv);
}


x86 assembly (clang, -O0):
<disconnect_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <disconnect@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconnect_cmd>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <disconnect@plt>

LLVM IR (-O0):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [33 x i8] c"Disconnect from NVMeoF subsystem\00"
define i32 @disconnect_cmd(i32 %0, i8** %1, %struct.command* %2, %struct.plugin* %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca %struct.command*
%8 = alloca %struct.plugin*
%9 = alloca i8*
store i32 %0, i32* %5
store i8** %1, i8*** %6
store %struct.command* %2, %struct.command** %7
store %struct.plugin* %3, %struct.plugin** %8
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8** %9
%10 = load i8*, i8** %9
%11 = load i32, i32* %5
%12 = load i8**, i8*** %6
%13 = call i32 @disconnect(i8* %10, i32 %11, i8** %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.command = type { i32 }
%struct.plugin = type { i32 }
@.str = [33 x i8] c"Disconnect from NVMeoF subsystem\00"
define i32 @disconnect_cmd(i32 %0, i8** %1, %struct.command* nocapture readnone %2, %struct.plugin* nocapture readnone %3) {
%5 = tail call i32 @disconnect(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 %5
}
void invalid_opcode_handler(struct exception_info *info) {
  asm volatile("" : : :);
  asm volatile("hlt");
}


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

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

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

LLVM IR (-O2):
%struct.exception_info = type opaque
define void @invalid_opcode_handler(%struct.exception_info* nocapture readnone %0) {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ProcessInput(long long);
void ProcessAllInputs(long long int numberOfInputs) {
  long long int i = 0;
  for (i = 0; i < numberOfInputs; i++) {
    ProcessInput(i);
  }
}


x86 assembly (clang, -O0):
<ProcessAllInputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jge    1154 <ProcessAllInputs+0x44>
mov    -0x10(%rbp),%rdi
call   1030 <ProcessInput@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112c <ProcessAllInputs+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcessAllInputs>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
jle    1131 <ProcessAllInputs+0x21>
mov    %rdi,%r14
xor    %ebx,%ebx
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <ProcessInput@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1120 <ProcessAllInputs+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @ProcessAllInputs(i64 %0) {
%2 = icmp sgt i64 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @ProcessInput(i64 %4)
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
scalar_t__ board_is_bone_lt();
int /*<<< orphan*/ board_ti_get_rev();
int /*<<< orphan*/ strncmp(int /*<<< orphan*/, char *, int);
int board_is_bbg1(void) {
  return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
}


x86 assembly (clang, -O0):
<board_is_bbg1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <board_is_bone_lt@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
je     1176 <board_is_bbg1+0x46>
mov    $0x0,%al
call   1040 <board_ti_get_rev@plt>
mov    %eax,%edi
lea    0xe9f(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_is_bbg1>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <board_is_bone_lt@plt>
test   %rax,%rax
je     1160 <board_is_bbg1+0x30>
xor    %eax,%eax
call   1040 <board_ti_get_rev@plt>
lea    0xeb3(%rip),%rsi
mov    %eax,%edi
mov    $0x4,%edx
call   1030 <strncmp@plt>
xor    %ebx,%ebx
test   %eax,%eax
sete   %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"BBG1\00"
define i32 @board_is_bbg1() {
%1 = call i64 (...) @board_is_bone_lt()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = call i32 (...) @board_ti_get_rev()
%5 = call i32 @strncmp(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br label %8
8: ; preds = %3, %0
%9 = phi i1 [ false, %0 ], [ %7, %3 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [5 x i8] c"BBG1\00"
define i32 @board_is_bbg1() {
%1 = tail call i64 (...) @board_is_bone_lt()
%2 = icmp eq i64 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 (...) @board_ti_get_rev()
%5 = tail call i32 @strncmp(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ 0, %0 ], [ %7, %3 ]
ret i32 %9
}
int lib_mod_end(struct mod *mod) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mod = type opaque
define i32 @lib_mod_end(%struct.mod* nocapture readnone %0) {
ret i32 0
}
unsigned xrop3_129_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk1 = S ^ T;
  stk2 = D ^ S;
  stk1 = stk1 | stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_129_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_129_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
xor    %eax,%ecx
xor    $0xff,%eax
or     %ecx,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_129_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = xor i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = xor i32 %31, -1
store i32 %32, i32* %8
%33 = load i32, i32* %8
ret i32 %33
}

LLVM IR (-O2):
define i32 @xrop3_129_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, %4
%8 = xor i32 %4, 255
%9 = or i32 %7, %8
%10 = xor i32 %9, -1
ret i32 %10
}
double mpi_time(void) { return 0; }


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

x86 assembly (clang, -O2):
<mpi_time>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @mpi_time() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @mpi_time() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ _heapshrink();
int /*<<< orphan*/ free(unsigned int *);
int /*<<< orphan*/ judas_memunlock(unsigned int *, unsigned int);
void locked_free(void *address) {
  unsigned *block;
  if (!address)
    return;
  block = (unsigned *)address - 1;
  judas_memunlock(block + 1, *block);
  free(block);
  _heapshrink();
}


x86 assembly (clang, -O0):
<locked_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <locked_free+0x1c>
jmp    117b <locked_free+0x4b>
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1050 <judas_memunlock@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <_heapshrink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<locked_free>:
test   %rdi,%rdi
je     1152 <locked_free+0x22>
push   %rbx
lea    -0x4(%rdi),%rbx
mov    -0x4(%rdi),%esi
call   1050 <judas_memunlock@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <_heapshrink@plt>
ret

LLVM IR (-O0):
define void @locked_free(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
br label %19
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = getelementptr inbounds i32, i32* %9, i64 -1
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = call i32 @judas_memunlock(i32* %12, i32 %14)
%16 = load i32*, i32** %3
%17 = call i32 @free(i32* %16)
%18 = call i32 (...) @_heapshrink()
br label %19
19: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @locked_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = getelementptr inbounds i8, i8* %0, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = bitcast i8* %0 to i32*
%7 = load i32, i32* %5
%8 = tail call i32 @judas_memunlock(i32* %6, i32 %7)
%9 = tail call i32 @free(i32* %5)
%10 = tail call i32 (...) @_heapshrink()
br label %11
11: ; preds = %1, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ MC_avg2_16(int, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *, int, int, int);
void MC_avg_x_16_3dnow(uint8_t *dest, const uint8_t *ref, int stride,
                       int height) {
  MC_avg2_16(height, dest, ref, stride, 1, 1);
}


x86 assembly (clang, -O0):
<MC_avg_x_16_3dnow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <MC_avg2_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MC_avg_x_16_3dnow>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %ecx,%edi
mov    %eax,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <MC_avg2_16@plt>

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

LLVM IR (-O2):
define void @MC_avg_x_16_3dnow(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @MC_avg2_16(i32 %3, i32* %0, i32* %1, i32 %2, i32 1, i32 1)
ret void
}
/* Variables and functions */
scalar_t__ low_popd();
int low_pushd();
int low_topd(void) {
  if (low_popd())
    return low_pushd();
  else
    return 0;
}


x86 assembly (clang, -O0):
<low_topd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <low_popd@plt>
cmp    $0x0,%rax
je     1148 <low_topd+0x28>
mov    $0x0,%al
call   1030 <low_pushd@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <low_topd+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<low_topd>:
push   %rax
xor    %eax,%eax
call   1040 <low_popd@plt>
test   %rax,%rax
je     1135 <low_topd+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1030 <low_pushd@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @low_topd() {
%1 = alloca i32
%2 = call i64 (...) @low_popd()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @low_pushd()
store i32 %5, i32* %1
br label %7
6: ; preds = %0
store i32 0, i32* %1
br label %7
7: ; preds = %6, %4
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @low_topd() {
%1 = tail call i64 (...) @low_popd()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @low_pushd()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ 0, %0 ]
ret i32 %6
}
/* Variables and functions */
int atoi(char const *);
char *om_sysfs_readfile(char *);
int om_wifi_keep_bus_on_in_suspend_get() {
  const char *val = om_sysfs_readfile("/sys/module/s3cmci/parameters/persist");
  if (val == NULL)
    return -1;
  return atoi(val);
}


x86 assembly (clang, -O0):
<om_wifi_keep_bus_on_in_suspend_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <om_sysfs_readfile@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114f <om_wifi_keep_bus_on_in_suspend_get+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <om_wifi_keep_bus_on_in_suspend_get+0x3b>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_wifi_keep_bus_on_in_suspend_get>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <om_sysfs_readfile@plt>
test   %rax,%rax
je     113b <om_wifi_keep_bus_on_in_suspend_get+0x1b>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atoi@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"/sys/module/s3cmci/parameters/persist\00"
define i32 @om_wifi_keep_bus_on_in_suspend_get() {
%1 = alloca i32
%2 = alloca i8*
%3 = call i8* @om_sysfs_readfile(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 -1, i32* %1
br label %10
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @atoi(i8* %8)
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [38 x i8] c"/sys/module/s3cmci/parameters/persist\00"
define i32 @om_wifi_keep_bus_on_in_suspend_get() {
%1 = tail call i8* @om_sysfs_readfile(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @atoi(i8* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ -1, %0 ]
ret i32 %6
}
int fun1119() { return 1119; }


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

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

LLVM IR (-O0):
define i32 @fun1119() {
ret i32 1119
}

LLVM IR (-O2):
define i32 @fun1119() {
ret i32 1119
}
unsigned char index_ascii(unsigned char c) { return c + 32; }


x86 assembly (clang, -O0):
<index_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_ascii>:
lea    0x20(%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i8 @index_ascii(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = add nsw i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @index_ascii(i8 zeroext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_api_routines;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int spatialdb_init(int /*<<< orphan*/ *, char const **,
                   int /*<<< orphan*/ const *, int /*<<< orphan*/);
int /*<<< orphan*/ spatialdb_spatialite3_schema();
int sqlite3_gpkg_spl3_init(sqlite3 *db, const char **pzErrMsg,
                           const sqlite3_api_routines *pThunk) {
  return spatialdb_init(db, pzErrMsg, pThunk, spatialdb_spatialite3_schema());
}


x86 assembly (clang, -O0):
<sqlite3_gpkg_spl3_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1040 <spatialdb_spatialite3_schema@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
call   1030 <spatialdb_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqlite3_gpkg_spl3_init>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <spatialdb_spatialite3_schema@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <spatialdb_init@plt>

LLVM IR (-O0):
define i32 @sqlite3_gpkg_spl3_init(i32* %0, i8** %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32*
store i32* %0, i32** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i8**, i8*** %5
%9 = load i32*, i32** %6
%10 = call i32 (...) @spatialdb_spatialite3_schema()
%11 = call i32 @spatialdb_init(i32* %7, i8** %8, i32* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @sqlite3_gpkg_spl3_init(i32* %0, i8** %1, i32* %2) {
%4 = tail call i32 (...) @spatialdb_spatialite3_schema()
%5 = tail call i32 @spatialdb_init(i32* %0, i8** %1, i32* %2, i32 %4)
ret i32 %5
}
void DBGFR3LogModifyGroups(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3LogModifyGroups() {
ret void
}
char *valloc(i)
int i;
{
  int valsiz = getpagesize(), j;
  char *cp = malloc(i + (valsiz - 1));
  j = ((int)cp + (valsiz - 1)) & ~(valsiz - 1);
  return ((char *)j);
}


x86 assembly (clang, -O0):
<valloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getpagesize@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
movslq %eax,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<valloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
xor    %eax,%eax
call   1040 <getpagesize@plt>
mov    %eax,%ebx
lea    (%rbx,%r14,1),%eax
add    $0xffffffff,%eax
movslq %eax,%rdi
call   1030 <malloc@plt>
add    %ebx,%eax
add    $0xffffffff,%eax
neg    %ebx
and    %eax,%ebx
movslq %ebx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @valloc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %2
%6 = call i32 (...) @getpagesize()
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = add nsw i32 %7, %9
%11 = sext i32 %10 to i64
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = ptrtoint i8* %13 to i32
%15 = load i32, i32* %3
%16 = sub nsw i32 %15, 1
%17 = add nsw i32 %14, %16
%18 = load i32, i32* %3
%19 = sub nsw i32 %18, 1
%20 = xor i32 %19, -1
%21 = and i32 %17, %20
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i8*
ret i8* %24
}

LLVM IR (-O2):
define i8* @valloc(i32 %0) {
%2 = tail call i32 (...) @getpagesize()
%3 = add nsw i32 %2, -1
%4 = add nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = tail call i8* @malloc(i64 %5)
%7 = ptrtoint i8* %6 to i64
%8 = trunc i64 %7 to i32
%9 = add nsw i32 %3, %8
%10 = sub i32 0, %2
%11 = and i32 %9, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}
void gtk_tree_sortable_has_default_sort_func() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_sortable_has_default_sort_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_empty();
char pop();
int /*<<< orphan*/ push(char);
int /*<<< orphan*/ putchar(char);
int main() {
  push('a');
  push('b');
  push('n');
  while (!is_empty()) {
    putchar(pop());
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x61,%edi
call   1060 <push@plt>
mov    $0x62,%edi
call   1060 <push@plt>
mov    $0x6e,%edi
call   1060 <push@plt>
mov    $0x0,%al
call   1040 <is_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1189 <main+0x49>
jmp    119d <main+0x5d>
mov    $0x0,%al
call   1050 <pop@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    116d <main+0x2d>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1060 <push@plt>
mov    $0x62,%edi
call   1060 <push@plt>
mov    $0x6e,%edi
call   1060 <push@plt>
nop
xor    %eax,%eax
call   1040 <is_empty@plt>
test   %eax,%eax
jne    117c <main+0x3c>
xor    %eax,%eax
call   1050 <pop@plt>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1160 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @push(i8 signext 97)
%3 = call i32 @push(i8 signext 98)
%4 = call i32 @push(i8 signext 110)
br label %5
5: ; preds = %9, %0
%6 = call i32 (...) @is_empty()
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = call signext i8 (...) @pop()
%11 = call i32 @putchar(i8 signext %10)
br label %5
12: ; preds = %5
%13 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @push(i8 signext 97)
%2 = tail call i32 @push(i8 signext 98)
%3 = tail call i32 @push(i8 signext 110)
%4 = tail call i32 (...) @is_empty()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %0, %6
%7 = tail call signext i8 (...) @pop()
%8 = tail call i32 @putchar(i8 signext %7)
%9 = tail call i32 (...) @is_empty()
%10 = icmp eq i32 %9, 0
br i1 %10, label %6, label %11
11: ; preds = %6, %0
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
void ExchangeChar(char *str, int p1, int p2) {
  char temp;
  temp = str[p1];
  str[p1] = str[p2];
  str[p2] = temp;
}


x86 assembly (clang, -O0):
<ExchangeChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExchangeChar>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

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

LLVM IR (-O2):
define void @ExchangeChar(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ merge(int *, int, int, int);
void _merge_sort(int nums[], int l, int r) {
  if (l < r) {
    int m = (l + r) / 2;
    _merge_sort(nums, l, m);
    _merge_sort(nums, m + 1, r);
    merge(nums, l, m, r);
  }
}


x86 assembly (clang, -O0):
<_merge_sort>:
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    1182 <_merge_sort+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <_merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <_merge_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <merge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_merge_sort>:
cmp    %edx,%esi
jge    1172 <_merge_sort+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <_merge_sort@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <_merge_sort@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <merge@plt>
ret

LLVM IR (-O0):
define void @_merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %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 %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @merge(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @_merge_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @_merge_sort(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @_merge_sort(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @merge(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
char *strstr(const char *str1, const char *str2) {
  (void)str1;
  (void)str2;
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @strstr(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
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strstr(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
double fflop(int mx, int my, int mz) {
  return ((double)(mz - 2) * (double)(my - 2) * (double)(mx - 2) * 32.0);
}


x86 assembly (clang, -O0):
<fflop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm0
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fflop>:
add    $0xfffffffe,%edx
cvtsi2sd %edx,%xmm1
add    $0xfffffffe,%esi
cvtsi2sd %esi,%xmm2
add    $0xfffffffe,%edi
cvtsi2sd %edi,%xmm0
mulsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
mulsd  0xedb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fflop(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* %6
%8 = sub nsw i32 %7, 2
%9 = sitofp i32 %8 to double
%10 = load i32, i32* %5
%11 = sub nsw i32 %10, 2
%12 = sitofp i32 %11 to double
%13 = fmul double %9, %12
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 2
%16 = sitofp i32 %15 to double
%17 = fmul double %13, %16
%18 = fmul double %17, 3.200000e+01
ret double %18
}

LLVM IR (-O2):
define double @fflop(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -2
%5 = sitofp i32 %4 to double
%6 = add nsw i32 %1, -2
%7 = sitofp i32 %6 to double
%8 = fmul double %7, %5
%9 = add nsw i32 %0, -2
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
%12 = fmul double %11, 3.200000e+01
ret double %12
}
/* Variables and functions */
int strlen(char *);
int getMin(char *s1, char *s2) {
  int l1, l2;
  l1 = strlen(s1);
  l2 = strlen(s2);
  return (l1 < l2 ? l1 : l2);
}


x86 assembly (clang, -O0):
<getMin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    114f <getMin+0x3f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1155 <getMin+0x45>
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMin>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %eax,%ebp
cmovl  %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getMin(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %2
%15 = load i32, i32* %5
br label %18
16: ; preds = %2
%17 = load i32, i32* %6
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @getMin(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %3, %4
%6 = select i1 %5, i32 %3, i32 %4
ret i32 %6
}
int termios_tcflowoni(int fd) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @termios_tcflowoni(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
UsageExit() {
  printf("Usage: MKDLG (file | @file-list) out-file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<UsageExit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<UsageExit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: MKDLG (file | @file-list) out-file\0A\00"
define i32 @UsageExit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [42 x i8] c"Usage: MKDLG (file | @file-list) out-file\00"
define i32 @UsageExit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int POP();
int /*<<< orphan*/ PUSH(int);
void mul(void) { PUSH(POP() * POP()); }


x86 assembly (clang, -O0):
<mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <POP@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <POP@plt>
mov    -0x4(%rbp),%edi
imul   %eax,%edi
call   1040 <PUSH@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul>:
push   %rbx
xor    %eax,%eax
call   1030 <POP@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <POP@plt>
imul   %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <PUSH@plt>

LLVM IR (-O0):
define void @mul() {
%1 = call i32 (...) @POP()
%2 = call i32 (...) @POP()
%3 = mul nsw i32 %1, %2
%4 = call i32 @PUSH(i32 %3)
ret void
}

LLVM IR (-O2):
define void @mul() {
%1 = tail call i32 (...) @POP()
%2 = tail call i32 (...) @POP()
%3 = mul nsw i32 %2, %1
%4 = tail call i32 @PUSH(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void bpf_semi_rand_init(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<bpf_semi_rand_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_semi_rand_init>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @bpf_semi_rand_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @bpf_semi_rand_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fs_fnwrite(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int fs_fwrite(FILE *file, const char *buffer) {
  return fs_fnwrite(file, buffer, strlen(buffer));
}


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

x86 assembly (clang, -O2):
<fs_fwrite>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fs_fnwrite@plt>

LLVM IR (-O0):
define i32 @fs_fwrite(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @fs_fnwrite(i32* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fs_fwrite(i32* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @fs_fnwrite(i32* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ outw_p(int, int);
void to_gps(int add, int data) {
  outw_p(add, 0x304);
  outw_p(data, 0x308);
}


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

x86 assembly (clang, -O2):
<to_gps>:
push   %rbx
mov    %esi,%ebx
mov    $0x304,%esi
call   1030 <outw_p@plt>
mov    %ebx,%edi
mov    $0x308,%esi
pop    %rbx
jmp    1030 <outw_p@plt>

LLVM IR (-O0):
define void @to_gps(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 = call i32 @outw_p(i32 %5, i32 772)
%7 = load i32, i32* %4
%8 = call i32 @outw_p(i32 %7, i32 776)
ret void
}

LLVM IR (-O2):
define void @to_gps(i32 %0, i32 %1) {
%3 = tail call i32 @outw_p(i32 %0, i32 772)
%4 = tail call i32 @outw_p(i32 %1, i32 776)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
void fail() {
  perror("ERROR");
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
define void @fail() {
%1 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define void @fail() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}