xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
void oom(void) {
  const char *message = "out of memory\n";
  write(STDERR_FILENO, message, strlen(message));
  abort();
}


x86 assembly (clang, -O0):
<oom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<oom>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%ebx
lea    0xebc(%rip),%r14
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"out of memory\0A\00"
@STDERR_FILENO = global i32 0
define void @oom() {
%1 = alloca i8*
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @STDERR_FILENO
%3 = load i8*, i8** %1
%4 = load i8*, i8** %1
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 %2, i8* %3, i32 %5)
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"out of memory\0A\00"
@STDERR_FILENO = global i32 0
define void @oom() {
%1 = load i32, i32* @STDERR_FILENO
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_imatrix(int **M, long i0, long NI, long j0, long NJ) {
  free((char *)(M[i0] + j0 - 1));
  free((char *)(M + i0 - 1));
}


x86 assembly (clang, -O0):
<free_imatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x20(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_imatrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rcx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_imatrix(i32** nocapture %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = getelementptr inbounds i32*, i32** %0, i64 %1
%7 = load i32*, i32** %6
%8 = getelementptr inbounds i32, i32* %7, i64 %3
%9 = getelementptr inbounds i32, i32* %8, i64 -1
%10 = bitcast i32* %9 to i8*
%11 = tail call i32 @free(i8* %10)
%12 = getelementptr inbounds i32*, i32** %6, i64 -1
%13 = bitcast i32** %12 to i8*
%14 = tail call i32 @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
main() { f(0xffffff01); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffff01,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffff01,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 -255)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -255)
ret i32 0
}
/* Type definitions */
struct termios {
  int *c_cc;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
size_t VTIME;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
extern void set_timeout_mode(void) {
  struct termios mode;
  tcgetattr(0, &mode);
  mode.c_cc[VTIME] = 20;
  tcsetattr(0, TCSANOW, &mode);
}


x86 assembly (clang, -O0):
<set_timeout_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1030 <tcgetattr@plt>
mov    -0x8(%rbp),%rax
mov    0x2e9a(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x14,(%rax,%rcx,4)
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_timeout_mode>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
call   1030 <tcgetattr@plt>
mov    0x8(%rsp),%rax
mov    0x2e98(%rip),%rcx
mov    (%rcx),%rcx
movl   $0x14,(%rax,%rcx,4)
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
mov    %rbx,%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.termios = type { i32* }
@VTIME = global i64 0
@TCSANOW = global i32 0
define void @set_timeout_mode() {
%1 = alloca %struct.termios
%2 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
%3 = getelementptr inbounds %struct.termios, %struct.termios* %1, i32 0, i32 0
%4 = load i32*, i32** %3
%5 = load i64, i64* @VTIME
%6 = getelementptr inbounds i32, i32* %4, i64 %5
store i32 20, i32* %6
%7 = load i32, i32* @TCSANOW
%8 = call i32 @tcsetattr(i32 0, i32 %7, %struct.termios* %1)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32* }
@VTIME = global i64 0
@TCSANOW = global i32 0
define void @set_timeout_mode() {
%1 = alloca %struct.termios
%2 = bitcast %struct.termios* %1 to i8*
%3 = call i32 @tcgetattr(i32 0, %struct.termios* %1)
%4 = getelementptr inbounds %struct.termios, %struct.termios* %1, i64 0, i32 0
%5 = load i32*, i32** %4
%6 = load i64, i64* @VTIME
%7 = getelementptr inbounds i32, i32* %5, i64 %6
store i32 20, i32* %7
%8 = load i32, i32* @TCSANOW
%9 = call i32 @tcsetattr(i32 0, i32 %8, %struct.termios* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ efree(void *);
void phannot_wrapper_free(void *pointer) { efree(pointer); }


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

x86 assembly (clang, -O2):
<phannot_wrapper_free>:
jmp    1030 <efree@plt>

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

LLVM IR (-O2):
define void @phannot_wrapper_free(i8* %0) {
%2 = tail call i32 @efree(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() { printf("hello,world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello,world\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"hello,world\00"
define void @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ verbose(char *, char *);
int dir_change(char *dirname) {
  verbose("Changing directory '%s'...", dirname);
  return (!chdir(dirname));
}


x86 assembly (clang, -O0):
<dir_change>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <verbose@plt>
mov    -0x8(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_change>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <verbose@plt>
mov    %rbx,%rdi
call   1030 <chdir@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Changing directory '%s'...\00"
define i32 @dir_change(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @verbose(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %2
%6 = call i32 @chdir(i8* %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@.str = [27 x i8] c"Changing directory '%s'...\00"
define i32 @dir_change(i8* %0) {
%2 = tail call i32 @verbose(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @chdir(i8* %0)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ memcmp(void *, void *, int);
bool hamt_int_equals(void *a, void *b) {
  if (a == NULL || b == NULL)
    return a == b;
  return memcmp(a, b, sizeof(int)) == 0;
}


x86 assembly (clang, -O0):
<hamt_int_equals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <hamt_int_equals+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    114e <hamt_int_equals+0x3e>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    116f <hamt_int_equals+0x5f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hamt_int_equals>:
test   %rdi,%rdi
je     1133 <hamt_int_equals+0x23>
test   %rsi,%rsi
je     1133 <hamt_int_equals+0x23>
push   %rax
mov    $0x4,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
sete   %al
add    $0x8,%rsp
movzbl %al,%eax
ret
cmp    %rsi,%rdi
sete   %al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @hamt_int_equals(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = icmp eq i8* %0, %1
br label %11
8: ; preds = %2
%9 = tail call i64 @memcmp(i8* %0, i8* %1, i32 4)
%10 = icmp eq i64 %9, 0
br label %11
11: ; preds = %8, %6
%12 = phi i1 [ %7, %6 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
scalar_t__ symlink(char *, char *);
int /*<<< orphan*/ unlink(char *);
int lha_arch_symlink(char *path, char *target) {
  unlink(path);
  return symlink(target, path) == 0;
}


x86 assembly (clang, -O0):
<lha_arch_symlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <symlink@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lha_arch_symlink>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <unlink@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <symlink@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @lha_arch_symlink(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 = call i32 @unlink(i8* %5)
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = call i64 @symlink(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @lha_arch_symlink(i8* %0, i8* %1) {
%3 = tail call i32 @unlink(i8* %0)
%4 = tail call i64 @symlink(i8* %1, i8* %0)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close2(int, int);
void close4(int fd1, int fd2, int fd3, int fd4) {
  close2(fd1, fd2);
  close2(fd3, fd4);
}


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

x86 assembly (clang, -O2):
<close4>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1030 <close2@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <close2@plt>

LLVM IR (-O0):
define void @close4(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* %5
%10 = load i32, i32* %6
%11 = call i32 @close2(i32 %9, i32 %10)
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @close2(i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
define void @close4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @close2(i32 %0, i32 %1)
%6 = tail call i32 @close2(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ heading(int /*<<< orphan*/);
void op_headingn() { heading(0); }


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

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

LLVM IR (-O0):
define void @op_headingn() {
%1 = call i32 @heading(i32 0)
ret void
}

LLVM IR (-O2):
define void @op_headingn() {
%1 = tail call i32 @heading(i32 0)
ret void
}
/* Type definitions */
struct re_registers {
  int dummy;
};
struct re_pattern_buffer {
  int dummy;
};

/* Variables and functions */
int re_match_2(struct re_pattern_buffer *, int /*<<< orphan*/,
               int /*<<< orphan*/, char const *, int, int,
               struct re_registers *, int);
int re_match(struct re_pattern_buffer *bufp, const char *string, int size,
             int pos, struct re_registers *regs) {
  return re_match_2(bufp, 0, 0, string, size, pos, regs, size);
}


x86 assembly (clang, -O0):
<re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x20(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
mov    %r10,(%rsp)
mov    %eax,0x8(%rsp)
call   1030 <re_match_2@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match>:
push   %rax
mov    %r8,%rax
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
xor    %esi,%esi
xor    %edx,%edx
push   %r8
push   %rax
call   1030 <re_match_2@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = alloca %struct.re_pattern_buffer*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.re_registers* %4, %struct.re_registers** %10
%11 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load %struct.re_registers*, %struct.re_registers** %10
%16 = load i32, i32* %8
%17 = call i32 @re_match_2(%struct.re_pattern_buffer* %11, i32 0, i32 0, i8* %12, i32 %13, i32 %14, %struct.re_registers* %15, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_match(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4) {
%6 = tail call i32 @re_match_2(%struct.re_pattern_buffer* %0, i32 0, i32 0, i8* %1, i32 %2, i32 %3, %struct.re_registers* %4, i32 %2)
ret i32 %6
}
/* Variables and functions */
double inter_le(double, double);
double myrtgamma_left(double a, double b, double t) {
  return (inter_le(a, b * t) * t);
}


x86 assembly (clang, -O0):
<myrtgamma_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
call   1030 <inter_le@plt>
mulsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myrtgamma_left>:
push   %rax
movsd  %xmm2,(%rsp)
mulsd  %xmm2,%xmm1
call   1030 <inter_le@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @myrtgamma_left(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fmul double %8, %9
%11 = call double @inter_le(double %7, double %10)
%12 = load double, double* %6
%13 = fmul double %11, %12
ret double %13
}

LLVM IR (-O2):
define double @myrtgamma_left(double %0, double %1, double %2) {
%4 = fmul double %1, %2
%5 = tail call double @inter_le(double %0, double %4)
%6 = fmul double %5, %2
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int diminuto_pin_put(int /*<<< orphan*/ *, int /*<<< orphan*/);
int diminuto_pin_clear(FILE *fp) { return diminuto_pin_put(fp, 0); }


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

x86 assembly (clang, -O2):
<diminuto_pin_clear>:
xor    %esi,%esi
jmp    1030 <diminuto_pin_put@plt>

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

LLVM IR (-O2):
define i32 @diminuto_pin_clear(i32* %0) {
%2 = tail call i32 @diminuto_pin_put(i32* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int offsets_valid(long long const *offsets) { return (offsets != NULL); }


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

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

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

LLVM IR (-O2):
define i32 @offsets_valid(i64* readnone %0) {
%2 = icmp ne i64* %0, null
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int lseek(int, long, int /*<<< orphan*/);
int File_seek(int fd, long pos) { return lseek(fd, pos, SEEK_SET); }


x86 assembly (clang, -O0):
<File_seek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
call   1030 <lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<File_seek>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <lseek@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @File_seek(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = load i32, i32* @SEEK_SET
%8 = call i32 @lseek(i32 %5, i64 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @File_seek(i32 %0, i64 %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @lseek(i32 %0, i64 %1, i32 %3)
ret i32 %4
}
double convert_to_celsius(double fdegrees) { return (fdegrees - 32) * 5 / 9; }


x86 assembly (clang, -O0):
<convert_to_celsius>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_to_celsius>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @convert_to_celsius(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 5.000000e+00
%4 = fdiv double %3, 9.000000e+00
ret double %4
}
int seq_open(struct file *f, const struct seq_operations *o) { return -1; }


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

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

LLVM IR (-O0):
%struct.file = type opaque
%struct.seq_operations = type opaque
define i32 @seq_open(%struct.file* %0, %struct.seq_operations* %1) {
%3 = alloca %struct.file*
%4 = alloca %struct.seq_operations*
store %struct.file* %0, %struct.file** %3
store %struct.seq_operations* %1, %struct.seq_operations** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.file = type opaque
%struct.seq_operations = type opaque
define i32 @seq_open(%struct.file* nocapture readnone %0, %struct.seq_operations* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage_error(char *program) {
  fprintf(stderr,
          "Usage: %s -d directory/ -o output/file [-e ext1:ext2] -v[1|2|9]\n",
          program);
  exit(1);
}


x86 assembly (clang, -O0):
<usage_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: %s -d directory/ -o output/file [-e ext1:ext2] -v[1|2|9]\0A\00"
define void @usage_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [65 x i8] c"Usage: %s -d directory/ -o output/file [-e ext1:ext2] -v[1|2|9]\0A\00"
define void @usage_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_bslli_si128(int /*<<< orphan*/, int);
__m128i test_mm_bslli_si128(__m128i A) { return _mm_bslli_si128(A, 5); }


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

x86 assembly (clang, -O2):
<test_mm_bslli_si128>:
mov    $0x5,%esi
jmp    1030 <_mm_bslli_si128@plt>

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

LLVM IR (-O2):
define i32 @test_mm_bslli_si128(i32 %0) {
%2 = tail call i32 @_mm_bslli_si128(i32 %0, i32 5)
ret i32 %2
}
int f2(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<f2>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @f2(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f2(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
void freeTriangle(char **triangle, int rows) {
  while (--rows >= 0) {
    free(triangle[rows]);
  }
  free(triangle);
}


x86 assembly (clang, -O0):
<freeTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jl     1147 <freeTriangle+0x37>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    111f <freeTriangle+0xf>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeTriangle>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %esi,%esi
jle    1146 <freeTriangle+0x36>
mov    %esi,%ebx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%eax
mov    (%r14,%rax,8),%rdi
call   1030 <free@plt>
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1130 <freeTriangle+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeTriangle(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8**, i8*** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
%14 = load i8*, i8** %13
br label %5
15: ; preds = %5
%16 = load i8**, i8*** %3
%17 = bitcast i8** %16 to i8*
ret void
}

LLVM IR (-O2):
define void @freeTriangle(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = icmp ugt i64 %7, 1
br i1 %12, label %6, label %13
13: ; preds = %6, %2
%14 = bitcast i8** %0 to i8*
tail call void @free(i8* %14)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int);
int main() {
  int temp = 0;
  temp = sum(999);
  printf("\nans=>%d\n", temp);
  temp = sum(1128);
  printf("\nans=>%d\n", temp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e7,%edi
call   1040 <sum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x468,%edi
call   1040 <sum@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e7,%edi
call   1040 <sum@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x468,%edi
call   1040 <sum@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0Aans=>%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sum(i32 999)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sum(i32 1128)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0Aans=>%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 999)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sum(i32 1128)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ read(int, char *, int);
int read_command(int in_pipe, char *command) {
  memset(command, '\0', 1024);
  if (read(in_pipe, command, 1024) <= 0) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<read_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x400,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
jg     1166 <read_command+0x46>
movl   $0x0,-0x4(%rbp)
jmp    116d <read_command+0x4d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_command>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1040 <read@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_command(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @memset(i8* %6, i8 signext 0, i32 1024)
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = call i64 @read(i32 %8, i8* %9, i32 1024)
%11 = icmp sle i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @read_command(i32 %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i8 signext 0, i32 1024)
%4 = tail call i64 @read(i32 %0, i8* %1, i32 1024)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
int tup_temporarily_drop_privs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @tup_temporarily_drop_privs() {
ret i32 0
}
/* Variables and functions */
int genrand64_int64();
double mt_rand_double() {
  return (genrand64_int64() >> 11) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<mt_rand_double>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
movsd  0xed6(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_double>:
push   %rax
xor    %eax,%eax
call   1030 <genrand64_int64@plt>
sar    $0xb,%eax
cvtsi2sd %eax,%xmm0
mulsd  0xed9(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mt_rand_double() {
%1 = call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}

LLVM IR (-O2):
define double @mt_rand_double() {
%1 = tail call i32 (...) @genrand64_int64()
%2 = ashr i32 %1, 11
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3CA0000000000000
ret double %4
}
void inswap(void *s, int n) {
  char *p = (char *)s, *q, h;
  q = p + n - 1;
  while (q > p) {
    h = *p;
    *p++ = *q--;
    *q = h;
  }
}


x86 assembly (clang, -O0):
<inswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    116d <inswap+0x6d>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
jmp    1126 <inswap+0x26>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inswap>:
movslq %esi,%rax
lea    (%rdi,%rax,1),%rcx
add    $0xffffffffffffffff,%rcx
cmp    %rdi,%rcx
jbe    1139 <inswap+0x39>
mov    -0x1(%rdi,%rax,1),%cl
add    %rdi,%rax
add    $0xfffffffffffffffe,%rax
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%edx
mov    %cl,(%rdi)
add    $0x1,%rdi
mov    %dl,(%rax)
lea    -0x1(%rax),%rsi
mov    %edx,%ecx
cmp    %rdi,%rax
mov    %rsi,%rax
ja     1120 <inswap+0x20>
ret

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

LLVM IR (-O2):
define void @inswap(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %17
7: ; preds = %2
%8 = load i8, i8* %5
br label %9
9: ; preds = %7, %9
%10 = phi i8 [ %13, %9 ], [ %8, %7 ]
%11 = phi i8* [ %15, %9 ], [ %0, %7 ]
%12 = phi i8* [ %14, %9 ], [ %5, %7 ]
%13 = load i8, i8* %11
%14 = getelementptr inbounds i8, i8* %12, i64 -1
%15 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %11
store i8 %13, i8* %14
%16 = icmp ugt i8* %14, %15
br i1 %16, label %9, label %17
17: ; preds = %9, %2
ret void
}
unsigned long branch_iform_target(const unsigned int instr) {
  signed long imm;
  imm = instr & 0x3FFFFFC;
  if (imm & 0x2000000)
    imm -= 0x4000000;
  return (unsigned long)imm;
}


x86 assembly (clang, -O0):
<branch_iform_target>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3fffffc,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x2000000,%rax
cmp    $0x0,%rax
je     1137 <branch_iform_target+0x37>
mov    -0x10(%rbp),%rax
sub    $0x4000000,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<branch_iform_target>:
and    $0x3fffffc,%edi
lea    -0x4000000(%rdi),%rax
test   $0x2000000,%edi
cmove  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @branch_iform_target(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 67108860
%6 = zext i32 %5 to i64
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = and i64 %7, 33554432
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = sub nsw i64 %11, 67108864
store i64 %12, i64* %3
br label %13
13: ; preds = %10, %1
%14 = load i64, i64* %3
ret i64 %14
}

LLVM IR (-O2):
define i64 @branch_iform_target(i32 %0) {
%2 = and i32 %0, 67108860
%3 = zext i32 %2 to i64
%4 = and i64 %3, 33554432
%5 = icmp eq i64 %4, 0
%6 = or i64 %3, -67108864
%7 = select i1 %5, i64 %3, i64 %6
ret i64 %7
}
void WDTimerIntEnable(void) {
  (*((volatile unsigned long *)(0x40002C04))) |= 0x00000200;
}


x86 assembly (clang, -O0):
<WDTimerIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40002c04,%eax
mov    (%rax),%rcx
or     $0x200,%rcx
mov    $0x40002c04,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WDTimerIntEnable>:
orq    $0x200,0x40002c04
ret

LLVM IR (-O0):
define void @WDTimerIntEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%2 = or i64 %1, 512
store volatile i64 %2, i64* inttoptr (i64 1073753092 to i64*)
ret void
}

LLVM IR (-O2):
define void @WDTimerIntEnable() {
%1 = load volatile i64, i64* inttoptr (i64 1073753092 to i64*)
%2 = or i64 %1, 512
store volatile i64 %2, i64* inttoptr (i64 1073753092 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SETHLm(int);
void SET2HLm() { SETHLm(0x04); }


x86 assembly (clang, -O0):
<SET2HLm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1030 <SETHLm@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SET2HLm>:
mov    $0x4,%edi
jmp    1030 <SETHLm@plt>

LLVM IR (-O0):
define void @SET2HLm() {
%1 = call i32 @SETHLm(i32 4)
ret void
}

LLVM IR (-O2):
define void @SET2HLm() {
%1 = tail call i32 @SETHLm(i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cga_putc(int);
int /*<<< orphan*/ serial_putc(int);
void cons_putc(int c) {
  serial_putc(c);
  cga_putc(c);
}


x86 assembly (clang, -O0):
<cons_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <serial_putc@plt>
mov    -0x4(%rbp),%edi
call   1030 <cga_putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cons_putc>:
push   %rbx
mov    %edi,%ebx
call   1040 <serial_putc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <cga_putc@plt>

LLVM IR (-O0):
define void @cons_putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @serial_putc(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @cga_putc(i32 %5)
ret void
}

LLVM IR (-O2):
define void @cons_putc(i32 %0) {
%2 = tail call i32 @serial_putc(i32 %0)
%3 = tail call i32 @cga_putc(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ system(char *);
void payload(char *cmd) {
  char buf[512];
  strcpy(buf, cmd);
  strcat(buf, " > /tmp/_0utput.txt");
  system(buf);
}


x86 assembly (clang, -O0):
<payload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
lea    0xea3(%rip),%rsi
call   1050 <strcat@plt>
lea    -0x210(%rbp),%rdi
call   1040 <system@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<payload>:
push   %rbx
sub    $0x200,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c" > /tmp/_0utput.txt\00"
define void @payload(i8* %0) {
%2 = alloca i8*
%3 = alloca [512 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%8 = call i32 @strcat(i8* %7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%10 = call i32 @system(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c" > /tmp/_0utput.txt\00"
define void @payload(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @system(i8* %3)
ret void
}
/* Variables and functions */
int strncasecmp(char *, char *, int);
void strncasecmp_diff_length_3() {
  char *x = "aBc";
  char *y = "abcde";
  if (strncasecmp(x, y, 5) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0xffffffff,%eax
je     1149 <strncasecmp_diff_length_3+0x39>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"aBc\00"
@.str.1 = [6 x i8] c"abcde\00"
define void @strncasecmp_diff_length_3() {
%1 = alloca i8*
%2 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strncasecmp(i8* %3, i8* %4, i32 5)
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8, i8* null
br label %9
9: ; preds = %7, %0
ret void
}

LLVM IR (-O2):
define void @strncasecmp_diff_length_3() {
ret void
}
int tropas_lenght(int size) { return (size < 12) ? (3 - 1) / 2 : (5 - 1) / 2; }


x86 assembly (clang, -O0):
<tropas_lenght>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x2,%eax
mov    $0x1,%ecx
cmp    $0xc,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tropas_lenght>:
xor    %ecx,%ecx
cmp    $0xc,%edi
setl   %cl
mov    $0x2,%eax
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @tropas_lenght(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 12
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @tropas_lenght(i32 %0) {
%2 = icmp slt i32 %0, 12
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
int binarysearch(int arraysize, int data[], int search) {
  int loop;
  for (loop = 0; loop < arraysize; loop++) {
    if (search == data[loop]) {
      return loop;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<binarysearch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <binarysearch+0x53>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1140 <binarysearch+0x40>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <binarysearch+0x5a>
jmp    1145 <binarysearch+0x45>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <binarysearch+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binarysearch>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111e <binarysearch+0x1e>
mov    %edi,%edi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rsi,%rcx,4)
je     111f <binarysearch+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rdi
jne    1110 <binarysearch+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @binarysearch(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%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 0, i32* %8
br label %9
9: ; preds = %24, %3
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %27
13: ; preds = %9
%14 = load i32, i32* %7
%15 = load i32*, i32** %6
%16 = load i32, i32* %8
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %14, %19
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %28
23: ; preds = %13
br label %24
24: ; preds = %23
%25 = load i32, i32* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
br label %9
27: ; preds = %9
store i32 -1, i32* %4
br label %28
28: ; preds = %27, %21
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @binarysearch(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %1, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cWriteWord(unsigned char, unsigned short);
void SensorSetReg_MT9V111(unsigned char uAddr, unsigned short uVal) {
  VIM_SIF_I2cWriteWord((unsigned char)uAddr, (unsigned short)uVal);
}


x86 assembly (clang, -O0):
<SensorSetReg_MT9V111>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzwl -0x4(%rbp),%esi
call   1030 <VIM_SIF_I2cWriteWord@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SensorSetReg_MT9V111>:
jmp    1030 <VIM_SIF_I2cWriteWord@plt>

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

LLVM IR (-O2):
define void @SensorSetReg_MT9V111(i8 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @VIM_SIF_I2cWriteWord(i8 zeroext %0, i16 zeroext %1)
ret void
}