xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ init_genrand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void sg_srandom_time() { init_genrand(time(NULL)); }


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

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

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

LLVM IR (-O2):
define void @sg_srandom_time() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @init_genrand(i32 %1)
ret void
}
ISR(TIMER0_COMPB_vect) {
  DEBUG("ISR "
        "TIMER0_COMPB"
        " occured");
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <DEBUG@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"ISR TIMER0_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
@.str = [25 x i8] c"ISR TIMER0_COMPB occured\00"
define i32 @ISR(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int row_byte_big5(int row) { return 0xa1 + row; }


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

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

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

LLVM IR (-O2):
define i32 @row_byte_big5(i32 %0) {
%2 = add nsw i32 %0, 161
ret i32 %2
}
void pthread_mutexattr_settype() {}


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

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

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

LLVM IR (-O2):
define void @pthread_mutexattr_settype() {
ret void
}
unsigned int read_cart_xegs(unsigned int addr) { return 0xff; }


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

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

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

LLVM IR (-O2):
define i32 @read_cart_xegs(i32 %0) {
ret i32 255
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ const *);
struct tm *gmtime(const time_t *timer) {
  return (localtime(timer));
}


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

x86 assembly (clang, -O2):
<gmtime>:
jmp    1030 <localtime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @gmtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @localtime(i32* %3)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @gmtime(i32* %0) {
%2 = tail call %struct.tm* @localtime(i32* %0)
ret %struct.tm* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigwaitinfo(int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int sigwait(const sigset_t *set, int *sig) {
  int ret = 1;
  if ((ret = sigwaitinfo(set, NULL)) != -1) {
    *sig = ret;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<sigwait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <sigwaitinfo@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0xffffffff,%eax
je     1155 <sigwait+0x45>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    115c <sigwait+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigwait>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <sigwaitinfo@plt>
cmp    $0xffffffff,%eax
je     112a <sigwait+0x1a>
mov    %eax,(%r14)
jmp    112f <sigwait+0x1f>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @sigwait(i32* %0, i32* nocapture writeonly %1) {
%3 = tail call i32 @sigwaitinfo(i32* %0, i32* null)
%4 = icmp eq i32 %3, -1
br i1 %4, label %6, label %5
5: ; preds = %2
store i32 %3, i32* %1
br label %6
6: ; preds = %2, %5
%7 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const);
int /*<<< orphan*/ stderr;
void GDD_handleError(const char *const msg) {
  fprintf(stderr, "Linklist error: %s\n", msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<GDD_handleError>:
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    $0xffffffff,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Linklist error: %s\0A\00"
define void @GDD_handleError(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 ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Linklist error: %s\0A\00"
define void @GDD_handleError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int call_usermodehelper_keys(char *, char **, char **, void *, int);
__attribute__((always_)) int call_usermodehelper(char *path, char **argv,
                                                 char **envp, int wait) {
  return call_usermodehelper_keys(path, argv, envp, ((void *)0), wait);
}


x86 assembly (clang, -O0):
<call_usermodehelper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <call_usermodehelper_keys@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_usermodehelper>:
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <call_usermodehelper_keys@plt>

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

LLVM IR (-O2):
define i32 @call_usermodehelper(i8* %0, i8** %1, i8** %2, i32 %3) {
%5 = tail call i32 @call_usermodehelper_keys(i8* %0, i8** %1, i8** %2, i8* null, i32 %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ execve(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int main(int argc, char **argv) {
  if (argc == 1) {
    if (execve("/bin/true", NULL, NULL) < 0) {
      perror("execve");
      exit(1);
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1188 <main+0x58>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1030 <execve@plt>
cmp    $0x0,%rax
jge    1183 <main+0x53>
lea    0xe96(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    1188 <main+0x58>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1161 <main+0x31>
lea    0xec3(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <execve@plt>
test   %rax,%rax
jns    1161 <main+0x31>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/true\00"
@.str.1 = [7 x i8] c"execve\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = call i64 @execve(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %8
br label %15
15: ; preds = %14, %2
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/true\00"
@.str.1 = [7 x i8] c"execve\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = tail call i64 @execve(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* null, i32* null)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4, %2
%11 = tail call i32 @exit(i32 0)
unreachable
}
void badseq(j, k) register int j, k;
{
  printf("\t.byte\t$%02.2x\t\t| invalid code sequence\n", j);
  printf("\t.byte\t$%02.2x\n", k);
}


x86 assembly (clang, -O0):
<badseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xef0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badseq>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"\09.byte\09$%02.2x\09\09| invalid code sequence\0A\00"
@.str.1 = [16 x i8] c"\09.byte\09$%02.2x\0A\00"
define void @badseq(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 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %4
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"\09.byte\09$%02.2x\09\09| invalid code sequence\0A\00"
@.str.1 = [16 x i8] c"\09.byte\09$%02.2x\0A\00"
define void @badseq(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int_controller_clear(int);
unsigned int output_device_read(void) {
  int_controller_clear(1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @output_device_read() {
%1 = call i32 @int_controller_clear(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @output_device_read() {
%1 = tail call i32 @int_controller_clear(i32 1)
ret i32 0
}
void dl_F3DEX_MOVEWORD() {}


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

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

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

LLVM IR (-O2):
define void @dl_F3DEX_MOVEWORD() {
ret void
}
/* Variables and functions */
int sync();
int main(int argc, char **argv) { return sync(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <sync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <sync@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @sync()
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @sync()
ret i32 %3
}
unsigned xrop3_165_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T ^ D;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_165_0_1>:
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    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_165_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rsi,1),%edx
xor    $0xff00,%edx
and    %eax,%edx
not    %eax
and    %esi,%eax
or     %ecx,%eax
xor    $0xffffff00,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_165_0_1(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 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = xor i32 %7, 65280
%9 = and i32 %8, %4
%10 = xor i32 %4, -1
%11 = and i32 %10, %5
%12 = or i32 %6, %11
%13 = xor i32 %12, -256
%14 = or i32 %13, %9
ret i32 %14
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void msleep(long ms) {
  struct timespec tm;
  tm.tv_sec = ms / 1000;
  tm.tv_nsec = (ms % 1000) * 1000000;
  nanosleep(&tm, NULL);
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0xf4240,%rdx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
sub    $0x18,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0xf4240,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @msleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %9, i64* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @msleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i64 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = srem i64 %0, 1000
%7 = mul nsw i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %7, i64* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
void test2_f(void) {}


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

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

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

LLVM IR (-O2):
define void @test2_f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ _library_ident(char *);
int /*<<< orphan*/ _library_task(char *);
extern void _start(void) {
  _library_ident("MPT Loader Library");
  _library_task("load factory symbol from shared library");
  _library_task("create proxy metatypes for library objects");
  _exit(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <_library_ident@plt>
lea    0xecc(%rip),%rdi
call   1040 <_library_task@plt>
lea    0xee8(%rip),%rdi
call   1040 <_library_task@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <_library_ident@plt>
lea    0xecf(%rip),%rdi
call   1040 <_library_task@plt>
lea    0xeeb(%rip),%rdi
call   1040 <_library_task@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"MPT Loader Library\00"
@.str.1 = [40 x i8] c"load factory symbol from shared library\00"
@.str.2 = [43 x i8] c"create proxy metatypes for library objects\00"
define void @_start() {
%1 = call i32 @_library_ident(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @_library_task(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @_library_task(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"MPT Loader Library\00"
@.str.1 = [40 x i8] c"load factory symbol from shared library\00"
@.str.2 = [43 x i8] c"create proxy metatypes for library objects\00"
define void @_start() {
%1 = tail call i32 @_library_ident(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_library_task(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @_library_task(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_factor();
int main() {
  test_factor();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_factor()
ret i32 0
}
int is_prime(const int x) {
  int p;
  for (p = 2; p < x; p++) {
    if (x % p == 0 && p != x)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1155 <is_prime+0x55>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1142 <is_prime+0x42>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1142 <is_prime+0x42>
movl   $0x0,-0x4(%rbp)
jmp    115c <is_prime+0x5c>
jmp    1147 <is_prime+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ LBA_REG(void *, int);
int gemini_ropes(void *phys_addr) {
  if (!LBA_REG(phys_addr, 0x0620))
    return 4;
  else if (!LBA_REG(phys_addr, 0x0620))
    return 2;
  else
    return 1;
}


x86 assembly (clang, -O0):
<gemini_ropes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x620,%esi
call   1030 <LBA_REG@plt>
cmp    $0x0,%eax
jne    113f <gemini_ropes+0x2f>
movl   $0x4,-0x4(%rbp)
jmp    1169 <gemini_ropes+0x59>
mov    -0x10(%rbp),%rdi
mov    $0x620,%esi
call   1030 <LBA_REG@plt>
cmp    $0x0,%eax
jne    1162 <gemini_ropes+0x52>
movl   $0x2,-0x4(%rbp)
jmp    1169 <gemini_ropes+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gemini_ropes>:
push   %rbx
mov    %rdi,%rbx
mov    $0x620,%esi
call   1030 <LBA_REG@plt>
test   %eax,%eax
je     113c <gemini_ropes+0x2c>
mov    %rbx,%rdi
mov    $0x620,%esi
call   1030 <LBA_REG@plt>
cmp    $0x1,%eax
mov    $0x1,%eax
adc    $0x0,%eax
pop    %rbx
ret
mov    $0x4,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @gemini_ropes(i8* %0) {
%2 = tail call i32 @LBA_REG(i8* %0, i32 1568)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @LBA_REG(i8* %0, i32 1568)
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 1
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 4, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ getchar();
int hex2int(char *);
int /*<<< orphan*/ stdout;
int main() {
  char *str2 = "12AB";
  fprintf(stdout, "%d \n", hex2int(str2));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hex2int@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%edx
lea    0xea1(%rip),%rsi
call   1050 <fprintf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
lea    0xebf(%rip),%rdi
call   1030 <hex2int@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1050 <fprintf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"12AB\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i32, i32* @stdout
%3 = load i8*, i8** %1
%4 = call i32 @hex2int(i8* %3)
%5 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"12AB\00"
@stdout = global i32 0
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @hex2int(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @getchar()
ret i32 0
}
void slab_deinit_stable(void) {}


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

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

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

LLVM IR (-O2):
define void @slab_deinit_stable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int solveMeFirst(int, int);
int main() {
  int num1, num2;
  scanf("%d %d", &num1, &num2);
  printf("%d\n", solveMeFirst(num1, num2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <solveMeFirst@plt>
mov    %eax,%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <solveMeFirst@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @solveMeFirst(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int shmdt(void const *);
int simpleShmUnlink(const void *shmAddr) { return shmdt(shmAddr); }


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

x86 assembly (clang, -O2):
<simpleShmUnlink>:
jmp    1030 <shmdt@plt>

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

LLVM IR (-O2):
define i32 @simpleShmUnlink(i8* %0) {
%2 = tail call i32 @shmdt(i8* %0)
ret i32 %2
}
unsigned char foo6(int x) { return x; }


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

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

LLVM IR (-O0):
define zeroext i8 @foo6(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @foo6(i32 %0) {
%2 = trunc i32 %0 to i8
ret i8 %2
}
/* Variables and functions */
long long llabs(long long val) {
  if (val < 0)
    val = -val;
  return val;
}


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    111d <llabs+0x1d>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
store i64 %7, i64* %2
br label %8
8: ; preds = %5, %1
%9 = load i64, i64* %2
ret i64 %9
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *, char const *);
void usage(const char *filepath) {
  error(1, 0,
        "Usage: %s [-46cmStuz] [-C cpu] [-D dst ip] [-l secs] [-p port] [-s "
        "sendsize]",
        filepath);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%edi
xor    %esi,%esi
lea    0xed2(%rip),%rdx
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [77 x i8] c"Usage: %s [-46cmStuz] [-C cpu] [-D dst ip] [-l secs] [-p port] [-s sendsize]\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [77 x i8] c"Usage: %s [-46cmStuz] [-C cpu] [-D dst ip] [-l secs] [-p port] [-s sendsize]\00"
define void @usage(i8* %0) {
%2 = tail call i32 @error(i32 1, i32 0, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int parse_uint8_base(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int parse_uint8(const char *arg, uint8_t *ret) {
  return parse_uint8_base(arg, ret, 0);
}


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

x86 assembly (clang, -O2):
<parse_uint8>:
xor    %edx,%edx
jmp    1030 <parse_uint8_base@plt>

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

LLVM IR (-O2):
define i32 @parse_uint8(i8* %0, i32* %1) {
%3 = tail call i32 @parse_uint8_base(i8* %0, i32* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ nop();
void unreachable_statement_exit_bad() {
  exit(2);
  nop();
}


x86 assembly (clang, -O0):
<unreachable_statement_exit_bad>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<unreachable_statement_exit_bad>:
push   %rax
mov    $0x2,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @unreachable_statement_exit_bad() {
%1 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @unreachable_statement_exit_bad() {
%1 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct skynet_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ handle_exit(struct skynet_context *, scalar_t__);
scalar_t__ tohandle(struct skynet_context *, char const *);
const char *cmd_kill(struct skynet_context *context, const char *param) {
  uint32_t handle = tohandle(context, param);
  if (handle) {
    handle_exit(context, handle);
  }
  return NULL;
}


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

x86 assembly (clang, -O2):
<cmd_kill>:
push   %rbx
mov    %rdi,%rbx
call   1040 <tohandle@plt>
test   %rax,%rax
je     1139 <cmd_kill+0x19>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <handle_exit@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.skynet_context = type { i32 }
define noalias i8* @cmd_kill(%struct.skynet_context* %0, i8* %1) {
%3 = tail call i64 @tohandle(%struct.skynet_context* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @handle_exit(%struct.skynet_context* %0, i64 %3)
br label %7
7: ; preds = %5, %2
ret i8* null
}
/* Variables and functions */
void *malloc(size_t);
void *internalMalloc(size_t size, void *userPtr) {
  (void)userPtr;
  return malloc(size);
}


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

x86 assembly (clang, -O2):
<internalMalloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @internalMalloc(i64 %0, i8* nocapture readnone %1) {
%3 = tail call i8* @malloc(i64 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sync_int_option(char *);
void get_server_options() {
  sync_int_option("Shuffle");
  sync_int_option("Repeat");
  sync_int_option("AutoNext");
}


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

x86 assembly (clang, -O2):
<get_server_options>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <sync_int_option@plt>
lea    0xee4(%rip),%rdi
call   1030 <sync_int_option@plt>
lea    0xedf(%rip),%rdi
pop    %rax
jmp    1030 <sync_int_option@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Shuffle\00"
@.str.1 = [7 x i8] c"Repeat\00"
@.str.2 = [9 x i8] c"AutoNext\00"
define void @get_server_options() {
%1 = call i32 @sync_int_option(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @sync_int_option(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @sync_int_option(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Shuffle\00"
@.str.1 = [7 x i8] c"Repeat\00"
@.str.2 = [9 x i8] c"AutoNext\00"
define void @get_server_options() {
%1 = tail call i32 @sync_int_option(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @sync_int_option(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sync_int_option(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int main() {
  int a, b;
  a = b + b + b + b + b + b + b + b + b + b + b + b + b + b + b + b + b + b + b;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void mem_free(void *mem) { free(mem); }


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

x86 assembly (clang, -O2):
<mem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
size_t write(int, char const *, size_t);
int main(int argc, char **argv) {
  const char msg[] = "hello world\n";
  size_t len = sizeof msg - 1;
  if (len != write(1, msg, len))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x1d(%rbp)
mov    0xed1(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xecc(%rip),%al
mov    %al,-0x11(%rbp)
movq   $0xc,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x1d(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
je     1181 <main+0x71>
movl   $0x1,-0x4(%rbp)
jmp    1188 <main+0x78>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0xa646c726f7720,%rax
mov    %rax,0xd(%rsp)
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0xc,%edx
mov    $0x1,%edi
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0xc,%rax
setne  %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.msg = [13 x i8] c"hello world\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [13 x i8]
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [13 x i8]* %6 to i8*
store i64 12, i64* %7
%9 = load i64, i64* %7
%10 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%11 = load i64, i64* %7
%12 = call i64 @write(i32 1, i8* %10, i64 %11)
%13 = icmp ne i64 %9, %12
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@__const.main.msg = [13 x i8] c"hello world\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [13 x i8]
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%5 = call i64 @write(i32 1, i8* %4, i64 12)
%6 = icmp ne i64 %5, 12
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int searchMatrix(int **, int, int, int);
int main(void) {
  int m[1][1] = {1};
  printf("%d\n", searchMatrix((int **)m, 1, 1, 1));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <searchMatrix@plt>
mov    %eax,%esi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1040 <searchMatrix@plt>
lea    0xeb7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.m = [1 x [1 x i32]] [[1 x i32] [i32 1]]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x [1 x i32]]
store i32 0, i32* %1
%3 = bitcast [1 x [1 x i32]]* %2 to i8*
%4 = getelementptr inbounds [1 x [1 x i32]], [1 x [1 x i32]]* %2, i64 0, i64 0
%5 = bitcast [1 x i32]* %4 to i32**
%6 = call i32 @searchMatrix(i32** %5, i32 1, i32 1, i32 1)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [1 x [1 x i32]]
%2 = bitcast [1 x [1 x i32]]* %1 to i8*
%3 = getelementptr inbounds [1 x [1 x i32]], [1 x [1 x i32]]* %1, i64 0, i64 0, i64 0
store i32 1, i32* %3
%4 = bitcast [1 x [1 x i32]]* %1 to i32**
%5 = call i32 @searchMatrix(i32** %4, i32 1, i32 1, i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}