xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *s) {
  fprintf(stderr, "USAGE: %s [[-r] [-t TYPE] priority pids ...] [-g pid]\n", s);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
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    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"USAGE: %s [[-r] [-t TYPE] priority pids ...] [-g pid]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(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 ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"USAGE: %s [[-r] [-t TYPE] priority pids ...] [-g pid]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int listen(int, int const);
int /*<<< orphan*/ perror(char *);
void doListen(int socketDescriptor) {
  const int BACKLOG = 10;
  int result = listen(socketDescriptor, BACKLOG);
  if (result == -1) {
    perror("listen");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<doListen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
call   1030 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1172 <doListen+0x42>
lea    0xe9d(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doListen>:
push   %rax
mov    $0xa,%esi
call   1030 <listen@plt>
cmp    $0xffffffff,%eax
je     1142 <doListen+0x12>
pop    %rax
ret
lea    0xeb7(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"listen\00"
define void @doListen(i32 %0) {
%2 = tail call i32 @listen(i32 %0, i32 10)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
int slimrawsize(char *c) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @slimrawsize(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
size_t ehstrnlen(const char *str, size_t buf_size) {
  size_t i;
  for (i = 0; i < buf_size; ++i) {
    if (*(str + i) == '\0') {
      return i;
    }
  }
  return buf_size;
}


x86 assembly (clang, -O0):
<ehstrnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115a <ehstrnlen+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1144 <ehstrnlen+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <ehstrnlen+0x62>
jmp    1149 <ehstrnlen+0x49>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <ehstrnlen+0x14>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehstrnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <ehstrnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <ehstrnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <ehstrnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @ehstrnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %9
%5 = phi i64 [ %10, %9 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = add nuw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %9, %2
%13 = phi i64 [ 0, %2 ], [ %1, %9 ], [ %5, %4 ]
ret i64 %13
}
int b1(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @b1() {
ret i32 1
}

LLVM IR (-O2):
define i32 @b1() {
ret i32 1
}
void gtk_object_flags_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_object_flags_get_type() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ set_bit(int, long *);
int main(void) {
  long count = 0x00;
  printf("%0x\n", count);
  set_bit(2, &count);
  printf("%0x\n", count);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
lea    -0x10(%rbp),%rsi
call   1040 <set_bit@plt>
mov    -0x10(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movq   $0x0,0x8(%rsp)
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    $0x2,%edi
call   1040 <set_bit@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%0x\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 0)
%4 = call i32 @set_bit(i32 2, i64* %1)
%5 = load i64, i64* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_UN;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ debug(char *, int);
int /*<<< orphan*/ die(char *, int);
scalar_t__ flock(int, int /*<<< orphan*/);
void sc_unlock(int lock_fd) {
  debug("releasing lock %d", lock_fd);
  if (flock(lock_fd, LOCK_UN) < 0) {
    die("cannot release lock %d", lock_fd);
  }
  close(lock_fd);
}


x86 assembly (clang, -O0):
<sc_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <debug@plt>
mov    -0x4(%rbp),%edi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1060 <flock@plt>
cmp    $0x0,%rax
jge    1184 <sc_unlock+0x44>
mov    -0x4(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1050 <die@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_unlock>:
push   %rbx
mov    %edi,%ebx
lea    0xeb6(%rip),%rdi
mov    %ebx,%esi
call   1030 <debug@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1060 <flock@plt>
test   %rax,%rax
jns    1174 <sc_unlock+0x34>
lea    0xea5(%rip),%rdi
mov    %ebx,%esi
call   1050 <die@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"releasing lock %d\00"
@LOCK_UN = global i32 0
@.str.1 = [23 x i8] c"cannot release lock %d\00"
define void @sc_unlock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @LOCK_UN
%7 = call i64 @flock(i32 %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %2
%14 = call i32 @close(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"releasing lock %d\00"
@LOCK_UN = global i32 0
@.str.1 = [23 x i8] c"cannot release lock %d\00"
define void @sc_unlock(i32 %0) {
%2 = tail call i32 @debug(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @LOCK_UN
%4 = tail call i64 @flock(i32 %0, i32 %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @die(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asink(int, int);
int two_arg_sink_caller_p(int x, int y) { asink(x, y); }


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

x86 assembly (clang, -O2):
<two_arg_sink_caller_p>:
jmp    1030 <asink@plt>

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

LLVM IR (-O2):
define i32 @two_arg_sink_caller_p(i32 %0, i32 %1) {
%3 = tail call i32 @asink(i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *);
int /*<<< orphan*/ sendHeader(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int serverLeave(int sock) {
  if (!sendHeader(3, 0, 0, sock))
    fatal_error("send header has failed\n");
  return 1;
}


x86 assembly (clang, -O0):
<serverLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x3,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <sendHeader@plt>
cmp    $0x0,%eax
jne    1151 <serverLeave+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <fatal_error@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serverLeave>:
push   %rax
mov    %edi,%ecx
mov    $0x3,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <sendHeader@plt>
test   %eax,%eax
jne    1141 <serverLeave+0x21>
lea    0xec4(%rip),%rdi
call   1040 <fatal_error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"send header has failed\0A\00"
define i32 @serverLeave(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sendHeader(i32 3, i32 0, i32 0, i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 1
}

LLVM IR (-O2):
@.str = [24 x i8] c"send header has failed\0A\00"
define i32 @serverLeave(i32 %0) {
%2 = tail call i32 @sendHeader(i32 3, i32 0, i32 0, i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i32 1
}
char prec(char operator) {
  switch (operator) {
  case '*':
    return 5;
    break;
  case '/':
    return 4;
    break;
  case '%':
    return 3;
    break;
  case '+':
    return 2;
    break;
  case '-':
    return 1;
    break;
  default:
    return 0;
    break;
  }
}


x86 assembly (clang, -O0):
<prec>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffdb,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xa,%eax
ja     1161 <prec+0x61>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x5,-0x1(%rbp)
jmp    1165 <prec+0x65>
movb   $0x4,-0x1(%rbp)
jmp    1165 <prec+0x65>
movb   $0x3,-0x1(%rbp)
jmp    1165 <prec+0x65>
movb   $0x2,-0x1(%rbp)
jmp    1165 <prec+0x65>
movb   $0x1,-0x1(%rbp)
jmp    1165 <prec+0x65>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prec>:
movslq %edi,%rax
add    $0xffffffffffffffdb,%rax
cmp    $0xa,%eax
ja     1117 <prec+0x17>
lea    0xeed(%rip),%rcx
mov    (%rax,%rcx,1),%al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @prec(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 42, label %6
i32 47, label %7
i32 37, label %8
i32 43, label %9
i32 45, label %10
]
6: ; preds = %1
store i8 5, i8* %2
br label %12
7: ; preds = %1
store i8 4, i8* %2
br label %12
8: ; preds = %1
store i8 3, i8* %2
br label %12
9: ; preds = %1
store i8 2, i8* %2
br label %12
10: ; preds = %1
store i8 1, i8* %2
br label %12
11: ; preds = %1
store i8 0, i8* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
@switch.table.prec = [11 x i8] c"\03\00\00\00\00\05\02\00\01\00\04"
define signext i8 @prec(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -37
%4 = icmp ult i32 %3, 11
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [11 x i8], [11 x i8]* @switch.table.prec, i64 0, i64 %6
%8 = load i8, i8* %7
br label %9
9: ; preds = %1, %5
%10 = phi i8 [ %8, %5 ], [ 0, %1 ]
ret i8 %10
}
int istype(char c) {
  if (c == '^' || c == '+' || c == '-' || c == '*' || c == '/') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<istype>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
je     114b <istype+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114b <istype+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <istype+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114b <istype+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
jne    1157 <istype+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <istype+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<istype>:
add    $0xd6,%dil
cmp    $0x34,%dil
ja     1124 <istype+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x1000000000002b,%rdx
bt     %rcx,%rdx
jae    1124 <istype+0x24>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @istype(i8 signext %0) {
switch i8 %0, label %2 [
i8 94, label %3
i8 47, label %3
i8 45, label %3
i8 43, label %3
i8 42, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
int ez_simple_hash(int _key, int _tsize) { return _key % _tsize; }


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

x86 assembly (clang, -O2):
<ez_simple_hash>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ez_simple_hash(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
void PDMQueueAlloc(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMQueueAlloc() {
ret void
}
/* Variables and functions */
double HUGE_VAL;
bool stdlib_base_is_negative_zero(const double x) {
  return (x == 0.0 && 1.0 / x == -HUGE_VAL);
}


x86 assembly (clang, -O0):
<stdlib_base_is_negative_zero>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %eax,%eax
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    1164 <stdlib_base_is_negative_zero+0x64>
jp     1164 <stdlib_base_is_negative_zero+0x64>
movsd  0xed2(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
mov    0x2eae(%rip),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_base_is_negative_zero>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1139 <stdlib_base_is_negative_zero+0x39>
jp     1139 <stdlib_base_is_negative_zero+0x39>
movsd  0xeec(%rip),%xmm1
mov    0x2ecd(%rip),%rax
movsd  (%rax),%xmm2
xorpd  0xee9(%rip),%xmm2
divsd  %xmm0,%xmm1
cmpeqsd %xmm1,%xmm2
movq   %xmm2,%rax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@HUGE_VAL = global double 0.000000e+00
define i32 @stdlib_base_is_negative_zero(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load double, double* %2
%7 = fdiv double 1.000000e+00, %6
%8 = load double, double* @HUGE_VAL
%9 = fneg double %8
%10 = fcmp oeq double %7, %9
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@HUGE_VAL = global double 0.000000e+00
define i32 @stdlib_base_is_negative_zero(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %3, label %9
3: ; preds = %1
%4 = fdiv double 1.000000e+00, %0
%5 = load double, double* @HUGE_VAL
%6 = fneg double %5
%7 = fcmp oeq double %4, %6
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %10
}
/* Variables and functions */
double RAND_MAX;
double cos(double);
int log(double);
scalar_t__ rand();
double sqrt(int);
double boxmuller() {
  return sqrt(-2 * log((double)rand() / RAND_MAX)) *
         cos(2.0 * 3.14159265358979323846264 * (double)rand() / RAND_MAX);
}


x86 assembly (clang, -O0):
<boxmuller>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e8d(%rip),%rax
divsd  (%rax),%xmm0
call   1040 <log@plt>
imul   $0xfffffffe,%eax,%edi
call   1050 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
cvtsi2sd %rax,%xmm1
movsd  0xe78(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2e55(%rip),%rax
divsd  (%rax),%xmm0
call   1030 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<boxmuller>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1060 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2e90(%rip),%rbx
divsd  (%rbx),%xmm0
call   1040 <log@plt>
lea    (%rax,%rax,1),%edi
neg    %edi
call   1050 <sqrt@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1060 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mulsd  0xe78(%rip),%xmm0
divsd  (%rbx),%xmm0
call   1030 <cos@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @boxmuller() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
%5 = call i32 @log(double %4)
%6 = mul nsw i32 -2, %5
%7 = call double @sqrt(i32 %6)
%8 = call i64 (...) @rand()
%9 = sitofp i64 %8 to double
%10 = fmul double 0x401921FB54442D18, %9
%11 = load double, double* @RAND_MAX
%12 = fdiv double %10, %11
%13 = call double @cos(double %12)
%14 = fmul double %7, %13
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @boxmuller() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
%5 = tail call i32 @log(double %4)
%6 = mul nsw i32 %5, -2
%7 = tail call double @sqrt(i32 %6)
%8 = tail call i64 (...) @rand()
%9 = sitofp i64 %8 to double
%10 = fmul double %9, 0x401921FB54442D18
%11 = load double, double* @RAND_MAX
%12 = fdiv double %10, %11
%13 = tail call double @cos(double %12)
%14 = fmul double %7, %13
ret double %14
}
float rnan(void) {
  union {
    float r;
    unsigned int j;
  } word;
  word.j = 0x7fffffff;
  return word.r;
}


x86 assembly (clang, -O0):
<rnan>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7fffffff,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnan>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @rnan() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store i32 2147483647, i32* %2
%3 = bitcast %union.anon* %1 to float*
%4 = load float, float* %3
ret float %4
}

LLVM IR (-O2):
define float @rnan() {
ret float 0x7FFFFFFFE0000000
}
int test_flag(unsigned long mask, const volatile unsigned long *addr) {
  return ((*addr) & mask) != 0;
}


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

x86 assembly (clang, -O2):
<test_flag>:
xor    %eax,%eax
and    (%rsi),%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @test_flag(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
store i64 %0, i64* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load volatile i64, i64* %5
%7 = load i64, i64* %3
%8 = and i64 %6, %7
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_flag(i64 %0, i64* %1) {
%3 = load volatile i64, i64* %1
%4 = and i64 %3, %0
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ useconds_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
scalar_t__ usleep(int /*<<< orphan*/);
void msleep(int time) {
  if (0 != usleep((useconds_t)(time * 1000))) {
    perror("couldn't usleep (possibly caught a signal)");
  }
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1040 <usleep@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1151 <msleep+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rax
imul   $0x3e8,%edi,%edi
call   1040 <usleep@plt>
test   %rax,%rax
jne    1133 <msleep+0x13>
pop    %rax
ret
lea    0xec6(%rip),%rdi
pop    %rax
jmp    1030 <perror@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"couldn't usleep (possibly caught a signal)\00"
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i64 @usleep(i32 %4)
%6 = icmp ne i64 0, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"couldn't usleep (possibly caught a signal)\00"
define void @msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i64 @usleep(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(unsigned short, int /*<<< orphan*/ *);
void WriteWordLE(FILE *File, unsigned short Value) {
  putc(Value & 0xFF, File);
  putc((Value & 0xFF00) >> 8, File);
}


x86 assembly (clang, -O0):
<WriteWordLE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
movzwl -0xa(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteWordLE>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @WriteWordLE(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i16
%9 = load i32*, i32** %3
%10 = call i32 @putc(i16 zeroext %8, i32* %9)
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = and i32 %12, 65280
%14 = ashr i32 %13, 8
%15 = trunc i32 %14 to i16
%16 = load i32*, i32** %3
%17 = call i32 @putc(i16 zeroext %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @WriteWordLE(i32* nocapture %0, i16 zeroext %1) {
%3 = and i16 %1, 255
%4 = tail call i32 @putc(i16 zeroext %3, i32* %0)
%5 = lshr i16 %1, 8
%6 = tail call i32 @putc(i16 zeroext %5, i32* %0)
ret void
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_assign(float *, float *);
__attribute__((always_)) struct mat3 *psmat3_assign(struct mat3 *result,
                                                    struct mat3 *m) {
  mat3_assign((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat3_assign>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3_assign@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_assign(%struct.mat3* %0, %struct.mat3* %1) {
%3 = alloca %struct.mat3*
%4 = alloca %struct.mat3*
store %struct.mat3* %0, %struct.mat3** %3
store %struct.mat3* %1, %struct.mat3** %4
%5 = load %struct.mat3*, %struct.mat3** %3
%6 = bitcast %struct.mat3* %5 to float*
%7 = load %struct.mat3*, %struct.mat3** %4
%8 = bitcast %struct.mat3* %7 to float*
%9 = call i32 @mat3_assign(float* %6, float* %8)
%10 = load %struct.mat3*, %struct.mat3** %3
ret %struct.mat3* %10
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_assign(%struct.mat3* returned %0, %struct.mat3* %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = bitcast %struct.mat3* %1 to float*
%5 = tail call i32 @mat3_assign(float* %3, float* %4)
ret %struct.mat3* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
size_t iconv(int /*<<< orphan*/, char **, size_t *, char **, size_t *);
size_t deconst_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft,
                     char **outbuf, size_t *outbytesleft) {
  union {
    const char **a;
    char **b;
  } deconst;
  deconst.a = inbuf;
  return iconv(cd, deconst.b, inbytesleft, outbuf, outbytesleft);
}


x86 assembly (clang, -O0):
<deconst_iconv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <iconv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deconst_iconv>:
jmp    1030 <iconv@plt>

LLVM IR (-O0):
%union.anon = type { i8** }
define i64 @deconst_iconv(i32 %0, i8** %1, i64* %2, i8** %3, i64* %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i64*
%9 = alloca i8**
%10 = alloca i64*
%11 = alloca %union.anon
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i64* %2, i64** %8
store i8** %3, i8*** %9
store i64* %4, i64** %10
%12 = load i8**, i8*** %7
%13 = bitcast %union.anon* %11 to i8***
store i8** %12, i8*** %13
%14 = load i32, i32* %6
%15 = bitcast %union.anon* %11 to i8***
%16 = load i8**, i8*** %15
%17 = load i64*, i64** %8
%18 = load i8**, i8*** %9
%19 = load i64*, i64** %10
%20 = call i64 @iconv(i32 %14, i8** %16, i64* %17, i8** %18, i64* %19)
ret i64 %20
}

LLVM IR (-O2):
define i64 @deconst_iconv(i32 %0, i8** %1, i64* %2, i8** %3, i64* %4) {
%6 = tail call i64 @iconv(i32 %0, i8** %1, i64* %2, i8** %3, i64* %4)
ret i64 %6
}
/* Type definitions */
struct tuple {
  int dummy;
};
struct lua_State {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lbox_pushtuple(struct lua_State *, struct tuple *);
int lbox_pushtupleornil(struct lua_State *L, struct tuple *tuple) {
  if (tuple == NULL)
    return 0;
  lbox_pushtuple(L, tuple);
  return 1;
}


x86 assembly (clang, -O0):
<lbox_pushtupleornil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1137 <lbox_pushtupleornil+0x27>
movl   $0x0,-0x4(%rbp)
jmp    114b <lbox_pushtupleornil+0x3b>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <lbox_pushtuple@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbox_pushtupleornil>:
test   %rsi,%rsi
je     1125 <lbox_pushtupleornil+0x15>
push   %rax
call   1030 <lbox_pushtuple@plt>
mov    $0x1,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.lua_State = type { i32 }
%struct.tuple = type { i32 }
define i32 @lbox_pushtupleornil(%struct.lua_State* %0, %struct.tuple* %1) {
%3 = alloca i32
%4 = alloca %struct.lua_State*
%5 = alloca %struct.tuple*
store %struct.lua_State* %0, %struct.lua_State** %4
store %struct.tuple* %1, %struct.tuple** %5
%6 = load %struct.tuple*, %struct.tuple** %5
%7 = icmp eq %struct.tuple* %6, null
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %13
9: ; preds = %2
%10 = load %struct.lua_State*, %struct.lua_State** %4
%11 = load %struct.tuple*, %struct.tuple** %5
%12 = call i32 @lbox_pushtuple(%struct.lua_State* %10, %struct.tuple* %11)
store i32 1, i32* %3
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.lua_State = type { i32 }
%struct.tuple = type { i32 }
define i32 @lbox_pushtupleornil(%struct.lua_State* %0, %struct.tuple* %1) {
%3 = icmp eq %struct.tuple* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @lbox_pushtuple(%struct.lua_State* %0, %struct.tuple* %1)
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ 1, %4 ], [ 0, %2 ]
ret i32 %7
}
/* Variables and functions */
int jk_is_some_property(char const *, char *);
int jk_is_cmd_line_poperty(const char *prp_name) {
  return jk_is_some_property(prp_name, ("cmd_line"));
}


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

x86 assembly (clang, -O2):
<jk_is_cmd_line_poperty>:
lea    0xee9(%rip),%rsi
jmp    1030 <jk_is_some_property@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"cmd_line\00"
define i32 @jk_is_cmd_line_poperty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @jk_is_some_property(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"cmd_line\00"
define i32 @jk_is_cmd_line_poperty(i8* %0) {
%2 = tail call i32 @jk_is_some_property(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, ...);
void alarm_handler(int signum) {
  signal(SIGALRM, NULL);
  printf("Buzz Buzz Buzz\n");
  signal(SIGALRM, alarm_handler);
  alarm(1);
}


x86 assembly (clang, -O0):
<alarm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1050 <signal@plt>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
mov    0x2e65(%rip),%rsi
mov    $0x0,%al
call   1050 <signal@plt>
mov    $0x1,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alarm_handler>:
push   %rbx
mov    0x2eb0(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <signal@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
mov    0x2e78(%rip),%rsi
xor    %eax,%eax
call   1050 <signal@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1040 <alarm@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@.str = [16 x i8] c"Buzz Buzz Buzz\0A\00"
define void @alarm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SIGALRM
%4 = call i32 (i32, ...) @signal(i32 %3, i8* null)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @SIGALRM
%7 = call i32 (i32, ...) @signal(i32 %6, void (i32)* @alarm_handler)
%8 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@str = [15 x i8] c"Buzz Buzz Buzz\00"
define void @alarm_handler(i32 %0) {
%2 = load i32, i32* @SIGALRM
%3 = tail call i32 (i32, ...) @signal(i32 %2, i8* null)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @SIGALRM
%6 = tail call i32 (i32, ...) @signal(i32 %5, void (i32)* @alarm_handler)
%7 = tail call i32 @alarm(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testSwap();
void runTests() { testSwap(); }


x86 assembly (clang, -O0):
<runTests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <testSwap@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @runTests() {
%1 = call i32 (...) @testSwap()
ret void
}

LLVM IR (-O2):
define void @runTests() {
%1 = tail call i32 (...) @testSwap()
ret void
}
/* Variables and functions */
double tan(double);
double math__Float__tan(double self) {
  double var;
  double var1;
  var1 = tan(self);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<math__Float__tan>:
jmp    1030 <tan@plt>

LLVM IR (-O0):
define double @math__Float__tan(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = call double @tan(double %5)
store double %6, double* %4
%7 = load double, double* %4
store double %7, double* %3
br label %8
8: ; preds = %1
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @math__Float__tan(double %0) {
%2 = tail call double @tan(double %0)
ret double %2
}
int nbl_get_tmll_pos(char *pstrBuffer) {
  int ret = 0;
  while ((*((int *)(pstrBuffer + ret))) != 0x4C4C4D54)
    ret += 16;
  return ret;
}


x86 assembly (clang, -O0):
<nbl_get_tmll_pos>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x4c4c4d54,(%rax,%rcx,1)
je     1132 <nbl_get_tmll_pos+0x32>
mov    -0xc(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <nbl_get_tmll_pos+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbl_get_tmll_pos>:
mov    $0xfffffff0,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x10,%eax
cmpl   $0x4c4c4d54,(%rdi)
lea    0x10(%rdi),%rdi
jne    1110 <nbl_get_tmll_pos+0x10>
ret

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

LLVM IR (-O2):
define i32 @nbl_get_tmll_pos(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %8, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1280068948
%8 = add nuw i64 %3, 16
br i1 %7, label %9, label %2
9: ; preds = %2
%10 = trunc i64 %3 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ strcmp(char *, char *);
int checkModes(char *str) {
  if ((strcmp(str, "-m")) && (strcmp(str, "-t"))) {
    printf("ERROR: not a valid mode\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkModes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1178 <checkModes+0x58>
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1178 <checkModes+0x58>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    117f <checkModes+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkModes>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed3(%rip),%rsi
call   1040 <strcmp@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     115e <checkModes+0x3e>
lea    0xec3(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     115e <checkModes+0x3e>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-m\00"
@.str.1 = [3 x i8] c"-t\00"
@.str.2 = [25 x i8] c"ERROR: not a valid mode\0A\00"
define i32 @checkModes(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %14
13: ; preds = %7, %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [3 x i8] c"-m\00"
@.str.1 = [3 x i8] c"-t\00"
@str = [24 x i8] c"ERROR: not a valid mode\00"
define i32 @checkModes(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %1, %4, %7
%10 = phi i32 [ 1, %7 ], [ 0, %4 ], [ 0, %1 ]
ret i32 %10
}
void sync(void) {}


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

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

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

LLVM IR (-O2):
define void @sync() {
ret void
}
int close(int fileno) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @close(i32 %0) {
ret i32 1
}
int XGetPointerMapping() {}


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

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

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

LLVM IR (-O2):
define i32 @XGetPointerMapping() {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
int fread(unsigned char *, size_t const, int, int /*<<< orphan*/ *);
void read_bytes(FILE *file, const size_t n, unsigned char *bytes) {
  if (fread(bytes, n, 1, file) != 1) {
    fatal("Error reading from file.");
  }
}


x86 assembly (clang, -O0):
<read_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
je     115f <read_bytes+0x3f>
lea    0xea6(%rip),%rdi
call   1040 <fatal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_bytes>:
push   %rax
mov    %rdi,%rcx
mov    %rdx,%rdi
mov    $0x1,%edx
call   1030 <fread@plt>
cmp    $0x1,%eax
jne    1138 <read_bytes+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1040 <fatal@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Error reading from file.\00"
define void @read_bytes(i32* %0, i64 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i8*
store i32* %0, i32** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i64, i64* %5
%9 = load i32*, i32** %4
%10 = call i32 @fread(i8* %7, i64 %8, i32 1, i32* %9)
%11 = icmp ne i32 %10, 1
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Error reading from file.\00"
define void @read_bytes(i32* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32 @fread(i8* %2, i64 %1, i32 1, i32* %0)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int input();
int getinput() { return input(); }


x86 assembly (clang, -O0):
<getinput>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <input@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getinput() {
%1 = call i32 (...) @input()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getinput() {
%1 = tail call i32 (...) @input()
ret i32 %1
}
void aacenc_getmainargs(int *argc, char ***argv) { return; }


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

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

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

LLVM IR (-O2):
define void @aacenc_getmainargs(i32* nocapture %0, i8*** nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RTP_set_version(unsigned char *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void RTP_init_header_v2(unsigned char *p, int len) {
  memset(p, 0, len);
  RTP_set_version(p, 0x2);
}


x86 assembly (clang, -O0):
<RTP_init_header_v2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1040 <RTP_set_version@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_init_header_v2>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1040 <RTP_set_version@plt>

LLVM IR (-O0):
define void @RTP_init_header_v2(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 @memset(i8* %5, i32 0, i32 %6)
%8 = load i8*, i8** %3
%9 = call i32 @RTP_set_version(i8* %8, i32 2)
ret void
}

LLVM IR (-O2):
define void @RTP_init_header_v2(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%4 = tail call i32 @RTP_set_version(i8* %0, i32 2)
ret void
}