xunge/DecIR huggingface dataset:
int test_imm_A3int8_reg(signed char val) {
  return ((val) & (-0xA3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A3int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff5d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A3int8_reg>:
test   $0xffffff5d,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A3int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -163
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int futex_wait(int *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int ftx = 0;
  int err = futex_wait(&ftx, 1, NULL);
  if (err != 0) {
    fprintf(stderr, "expected 0 return value, got %i\n", err);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <futex_wait@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     1180 <main+0x60>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%edx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1187 <main+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
xor    %ebx,%ebx
lea    0xc(%rsp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1040 <futex_wait@plt>
test   %eax,%eax
je     1160 <main+0x40>
mov    0x2e95(%rip),%rcx
mov    (%rcx),%edi
lea    0xeac(%rip),%rsi
mov    %eax,%edx
call   1030 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"expected 0 return value, got %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%8 = call i32 @futex_wait(i32* %6, i32 1, i32* null)
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i32, i32* %7
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"expected 0 return value, got %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @futex_wait(i32* %3, i32 1, i32* null)
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ 1, %7 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strncmp(char *, char *, int);
char *device_name(char *name) {
  if (!strncmp(name, "/dev/", 5))
    return name + 5;
  return name;
}


x86 assembly (clang, -O0):
<device_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    114b <device_name+0x3b>
mov    -0x10(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <device_name+0x43>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<device_name>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    (%rcx,%rcx,4),%rax
add    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"/dev/\00"
define i8* @device_name(i8* %0) {
%2 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i64 5, i64 0
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void ouch(int sig) {
  printf("OUCH! - I got a signal %d\n", sig);
  signal(sig, SIG_DFL);
}


x86 assembly (clang, -O0):
<ouch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouch>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"OUCH! - I got a signal %d\0A\00"
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @SIG_DFL
%7 = call i32 @signal(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"OUCH! - I got a signal %d\0A\00"
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern char *__progname;
  fprintf(stderr,
          "Usage: %s\n"
          "\t [-v] for versioning information\n"
          "\t [-l] local port to listen on\n"
          "\t [-p] remote port to connect to\n"
          "\t [-h] remote host to connect to\n",
          __progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%rdx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%rdx
lea    0xed6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [142 x i8] c"Usage: %s\0A\09 [-v] for versioning information\0A\09 [-l] local port to listen on\0A\09 [-p] remote port to connect to\0A\09 [-h] remote host to connect to\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [142 x i8] c"Usage: %s\0A\09 [-v] for versioning information\0A\09 [-l] local port to listen on\0A\09 [-p] remote port to connect to\0A\09 [-h] remote host to connect to\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([142 x i8], [142 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ machdep_ClockStart();
void McSrv_ClockStart(void) { machdep_ClockStart(); }


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

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

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

LLVM IR (-O2):
define void @McSrv_ClockStart() {
%1 = tail call i32 (...) @machdep_ClockStart()
ret void
}
/* Type definitions */
struct request_queue {
  int dummy;
};

/* Variables and functions */
int blk_queue_io_stat(struct request_queue *);
int blk_do_io_stat(struct request_queue *q) {
  if (q)
    return blk_queue_io_stat(q);
  return 0;
}


x86 assembly (clang, -O0):
<blk_do_io_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <blk_do_io_stat+0x28>
mov    -0x10(%rbp),%rdi
call   1030 <blk_queue_io_stat@plt>
mov    %eax,-0x4(%rbp)
jmp    113f <blk_do_io_stat+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blk_do_io_stat>:
test   %rdi,%rdi
je     111a <blk_do_io_stat+0xa>
jmp    1030 <blk_queue_io_stat@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.request_queue = type { i32 }
define i32 @blk_do_io_stat(%struct.request_queue* %0) {
%2 = alloca i32
%3 = alloca %struct.request_queue*
store %struct.request_queue* %0, %struct.request_queue** %3
%4 = load %struct.request_queue*, %struct.request_queue** %3
%5 = icmp ne %struct.request_queue* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.request_queue*, %struct.request_queue** %3
%8 = call i32 @blk_queue_io_stat(%struct.request_queue* %7)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.request_queue = type { i32 }
define i32 @blk_do_io_stat(%struct.request_queue* %0) {
%2 = icmp eq %struct.request_queue* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @blk_queue_io_stat(%struct.request_queue* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
void Push(struct Stack *stack, void *data) {}


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

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

LLVM IR (-O0):
%struct.Stack = type opaque
define void @Push(%struct.Stack* %0, i8* %1) {
%3 = alloca %struct.Stack*
%4 = alloca i8*
store %struct.Stack* %0, %struct.Stack** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.Stack = type opaque
define void @Push(%struct.Stack* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t get_uint16(const uint8_t *p) {
  return (uint16_t)(p[0] + (1 << 8) * p[1]);
}


x86 assembly (clang, -O0):
<get_uint16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_uint16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = mul nsw i32 256, %8
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_uint16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl nsw i32 %4, 8
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
scalar_t__ EINPROGRESS;
scalar_t__ errno;
int os_last_network_op_is_in_progress() { return (errno == EINPROGRESS); }


x86 assembly (clang, -O0):
<os_last_network_op_is_in_progress>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%rax
mov    0x2ed3(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_last_network_op_is_in_progress>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%rcx
mov    0x2ed7(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
sete   %al
ret

LLVM IR (-O0):
@errno = global i64 0
@EINPROGRESS = global i64 0
define i32 @os_last_network_op_is_in_progress() {
%1 = load i64, i64* @errno
%2 = load i64, i64* @EINPROGRESS
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@errno = global i64 0
@EINPROGRESS = global i64 0
define i32 @os_last_network_op_is_in_progress() {
%1 = load i64, i64* @errno
%2 = load i64, i64* @EINPROGRESS
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
ret i32 %4
}
void readjoy(void) {}


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

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

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

LLVM IR (-O2):
define void @readjoy() {
ret void
}
void data_scr_init(void) {}


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

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

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

LLVM IR (-O2):
define void @data_scr_init() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int set_pos_rel(void *id, int32_t delta, int mode) { return -1; }


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

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

LLVM IR (-O0):
define i32 @set_pos_rel(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
define i32 @set_pos_rel(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
const char *decSingleVersion(void) { return "decNumber 3.68"; }


x86 assembly (clang, -O0):
<decSingleVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decSingleVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"decNumber 3.68\00"
define i8* @decSingleVersion() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"decNumber 3.68\00"
define i8* @decSingleVersion() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _assert_ok(char *func) {
  printf(".");
  return 0;
}


x86 assembly (clang, -O0):
<_assert_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_assert_ok(i8* nocapture readnone %0) {
%2 = tail call i32 @putchar(i32 46)
ret i32 0
}
int trace_strnlen(const char *c, int l) {
  int r = 0;
  while (*c && l >= 0) {
    r++;
    c++;
    l--;
  }
  return r;
}


x86 assembly (clang, -O0):
<trace_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1131 <trace_strnlen+0x31>
cmpl   $0x0,-0xc(%rbp)
setge  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <trace_strnlen+0x41>
jmp    1164 <trace_strnlen+0x64>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <trace_strnlen+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trace_strnlen>:
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     1122 <trace_strnlen+0x22>
test   %esi,%esi
js     1122 <trace_strnlen+0x22>
mov    %esi,%ecx
xor    %edx,%edx
nop
lea    0x1(%rdx),%rax
cmpb   $0x0,0x1(%rdi,%rdx,1)
je     1122 <trace_strnlen+0x22>
cmp    %edx,%ecx
mov    %rax,%rdx
jne    1110 <trace_strnlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @trace_strnlen(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp ne i8 %3, 0
%5 = icmp sgt i32 %1, -1
%6 = and i1 %4, %5
br i1 %6, label %7, label %18
7: ; preds = %2, %7
%8 = phi i32 [ %11, %7 ], [ 0, %2 ]
%9 = phi i32 [ %13, %7 ], [ %1, %2 ]
%10 = phi i8* [ %12, %7 ], [ %0, %2 ]
%11 = add nuw nsw i32 %8, 1
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = add nsw i32 %9, -1
%14 = load i8, i8* %12
%15 = icmp ne i8 %14, 0
%16 = icmp ne i32 %9, 0
%17 = select i1 %15, i1 %16, i1 false
br i1 %17, label %7, label %18
18: ; preds = %7, %2
%19 = phi i32 [ 0, %2 ], [ %11, %7 ]
ret i32 %19
}
int Section3Fourth(int *number) { return *number % 10; }


x86 assembly (clang, -O0):
<Section3Fourth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section3Fourth>:
movslq (%rdi),%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Section3Fourth(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = srem i32 %2, 10
ret i32 %3
}
/* Type definitions */
typedef int uint8_t;
struct pcg_state_setseq_8 {
  int dummy;
};

/* Variables and functions */
int pcg_setseq_8_rxs_m_xs_8_random_r(struct pcg_state_setseq_8 *);
uint8_t pcg_setseq_8_rxs_m_xs_8_boundedrand_r(struct pcg_state_setseq_8 *rng,
                                              uint8_t bound) {
  uint8_t threshold = ((uint8_t)(-bound)) % bound;
  for (;;) {
    uint8_t r = pcg_setseq_8_rxs_m_xs_8_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_setseq_8_rxs_m_xs_8_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_setseq_8_rxs_m_xs_8_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_setseq_8_rxs_m_xs_8_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_setseq_8_rxs_m_xs_8_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_setseq_8_rxs_m_xs_8_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_setseq_8_rxs_m_xs_8_random_r@plt>
test   %eax,%eax
js     1120 <pcg_setseq_8_rxs_m_xs_8_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_setseq_8 = type { i32 }
define i32 @pcg_setseq_8_rxs_m_xs_8_boundedrand_r(%struct.pcg_state_setseq_8* %0, i32 %1) {
%3 = alloca %struct.pcg_state_setseq_8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_setseq_8* %0, %struct.pcg_state_setseq_8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_setseq_8*, %struct.pcg_state_setseq_8** %3
%13 = call i32 @pcg_setseq_8_rxs_m_xs_8_random_r(%struct.pcg_state_setseq_8* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_setseq_8 = type { i32 }
define i32 @pcg_setseq_8_rxs_m_xs_8_boundedrand_r(%struct.pcg_state_setseq_8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_setseq_8_rxs_m_xs_8_random_r(%struct.pcg_state_setseq_8* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((destructor)) void dtor() { printf("destruct\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"destruct\0A\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dtor, i8* null }]
define void @dtor() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @dtor, i8* null }]
@str = [9 x i8] c"destruct\00"
define void @dtor() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((__noreturn__)) int child_fn(void *arg) {
  fprintf(stderr, "in child_fn\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<child_fn>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"in child_fn\0A\00"
define i32 @child_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"in child_fn\0A\00"
define i32 @child_fn(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
struct internal_ibv_ctx *ibv_ctx_to_internal(struct ibv_context *ctx) {
  return (struct internal_ibv_ctx *)ctx;
}


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

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

LLVM IR (-O0):
%struct.internal_ibv_ctx = type opaque
%struct.ibv_context = type opaque
define %struct.internal_ibv_ctx* @ibv_ctx_to_internal(%struct.ibv_context* %0) {
%2 = alloca %struct.ibv_context*
store %struct.ibv_context* %0, %struct.ibv_context** %2
%3 = load %struct.ibv_context*, %struct.ibv_context** %2
%4 = bitcast %struct.ibv_context* %3 to %struct.internal_ibv_ctx*
ret %struct.internal_ibv_ctx* %4
}

LLVM IR (-O2):
%struct.internal_ibv_ctx = type opaque
%struct.ibv_context = type opaque
define %struct.internal_ibv_ctx* @ibv_ctx_to_internal(%struct.ibv_context* readnone %0) {
%2 = bitcast %struct.ibv_context* %0 to %struct.internal_ibv_ctx*
ret %struct.internal_ibv_ctx* %2
}
/* Type definitions */
struct SocketTuple {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ closeSocketTuple(struct SocketTuple *);
struct SocketTuple *findSocketTupleWithSocket(int);
void closeSocket(int socket) {
  struct SocketTuple *socketTuple = findSocketTupleWithSocket(socket);
  closeSocketTuple(socketTuple);
}


x86 assembly (clang, -O0):
<closeSocket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <findSocketTupleWithSocket@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <closeSocketTuple@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeSocket>:
push   %rax
call   1040 <findSocketTupleWithSocket@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <closeSocketTuple@plt>

LLVM IR (-O0):
%struct.SocketTuple = type { i32 }
define void @closeSocket(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.SocketTuple*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.SocketTuple* @findSocketTupleWithSocket(i32 %4)
store %struct.SocketTuple* %5, %struct.SocketTuple** %3
%6 = load %struct.SocketTuple*, %struct.SocketTuple** %3
%7 = call i32 @closeSocketTuple(%struct.SocketTuple* %6)
ret void
}

LLVM IR (-O2):
%struct.SocketTuple = type { i32 }
define void @closeSocket(i32 %0) {
%2 = tail call %struct.SocketTuple* @findSocketTupleWithSocket(i32 %0)
%3 = tail call i32 @closeSocketTuple(%struct.SocketTuple* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int suma2Enteros(int, int);
int main() {
  int suma;
  suma = suma2Enteros(2, 41);
  printf("\nLa suma es %d\n\n", suma);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x29,%esi
call   1040 <suma2Enteros@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"\0ALa suma es %d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @suma2Enteros(i32 2, i32 41)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
long double frexp(long double, int *);
long double frexpl(long double x, int *e) { return frexp(x, e); }


x86 assembly (clang, -O0):
<frexpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rdi
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <frexp@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frexpl>:
jmp    1030 <frexp@plt>

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

LLVM IR (-O2):
define x86_fp80 @frexpl(x86_fp80 %0, i32* nocapture %1) {
%3 = tail call x86_fp80 @frexp(x86_fp80 %0, i32* %1)
ret x86_fp80 %3
}
int getTimeInSeconds(int arr[3]) {
  return arr[0] * 3600 + arr[1] * 60 + arr[2];
}


x86 assembly (clang, -O0):
<getTimeInSeconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0xe10,(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   $0x3c,0x4(%rcx),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeInSeconds>:
imul   $0xe10,(%rdi),%ecx
imul   $0x3c,0x4(%rdi),%eax
add    %ecx,%eax
add    0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @getTimeInSeconds(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 3600
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 60
%7 = add nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
void gtk_file_chooser_get_action() {}


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

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

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

LLVM IR (-O2):
define void @gtk_file_chooser_get_action() {
ret void
}
/* Type definitions */
struct array {
  int dummy;
};

/* Variables and functions */
int array_map(struct array *, int (*)(void *const));
int queue_map(struct array *q, int(action)(void *const data)) {
  return array_map(q, action);
}


x86 assembly (clang, -O0):
<queue_map>:
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 <array_map@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_map>:
jmp    1030 <array_map@plt>

LLVM IR (-O0):
%struct.array = type { i32 }
define i32 @queue_map(%struct.array* %0, i32 (i8*)* %1) {
%3 = alloca %struct.array*
%4 = alloca i32 (i8*)*
store %struct.array* %0, %struct.array** %3
store i32 (i8*)* %1, i32 (i8*)** %4
%5 = load %struct.array*, %struct.array** %3
%6 = load i32 (i8*)*, i32 (i8*)** %4
%7 = call i32 @array_map(%struct.array* %5, i32 (i8*)* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.array = type { i32 }
define i32 @queue_map(%struct.array* %0, i32 (i8*)* %1) {
%3 = tail call i32 @array_map(%struct.array* %0, i32 (i8*)* %1)
ret i32 %3
}
void outw(unsigned short int value, unsigned short int port) {
  __asm__ __volatile__("outw %w0,%w1" : : "a"(value), "Nd"(port));
}


x86 assembly (clang, -O0):
<outw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    -0x4(%rbp),%dx
out    %ax,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outw>:
mov    %esi,%edx
mov    %edi,%eax
out    %ax,(%dx)
ret

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

LLVM IR (-O2):
define void @outw(i16 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outw ${0:w},${1:w}", "{ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0, i16 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(
      stderr,
      "usage: %s <-s random seed> <-n number of records> <-o output file>\n",
      prog);
  exit(1);
}


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    $0x1,%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    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"usage: %s <-s random seed> <-n number of records> <-o output file>\0A\00"
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 ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"usage: %s <-s random seed> <-n number of records> <-o output file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ _rp(int *, int, int *, int /*<<< orphan*/);
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int *calloc(int, int);
int /*<<< orphan*/ free(int *);
void rpermute(int *arr, int len) {
  int *cache = calloc(len, sizeof(int));
  assert(cache != NULL);
  _rp(arr, len, cache, 0);
  free(cache);
}


x86 assembly (clang, -O0):
<rpermute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1040 <_rp@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpermute>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <assert@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1040 <_rp@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @rpermute(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32* @calloc(i32 %6, i32 4)
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = load i32*, i32** %5
%15 = call i32 @_rp(i32* %12, i32 %13, i32* %14, i32 0)
%16 = load i32*, i32** %5
%17 = call i32 @free(i32* %16)
ret void
}

LLVM IR (-O2):
define void @rpermute(i32* %0, i32 %1) {
%3 = tail call i32* @calloc(i32 %1, i32 4)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @_rp(i32* %0, i32 %1, i32* %3, i32 0)
%8 = tail call i32 @free(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ base64_to_name(char *);
int /*<<< orphan*/ do_globops(int /*<<< orphan*/, char *);
void m_wallops(char *origin, char **argv, int argc, int srv) {
  do_globops(base64_to_name(origin), argv[0]);
}


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

x86 assembly (clang, -O2):
<m_wallops>:
push   %rbx
mov    %rsi,%rbx
call   1030 <base64_to_name@plt>
mov    (%rbx),%rsi
mov    %eax,%edi
pop    %rbx
jmp    1040 <do_globops@plt>

LLVM IR (-O0):
define void @m_wallops(i8* %0, i8** %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = call i32 @base64_to_name(i8* %9)
%11 = load i8**, i8*** %6
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 @do_globops(i32 %10, i8* %13)
ret void
}

LLVM IR (-O2):
define void @m_wallops(i8* %0, i8** nocapture %1, i32 %2, i32 %3) {
%5 = tail call i32 @base64_to_name(i8* %0)
%6 = load i8*, i8** %1
%7 = tail call i32 @do_globops(i32 %5, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int m;
  while (~(scanf("%d", &m) && m != 0))
    printf("%d\n", m / 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115b <main+0x3b>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
xor    $0xffffffff,%eax
cmp    $0x0,%eax
je     118d <main+0x6d>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xec7(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
sar    %esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %14, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br label %9
9: ; preds = %6, %3
%10 = phi i1 [ false, %3 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
%12 = xor i32 %11, -1
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %9
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 2
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %3
18: ; preds = %9
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = sdiv i32 %5, 2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %3
}
void test118_BlinkMilli_pollen__run__E() {}


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

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

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

LLVM IR (-O2):
define void @test118_BlinkMilli_pollen__run__E() {
ret void
}
void f() {
  typedef int foo;
  typedef foo bar;
  typedef bar baz;
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERANGE;
int /*<<< orphan*/ errno;
int valid_tid(int tid) {
  if (tid < 0 || tid >= 1024) {
    errno = ERANGE;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<valid_tid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <valid_tid+0x1e>
cmpl   $0x400,-0x8(%rbp)
jl     113c <valid_tid+0x3c>
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eaa(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1143 <valid_tid+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_tid>:
xor    %eax,%eax
cmp    $0x400,%edi
jb     1121 <valid_tid+0x21>
mov    0x2ed7(%rip),%rax
mov    (%rax),%eax
mov    0x2ebe(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ERANGE = global i32 0
@errno = global i32 0
define i32 @valid_tid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 1024
br i1 %8, label %9, label %11
9: ; preds = %6, %1
%10 = load i32, i32* @ERANGE
store i32 %10, i32* @errno
store i32 -1, i32* %2
br label %12
11: ; preds = %6
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@ERANGE = global i32 0
@errno = global i32 0
define i32 @valid_tid(i32 %0) {
%2 = icmp ugt i32 %0, 1023
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @ERANGE
store i32 %4, i32* @errno
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %6
}
void binsearch() {}


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

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

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

LLVM IR (-O2):
define void @binsearch() {
ret void
}
long __syscall4(long __n, long __a1, long __a2, long __a3, long __a4) {
  unsigned long __ret;
  register long __r10 __asm__("r10") = __a4;
  __asm__ __volatile__("syscall"
                       : "=a"(__ret)
                       : "a"(__n), "D"(__a1), "S"(__a2), "d"(__a3), "r"(__r10)
                       : "rcx", "r11", "memory");
  return __ret;
}


x86 assembly (clang, -O0):
<__syscall4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%r10
syscall
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__syscall4>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%r10
syscall
ret

LLVM IR (-O0):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%13 = load i64, i64* %10
store i64 %13, i64* %12
%14 = load i64, i64* %6
%15 = load i64, i64* %7
%16 = load i64, i64* %8
%17 = load i64, i64* %9
%18 = load i64, i64* %12
%19 = call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %14, i64 %15, i64 %16, i64 %17, i64 %18)
store i64 %19, i64* %11
%20 = load i64, i64* %11
ret i64 %20
}

LLVM IR (-O2):
define i64 @__syscall4(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 asm sideeffect "syscall", "={ax},{ax},{di},{si},{dx},{r10},~{rcx},~{r11},~{memory},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret i64 %6
}
/* Variables and functions */
size_t strlen(const char *cs) {
  size_t i = 0;
  if (!cs)
    return (i);
  while (*cs++)
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <strlen+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <strlen+0x5e>
jmp    112d <strlen+0x2d>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     1156 <strlen+0x56>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112d <strlen+0x2d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
test   %rdi,%rdi
je     111f <strlen+0x1f>
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

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