xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void help(void) {
  char *helpText = "Usage: bin2mem [-d <data start address>] <text segment> "
                   "<data segment> <output file>\n";
  printf("%s\n", helpText);
  exit(1);
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xf2e(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [86 x i8] c"Usage: bin2mem [-d <data start address>] <text segment> <data segment> <output file>\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @help() {
%1 = alloca i8*
store i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [86 x i8] c"Usage: bin2mem [-d <data start address>] <text segment> <data segment> <output file>\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *strdup(char const *);
char *_CcsStrdup_(const char *str, const char *fname, int line) {
  return strdup(str);
}


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

x86 assembly (clang, -O2):
<_CcsStrdup_>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @_CcsStrdup_(i8* nocapture %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i8* @strdup(i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ gpio_set(int, int /*<<< orphan*/);
void stop() {
  gpio_set((27), 0);
  gpio_set((47), 0);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x2f,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop>:
push   %rax
mov    $0x1b,%edi
xor    %esi,%esi
call   1030 <gpio_set@plt>
mov    $0x2f,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <gpio_set@plt>

LLVM IR (-O0):
define void @stop() {
%1 = call i32 @gpio_set(i32 27, i32 0)
%2 = call i32 @gpio_set(i32 47, i32 0)
ret void
}

LLVM IR (-O2):
define void @stop() {
%1 = tail call i32 @gpio_set(i32 27, i32 0)
%2 = tail call i32 @gpio_set(i32 47, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushcomplex16array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 16));
}


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

x86 assembly (clang, -O2):
<pushcomplex16array_>:
mov    (%rsi),%esi
shl    $0x4,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushcomplex16array_(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 = load i32, i32* %6
%8 = mul i32 %7, 16
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushcomplex16array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 4
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
struct ibv_context {
  int dummy;
};

/* Variables and functions */
int _query_pkey(struct ibv_context *, int /*<<< orphan*/, int,
                int /*<<< orphan*/ *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_query_pkey(struct ibv_context *context, uint8_t port_num, int index,
                   uint16_t *pkey) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _query_pkey(context, port_num, index, pkey);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_query_pkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <_query_pkey@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_query_pkey>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <_query_pkey@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
define i32 @ibv_query_pkey(%struct.ibv_context* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca %struct.ibv_context*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
store %struct.ibv_context* %0, %struct.ibv_context** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%10 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%11 = load %struct.ibv_context*, %struct.ibv_context** %5
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = load i32*, i32** %8
%15 = call i32 @_query_pkey(%struct.ibv_context* %11, i32 %12, i32 %13, i32* %14)
store i32 %15, i32* %9
%16 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
define i32 @ibv_query_pkey(%struct.ibv_context* %0, i32 %1, i32 %2, i32* %3) {
%5 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%6 = tail call i32 @_query_pkey(%struct.ibv_context* %0, i32 %1, i32 %2, i32* %3)
%7 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %6
}
unsigned short gs_strlen(const char *str) {
  const char *s;
  for (s = str; *s; ++s)
    continue;
  return (s - str);
}


x86 assembly (clang, -O0):
<gs_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1133 <gs_strlen+0x33>
jmp    1122 <gs_strlen+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <gs_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <gs_strlen+0x10>
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define zeroext i16 @gs_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i16
ret i16 %11
}
/* Variables and functions */
int /*<<< orphan*/ syscall0(int);
void sleep() { syscall0(1); }


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

x86 assembly (clang, -O2):
<sleep>:
mov    $0x1,%edi
jmp    1030 <syscall0@plt>

LLVM IR (-O0):
define void @sleep() {
%1 = call i32 @syscall0(i32 1)
ret void
}

LLVM IR (-O2):
define void @sleep() {
%1 = tail call i32 @syscall0(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int hex2int(char ch) {
  if (ch >= '0' && ch <= '9')
    return ch - '0';
  if (ch >= 'a' && ch <= 'f')
    return ch - 'a' + 10;
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<hex2int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1147 <hex2int+0x37>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1147 <hex2int+0x37>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex2int+0x6a>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1173 <hex2int+0x63>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1173 <hex2int+0x63>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    117a <hex2int+0x6a>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex2int>:
lea    -0x30(%rdi),%eax
mov    $0xffffffd0,%ecx
cmp    $0xa,%al
jb     1128 <hex2int+0x18>
lea    -0x61(%rdi),%eax
mov    $0xffffffa9,%ecx
cmp    $0x6,%al
jae    112f <hex2int+0x1f>
movsbl %dil,%eax
add    %ecx,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @hex2int(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 sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %30
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 97
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 102
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 97
%27 = add nsw i32 %26, 10
store i32 %27, i32* %2
br label %30
28: ; preds = %19, %15
%29 = call i32 (...) @abort()
unreachable
30: ; preds = %23, %11
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @hex2int(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = add i8 %0, -97
%6 = icmp ult i8 %5, 6
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %4, %1
%10 = phi i32 [ -48, %1 ], [ -87, %4 ]
%11 = sext i8 %0 to i32
%12 = add nsw i32 %10, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ output_prog_name(char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prog) {
  fputs("Usage: ", stderr);
  output_prog_name(prog);
  fputs(" [-ifs] string", stderr);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%esi
lea    0xec4(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <output_prog_name@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
lea    0xeae(%rip),%rdi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <output_prog_name@plt>
mov    (%r14),%esi
lea    0xeb9(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage: \00"
@stderr = global i32 0
@.str.1 = [15 x i8] c" [-ifs] string\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i8*, i8** %2
%6 = call i32 @output_prog_name(i8* %5)
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Usage: \00"
@stderr = global i32 0
@.str.1 = [15 x i8] c" [-ifs] string\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @output_prog_name(i8* %0)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct nary_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ output(struct nary_node *);
int generate_dot(struct nary_node *node) {
  output(node);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.nary_node = type { i32 }
define i32 @generate_dot(%struct.nary_node* %0) {
%2 = tail call i32 @output(%struct.nary_node* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
char *registers_get_string(char const *);
int debug_display_register(const char *regname) {
  char *content = registers_get_string(regname);
  if (!content) {
    printf("No such register.\n");
    return 0;
  }
  printf("%s: %s\n", regname, content);
  return 1;
}


x86 assembly (clang, -O0):
<debug_display_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <registers_get_string@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    115e <debug_display_register+0x3e>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    117b <debug_display_register+0x5b>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_display_register>:
push   %rbx
mov    %rdi,%rbx
call   1050 <registers_get_string@plt>
test   %rax,%rax
je     1159 <debug_display_register+0x29>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"No such register.\0A\00"
@.str.1 = [8 x i8] c"%s: %s\0A\00"
define i32 @debug_display_register(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @registers_get_string(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %12, i8* %13)
store i32 1, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"%s: %s\0A\00"
@str = [18 x i8] c"No such register.\00"
define i32 @debug_display_register(i8* %0) {
%2 = tail call i8* @registers_get_string(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %2)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %6 ], [ 0, %4 ]
ret i32 %9
}
void __attribute__((nomips16)) nofoo(void) {}


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

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

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

LLVM IR (-O2):
define void @nofoo() {
ret void
}
/* Type definitions */
struct tpacket2_hdr {
  int tp_status;
};

/* Variables and functions */
int TP_STATUS_SENDING;
int TP_STATUS_SEND_REQUEST;
int __v2_tx_kernel_ready(struct tpacket2_hdr *hdr) {
  return !(hdr->tp_status & (TP_STATUS_SEND_REQUEST | TP_STATUS_SENDING));
}


x86 assembly (clang, -O0):
<__v2_tx_kernel_ready>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ed3(%rip),%rcx
mov    (%rcx),%ecx
mov    0x2eba(%rip),%rdx
or     (%rdx),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__v2_tx_kernel_ready>:
mov    0x2ee1(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %eax,%eax
test   %ecx,(%rdi)
sete   %al
ret

LLVM IR (-O0):
%struct.tpacket2_hdr = type { i32 }
@TP_STATUS_SEND_REQUEST = global i32 0
@TP_STATUS_SENDING = global i32 0
define i32 @__v2_tx_kernel_ready(%struct.tpacket2_hdr* %0) {
%2 = alloca %struct.tpacket2_hdr*
store %struct.tpacket2_hdr* %0, %struct.tpacket2_hdr** %2
%3 = load %struct.tpacket2_hdr*, %struct.tpacket2_hdr** %2
%4 = getelementptr inbounds %struct.tpacket2_hdr, %struct.tpacket2_hdr* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @TP_STATUS_SEND_REQUEST
%7 = load i32, i32* @TP_STATUS_SENDING
%8 = or i32 %6, %7
%9 = and i32 %5, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.tpacket2_hdr = type { i32 }
@TP_STATUS_SEND_REQUEST = global i32 0
@TP_STATUS_SENDING = global i32 0
define i32 @__v2_tx_kernel_ready(%struct.tpacket2_hdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tpacket2_hdr, %struct.tpacket2_hdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @TP_STATUS_SEND_REQUEST
%5 = load i32, i32* @TP_STATUS_SENDING
%6 = or i32 %5, %4
%7 = and i32 %6, %3
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
int main_visibility_checkcom(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @main_visibility_checkcom() {
ret i32 1
}
unsigned asn1_tag(const unsigned char *px, unsigned length,
                  unsigned *r_offset) {
  if (*r_offset >= length)
    return 0;
  return px[(*r_offset)++];
}


x86 assembly (clang, -O0):
<asn1_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
cmp    -0x14(%rbp),%eax
jb     112a <asn1_tag+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1144 <asn1_tag+0x44>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rdx
mov    (%rdx),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,(%rdx)
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_tag>:
mov    (%rdx),%ecx
xor    %eax,%eax
cmp    %esi,%ecx
jae    1111 <asn1_tag+0x11>
lea    0x1(%rcx),%eax
mov    %eax,(%rdx)
movzbl (%rdi,%rcx,1),%eax
ret

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

LLVM IR (-O2):
define i32 @asn1_tag(i8* nocapture %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, %1
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = add nuw i32 %4, 1
store i32 %7, i32* %2
%8 = zext i32 %4 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
br label %12
12: ; preds = %3, %6
%13 = phi i32 [ %11, %6 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ OveroSyncStatsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void OveroSyncStatsRequestUpdate() {
  UAVObjRequestUpdate(OveroSyncStatsHandle());
}


x86 assembly (clang, -O0):
<OveroSyncStatsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <OveroSyncStatsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @OveroSyncStatsRequestUpdate() {
%1 = call i32 (...) @OveroSyncStatsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OveroSyncStatsRequestUpdate() {
%1 = tail call i32 (...) @OveroSyncStatsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;
typedef int u_char;

/* Variables and functions */
u_int16_t ntohs(u_int16_t x) {
  u_char *s = (u_char *)&x;
  return (u_int16_t)(s[0] << 8 | s[1]);
}


x86 assembly (clang, -O0):
<ntohs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ntohs(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = or i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ntohs(i32 %0) {
ret i32 poison
}
unsigned int r2h_bits(int cmd) {
  unsigned int mask = (((cmd) > 0) ? (1 << ((cmd)-1)) : 0);
  if (cmd == 13)
    mask |= ((((14) > 0) ? (1 << ((14) - 1)) : 0) |
             (((9) > 0) ? (1 << ((9) - 1)) : 0) |
             (((15) > 0) ? (1 << ((15) - 1)) : 0) |
             (((4) > 0) ? (1 << ((4) - 1)) : 0) |
             (((16) > 0) ? (1 << ((16) - 1)) : 0));
  else if (cmd == 4)
    mask |= ((((14) > 0) ? (1 << ((14) - 1)) : 0) |
             (((15) > 0) ? (1 << ((15) - 1)) : 0) |
             (((13) > 0) ? (1 << ((13) - 1)) : 0));
  return (mask |= (((32) > 0) ? (1 << ((32) - 1)) : 0));
}


x86 assembly (clang, -O0):
<r2h_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1126 <r2h_bits+0x26>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1130 <r2h_bits+0x30>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xd,-0x4(%rbp)
jne    1150 <r2h_bits+0x50>
mov    -0x8(%rbp),%eax
or     $0xe108,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <r2h_bits+0x6a>
cmpl   $0x4,-0x4(%rbp)
jne    1165 <r2h_bits+0x65>
mov    -0x8(%rbp),%eax
or     $0x7000,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <r2h_bits+0x6a>
mov    -0x8(%rbp),%eax
or     $0x80000000,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2h_bits>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
test   %edi,%edi
cmovg  %edx,%eax
cmp    $0x4,%edi
je     1126 <r2h_bits+0x26>
cmp    $0xd,%edi
jne    112b <r2h_bits+0x2b>
or     $0xe108,%eax
or     $0x80000000,%eax
ret
or     $0x7000,%eax
or     $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @r2h_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %6
%12 = phi i32 [ %9, %6 ], [ 0, %10 ]
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = or i32 %16, 57608
store i32 %17, i32* %3
br label %25
18: ; preds = %11
%19 = load i32, i32* %2
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %3
%23 = or i32 %22, 28672
store i32 %23, i32* %3
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %15
%26 = load i32, i32* %3
%27 = or i32 %26, -2147483648
store i32 %27, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @r2h_bits(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 %4, i32 0
switch i32 %0, label %10 [
i32 13, label %6
i32 4, label %8
]
6: ; preds = %1
%7 = or i32 %5, 57608
br label %10
8: ; preds = %1
%9 = or i32 %5, 28672
br label %10
10: ; preds = %1, %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ], [ %5, %1 ]
%12 = or i32 %11, -2147483648
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
int main(int c, char **args) {
  char *name = "Anubhav Saini";
  int count = 13;
  char CSName[255];
  char buf[255];
  sprintf(buf, args[1]);
  printf("%s is %s in counter_strike.\n", name, buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0xd,-0x1c(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rsi
lea    -0x220(%rbp),%rdx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x100,%rsp
mov    0x8(%rsi),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xed0(%rip),%rdi
lea    0xebb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Anubhav Saini\00"
@.str.1 = [29 x i8] c"%s is %s in counter_strike.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [255 x i8]
%9 = alloca [255 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %6
store i32 13, i32* %7
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @sprintf(i8* %10, i8* %13)
%15 = load i8*, i8** %6
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %15, i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Anubhav Saini\00"
@.str.1 = [29 x i8] c"%s is %s in counter_strike.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int test_imm_D1int64_lowword_reg(long long val) {
  return ((val) & (0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xd1,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D1int64_lowword_reg>:
test   $0xd1,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D1int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 209
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printToEndPtFile(char *, int, int, int, int, double);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char FileName[] = "TestFile";
  printf("%s\n", FileName);
  printToEndPtFile(FileName, 1, 1, 1, 4, 23.53);
  printToEndPtFile(FileName, 2, 1, 1, 4, 53.83);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xed8(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xd(%rbp),%rsi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
lea    -0xd(%rbp),%rdi
mov    $0x1,%ecx
mov    $0x4,%r8d
movsd  0xe9e(%rip),%xmm0
mov    %ecx,%esi
mov    %ecx,%edx
call   1040 <printToEndPtFile@plt>
lea    -0xd(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%ecx
mov    $0x4,%r8d
movsd  0xe71(%rip),%xmm0
mov    %ecx,%edx
call   1040 <printToEndPtFile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x656c694674736554,%rax
69 6c 65
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
movsd  0xeae(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
call   1040 <printToEndPtFile@plt>
movsd  0xe91(%rip),%xmm0
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
call   1040 <printToEndPtFile@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.FileName = [9 x i8] c"TestFile\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
store i32 0, i32* %1
%3 = bitcast [9 x i8]* %2 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%7 = call i32 @printToEndPtFile(i8* %6, i32 1, i32 1, i32 1, i32 4, double 2.353000e+01)
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%9 = call i32 @printToEndPtFile(i8* %8, i32 2, i32 1, i32 1, i32 4, double 5.383000e+01)
ret i32 0
}

LLVM IR (-O2):
@__const.main.FileName = [9 x i8] c"TestFile\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printToEndPtFile(i8* %2, i32 1, i32 1, i32 1, i32 4, double 2.353000e+01)
%5 = call i32 @printToEndPtFile(i8* %2, i32 2, i32 1, i32 1, i32 4, double 5.383000e+01)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void MMX_PSRLW_imm(int dst_reg, int amount) {
  addbyte(0x66);
  addbyte(0x0f);
  addbyte(0x71);
  addbyte(0xc0 | dst_reg | 0x10);
  addbyte(amount);
}


x86 assembly (clang, -O0):
<MMX_PSRLW_imm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x71,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x10,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MMX_PSRLW_imm>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <addbyte@plt>
mov    $0xf,%edi
call   1030 <addbyte@plt>
mov    $0x71,%edi
call   1030 <addbyte@plt>
or     $0xd0,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @MMX_PSRLW_imm(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 102)
%6 = call i32 @addbyte(i32 15)
%7 = call i32 @addbyte(i32 113)
%8 = load i32, i32* %3
%9 = or i32 192, %8
%10 = or i32 %9, 16
%11 = call i32 @addbyte(i32 %10)
%12 = load i32, i32* %4
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @MMX_PSRLW_imm(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 102)
%4 = tail call i32 @addbyte(i32 15)
%5 = tail call i32 @addbyte(i32 113)
%6 = or i32 %0, 208
%7 = tail call i32 @addbyte(i32 %6)
%8 = tail call i32 @addbyte(i32 %1)
ret void
}
/* Variables and functions */
int date_days_in_month(int, int);
int /*<<< orphan*/ printf(char *, int);
void test_days_in_month() {
  printf("should be 31 is = (%d)\n", date_days_in_month(1, 2010));
  printf("should be 28 is = (%d)\n", date_days_in_month(2, 2010));
  printf("should be 29 is = (%d)\n", date_days_in_month(2, 2012));
}


x86 assembly (clang, -O0):
<test_days_in_month>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x7da,%esi
call   1040 <date_days_in_month@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x7da,%esi
call   1040 <date_days_in_month@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x7dc,%esi
call   1040 <date_days_in_month@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_days_in_month>:
push   %rax
mov    $0x1,%edi
mov    $0x7da,%esi
call   1040 <date_days_in_month@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x7da,%esi
call   1040 <date_days_in_month@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2,%edi
mov    $0x7dc,%esi
call   1040 <date_days_in_month@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"should be 31 is = (%d)\0A\00"
@.str.1 = [24 x i8] c"should be 28 is = (%d)\0A\00"
@.str.2 = [24 x i8] c"should be 29 is = (%d)\0A\00"
define void @test_days_in_month() {
%1 = call i32 @date_days_in_month(i32 1, i32 2010)
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @date_days_in_month(i32 2, i32 2010)
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @date_days_in_month(i32 2, i32 2012)
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"should be 31 is = (%d)\0A\00"
@.str.1 = [24 x i8] c"should be 28 is = (%d)\0A\00"
@.str.2 = [24 x i8] c"should be 29 is = (%d)\0A\00"
define void @test_days_in_month() {
%1 = tail call i32 @date_days_in_month(i32 1, i32 2010)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @date_days_in_month(i32 2, i32 2010)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @date_days_in_month(i32 2, i32 2012)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ dopr(char *, size_t, char const *, int /*<<< orphan*/);
int strlen(char *);
int vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
  str[0] = 0;
  dopr(str, count, fmt, args);
  return (strlen(str));
}


x86 assembly (clang, -O0):
<vsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <dopr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsnprintf>:
push   %rbx
mov    %rdi,%rbx
movb   $0x0,(%rdi)
call   1040 <dopr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 0, i8* %10
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @dopr(i8* %11, i64 %12, i8* %13, i32 %14)
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3) {
store i8 0, i8* %0
%5 = tail call i32 @dopr(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = tail call i32 @strlen(i8* %0)
ret i32 %6
}
void SEQUTILreverse(char *seq, int len) {
  register char *a, *z, swap;
  for (a = seq, z = seq + len - 1; a < z; a++, z--)
    ((swap) = (*a), (*a) = (*z), (*z) = (swap));
  return;
}


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

x86 assembly (clang, -O2):
<SEQUTILreverse>:
movslq %esi,%rax
add    %rdi,%rax
add    $0xffffffffffffffff,%rax
cmp    %rdi,%rax
jbe    113c <SEQUTILreverse+0x3c>
add    $0x1,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl -0x1(%rdi),%ecx
movzbl (%rax),%edx
mov    %dl,-0x1(%rdi)
mov    %cl,(%rax)
add    $0xffffffffffffffff,%rax
lea    0x1(%rdi),%rcx
cmp    %rax,%rdi
mov    %rcx,%rdi
jb     1120 <SEQUTILreverse+0x20>
ret

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

LLVM IR (-O2):
define void @SEQUTILreverse(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ugt i8* %5, %0
br i1 %6, label %7, label %15
7: ; preds = %2, %7
%8 = phi i8* [ %13, %7 ], [ %5, %2 ]
%9 = phi i8* [ %12, %7 ], [ %0, %2 ]
%10 = load i8, i8* %9
%11 = load i8, i8* %8
store i8 %11, i8* %9
store i8 %10, i8* %8
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 -1
%14 = icmp ult i8* %12, %13
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ next_line();
int /*<<< orphan*/ print_character(unsigned char);
void print_string(char *data) {
  while (*data != 0) {
    if (*data == '\n')
      next_line();
    else
      print_character(*(unsigned char *)data);
    data++;
  }
}


x86 assembly (clang, -O0):
<print_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1175 <print_string+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1158 <print_string+0x38>
mov    $0x0,%al
call   1030 <next_line@plt>
jmp    1164 <print_string+0x44>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <print_character@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <print_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_string>:
push   %rbx
mov    %rdi,%rbx
jmp    113b <print_string+0x1b>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <next_line@plt>
add    $0x1,%rbx
movzbl (%rbx),%eax
cmp    $0xa,%al
je     1130 <print_string+0x10>
test   %al,%al
je     1154 <print_string+0x34>
movzbl %al,%edi
call   1040 <print_character@plt>
add    $0x1,%rbx
jmp    113b <print_string+0x1b>
pop    %rbx
ret

LLVM IR (-O0):
define void @print_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %19, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %22
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 (...) @next_line()
br label %19
15: ; preds = %8
%16 = load i8*, i8** %2
%17 = load i8, i8* %16
%18 = call i32 @print_character(i8 zeroext %17)
br label %19
19: ; preds = %15, %13
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %3
22: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @print_string(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i8* [ %0, %1 ], [ %10, %9 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 0, label %11
i8 10, label %5
]
5: ; preds = %2
%6 = tail call i32 (...) @next_line()
br label %9
7: ; preds = %2
%8 = tail call i32 @print_character(i8 zeroext %4)
br label %9
9: ; preds = %7, %5
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret void
}
/* Type definitions */
struct context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uplink_plugin_send_message(struct context *, char *, int);
void connected(struct context *context) {
  uplink_plugin_send_message(context, "C", 1);
}


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

x86 assembly (clang, -O2):
<connected>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edx
jmp    1030 <uplink_plugin_send_message@plt>

LLVM IR (-O0):
%struct.context = type { i32 }
@.str = [2 x i8] c"C\00"
define void @connected(%struct.context* %0) {
%2 = alloca %struct.context*
store %struct.context* %0, %struct.context** %2
%3 = load %struct.context*, %struct.context** %2
%4 = call i32 @uplink_plugin_send_message(%struct.context* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
%struct.context = type { i32 }
@.str = [2 x i8] c"C\00"
define void @connected(%struct.context* %0) {
%2 = tail call i32 @uplink_plugin_send_message(%struct.context* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_score(int, int, int);
void write_tomainscore(int score) { write_score(20, 52, score); }


x86 assembly (clang, -O0):
<write_tomainscore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x14,%edi
mov    $0x34,%esi
call   1030 <write_score@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_tomainscore>:
mov    %edi,%edx
mov    $0x14,%edi
mov    $0x34,%esi
jmp    1030 <write_score@plt>

LLVM IR (-O0):
define void @write_tomainscore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write_score(i32 20, i32 52, i32 %3)
ret void
}

LLVM IR (-O2):
define void @write_tomainscore(i32 %0) {
%2 = tail call i32 @write_score(i32 20, i32 52, i32 %0)
ret void
}
void make_hfsplus_decompose_pages() { return; }


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

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

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

LLVM IR (-O2):
define void @make_hfsplus_decompose_pages() {
ret void
}
int test_027(int a, int b, int c, int d) { return a + b + ((c >> 31) & 1); }


x86 assembly (clang, -O0):
<test_027>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x1f,%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_027>:
lea    (%rdi,%rsi,1),%eax
shr    $0x1f,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @test_027(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = load i32, i32* %7
%13 = ashr i32 %12, 31
%14 = and i32 %13, 1
%15 = add nsw i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @test_027(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = lshr i32 %2, 31
%7 = add nsw i32 %5, %6
ret i32 %7
}