xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ W_OK;
int access(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  int result;
  const char *filename = argv[1];
  result = access(filename, W_OK);
  printf("result is %i\n\n", result);
  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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@W_OK = global i32 0
@.str = [15 x i8] c"result is %i\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = load i32, i32* @W_OK
%13 = call i32 @access(i8* %11, i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@W_OK = global i32 0
@.str = [15 x i8] c"result is %i\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @W_OK
%6 = tail call i32 @access(i8* %4, i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ opt;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int reuse_addr(int fd) {
  int opt = 1;
  int ret = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt));
  return ret;
}


x86 assembly (clang, -O0):
<reuse_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reuse_addr>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @reuse_addr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_REUSEADDR
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %3, i32 4)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @reuse_addr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ botsub(int, char *);
void bot_spellx(void) { botsub((((16) << 16) + ((9) << 8) + (18)), "%2ld"); }


x86 assembly (clang, -O0):
<bot_spellx>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100912,%edi
lea    0xee0(%rip),%rsi
call   1030 <botsub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_spellx>:
lea    0xee9(%rip),%rsi
mov    $0x100912,%edi
jmp    1030 <botsub@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%2ld\00"
define void @bot_spellx() {
%1 = call i32 @botsub(i32 1050898, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2ld\00"
define void @bot_spellx() {
%1 = tail call i32 @botsub(i32 1050898, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int array_sum(int *);
int /*<<< orphan*/ foo(int *);
int main(void) {
  int a[50];
  foo(a);
  int res = array_sum(a);
  if (res != 30)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xd0(%rbp),%rdi
call   1040 <foo@plt>
lea    -0xd0(%rbp),%rdi
call   1050 <array_sum@plt>
mov    %eax,-0xd4(%rbp)
cmpl   $0x1e,-0xd4(%rbp)
je     1174 <main+0x44>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <foo@plt>
mov    %rbx,%rdi
call   1050 <array_sum@plt>
cmp    $0x1e,%eax
jne    115b <main+0x2b>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%5 = call i32 @foo(i32* %4)
%6 = getelementptr inbounds [50 x i32], [50 x i32]* %2, i64 0, i64 0
%7 = call i32 @array_sum(i32* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 30
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [50 x i32]
%2 = bitcast [50 x i32]* %1 to i8*
%3 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3)
%5 = call i32 @array_sum(i32* %3)
%6 = icmp eq i32 %5, 30
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ stackoverflow();
void main() { stackoverflow(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @stackoverflow()
ret void
}
int equal_char(void *a, void *b) {
  char *aa, *bb;
  aa = (char *)a;
  bb = (char *)b;
  return *aa = *bb;
}


x86 assembly (clang, -O0):
<equal_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_char>:
movsbl (%rsi),%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define i32 @equal_char(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = load i8, i8* %9
%11 = load i8*, i8** %5
store i8 %10, i8* %11
%12 = sext i8 %10 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @equal_char(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = sext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void aw_bdb_close_cursor(void *v_mydbc) {
  fatal("BerkeleyDB support not compiled");
}


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

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

LLVM IR (-O0):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define void @aw_bdb_close_cursor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"BerkeleyDB support not compiled\00"
define void @aw_bdb_close_cursor(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isblank(int);
int isspace(int c) {
  if (isblank(c) || c == '\r' || c == '\n')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
jne    1141 <isspace+0x31>
cmpl   $0xd,-0x8(%rbp)
je     1141 <isspace+0x31>
cmpl   $0xa,-0x8(%rbp)
jne    114d <isspace+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <isspace+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
push   %rbx
mov    %edi,%ebx
call   1030 <isblank@plt>
test   %rax,%rax
setne  %al
cmp    $0xd,%ebx
sete   %cl
cmp    $0xa,%ebx
sete   %dl
or     %cl,%dl
or     %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = tail call i64 @isblank(i32 %0)
%3 = freeze i64 %2
%4 = icmp ne i64 %3, 0
%5 = icmp eq i32 %0, 13
%6 = icmp eq i32 %0, 10
%7 = or i1 %5, %6
%8 = or i1 %7, %4
%9 = zext i1 %8 to i32
ret i32 %9
}
void paths(void) {
  int x;
  int y = 0;
  while (y == 1) {
    x = 3;
  }
  y += x;
}


x86 assembly (clang, -O0):
<paths>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1121 <paths+0x21>
movl   $0x3,-0x4(%rbp)
jmp    110b <paths+0xb>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @paths() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 3, i32* %1
br label %3
7: ; preds = %3
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
ret void
}

LLVM IR (-O2):
define void @paths() {
ret void
}
/* Variables and functions */
int __infer_nondet_int();
int isascii(int x) { return __infer_nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
int dummy(int i) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dummy(i32 %0) {
ret i32 0
}
double opr_me(struct lifo *stack) { return 9.1093826E-31; }


x86 assembly (clang, -O0):
<opr_me>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  0xef0(%rip),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.lifo = type opaque
define double @opr_me(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
store %struct.lifo* %0, %struct.lifo** %2
ret double 0x39B279DCA33B4CD7
}

LLVM IR (-O2):
%struct.lifo = type opaque
define double @opr_me(%struct.lifo* nocapture readnone %0) {
ret double 0x39B279DCA33B4CD7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void _f_i_i(int a, int b) { printf("a:int,   b:int\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"a:int, b:int\0A\00"
define void @_f_i_i(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"a:int, b:int\00"
define void @_f_i_i(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: gbp-wrapper [options] executable [executable arguments]\n");
  printf("\n");
  printf(
      "  gbp-wrapper starts an executable with global breakpoints enabled.\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf02(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Usage: gbp-wrapper [options]\C2\A0executable [executable arguments]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [69 x i8] c" gbp-wrapper starts an executable with global breakpoints enabled.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"Usage: gbp-wrapper [options]\C2\A0executable [executable arguments]\00"
@str.3 = [68 x i8] c" gbp-wrapper starts an executable with global breakpoints enabled.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.3, i64 0, i64 0))
ret void
}
char *rname(path)
char *path;
{
  char *ind;
  return ((ind = strrchr(path, '/')) ? ind + 1 : path);
}


x86 assembly (clang, -O0):
<rname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1149 <rname+0x39>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <rname+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rname>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @rname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i32 47)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
br label %12
10: ; preds = %1
%11 = load i8*, i8** %2
br label %12
12: ; preds = %10, %7
%13 = phi i8* [ %9, %7 ], [ %11, %10 ]
ret i8* %13
}

LLVM IR (-O2):
define i8* @rname(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int intlog2_bound(int);
int intlog2_bound_bound(int x) { return intlog2_bound(x); }


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

x86 assembly (clang, -O2):
<intlog2_bound_bound>:
jmp    1030 <intlog2_bound@plt>

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

LLVM IR (-O2):
define i32 @intlog2_bound_bound(i32 %0) {
%2 = tail call i32 @intlog2_bound(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_BINDTODEVICE;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char const *,
               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int sdev_bind(int fd, const char *iface) {
  return (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, iface, strlen(iface)));
}


x86 assembly (clang, -O0):
<sdev_bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    %eax,%r8d
call   1030 <setsockopt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdev_bind>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%r14d
mov    0x2eb4(%rip),%rax
mov    (%rax),%r15d
mov    0x2e9a(%rip),%rax
mov    (%rax),%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14d,%edi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %eax,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <setsockopt@plt>

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_BINDTODEVICE = global i32 0
define i32 @sdev_bind(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_BINDTODEVICE
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_BINDTODEVICE = global i32 0
define i32 @sdev_bind(i32 %0, i8* %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_BINDTODEVICE
%5 = tail call i32 @strlen(i8* %1)
%6 = tail call i32 @setsockopt(i32 %0, i32 %3, i32 %4, i8* %1, i32 %5)
ret i32 %6
}
int calc_bits_needed(unsigned long spread) {
  int nbit = 0;
  if (spread == 0)
    return nbit;
  while (spread > 0) {
    spread /= 2;
    nbit++;
  }
  return nbit;
}


x86 assembly (clang, -O0):
<calc_bits_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1125 <calc_bits_needed+0x25>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <calc_bits_needed+0x55>
jmp    112a <calc_bits_needed+0x2a>
cmpq   $0x0,-0x10(%rbp)
jbe    114f <calc_bits_needed+0x4f>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <calc_bits_needed+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_bits_needed>:
xor    %eax,%eax
test   %rdi,%rdi
je     111f <calc_bits_needed+0x1f>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
shr    %rcx
add    $0x1,%eax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <calc_bits_needed+0x10>
ret

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

LLVM IR (-O2):
define i32 @calc_bits_needed(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strcmp(char *, char *);
int main() {
  int x;
  char s[20] = "Hola mundo";
  char t[20] = "Hola mund";
  x = strcmp(s, t);
  printf("%i\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xec6(%rip),%eax
mov    %eax,-0x30(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.s = [20 x i8] c"Hola mundo\00\00\00\00\00\00\00\00\00\00"
@__const.main.t = [20 x i8] c"Hola mund\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
store i32 0, i32* %1
%5 = bitcast [20 x i8]* %3 to i8*
%6 = bitcast [20 x i8]* %4 to i8*
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%9 = call i32 @strcmp(i8* %7, i8* %8)
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
void *mb_correct_addr_and_bit(int *, void *);
int test_bit_le(int, void *);
__attribute__((always_)) __attribute__((no_instrument_function)) int
mb_test_bit(int bit, void *addr) {
  addr = mb_correct_addr_and_bit(&bit, addr);
  return test_bit_le(bit, addr);
}


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

x86 assembly (clang, -O2):
<mb_test_bit>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    0x4(%rsp),%edi
mov    %rax,%rsi
call   1040 <test_bit_le@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mb_test_bit(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %1)
%5 = load i32, i32* %3
%6 = call i32 @test_bit_le(i32 %5, i8* %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIGTERM;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void begin_server(void) {
  signal(SIGINT, SIG_DFL);
  signal(SIGTERM, SIG_DFL);
}


x86 assembly (clang, -O0):
<begin_server>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<begin_server>:
push   %rbx
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rbx
mov    (%rbx),%esi
call   1030 <signal@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%esi
pop    %rbx
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGTERM = global i32 0
define void @begin_server() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGTERM
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
@SIGTERM = global i32 0
define void @begin_server() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = load i32, i32* @SIGTERM
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int signalOf(long);
int cmp(const void *a, const void *b) {
  return signalOf((*(long *)a - *(long *)b));
}


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

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rdi
sub    (%rsi),%rdi
jmp    1030 <signalOf@plt>

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = call i32 @signalOf(i64 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = tail call i32 @signalOf(i64 %7)
ret i32 %8
}
int __objc_dynamic_init(const char *exec_path) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__objc_dynamic_init(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ number_get_digits(long, int **, unsigned int *);
void test_number_get_digits() {
  int *digits;
  unsigned int len;
  digits = malloc(sizeof(int));
  long int number = 1529587;
  number_get_digits(number, &digits, &len);
  for (int i = len; i > 0; --i) {
  }
  free(digits);
}


x86 assembly (clang, -O0):
<test_number_get_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
movq   $0x1756f3,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <number_get_digits@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    1182 <test_number_get_digits+0x52>
jmp    1174 <test_number_get_digits+0x44>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1165 <test_number_get_digits+0x35>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_number_get_digits>:
sub    $0x18,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
mov    $0x1756f3,%edi
call   1040 <number_get_digits@plt>
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @test_number_get_digits() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %1
store i64 1529587, i64* %3
%6 = load i64, i64* %3
%7 = call i32 @number_get_digits(i64 %6, i32** %1, i32* %2)
%8 = load i32, i32* %2
store i32 %8, i32* %4
br label %9
9: ; preds = %13, %0
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
br label %13
13: ; preds = %12
%14 = load i32, i32* %4
%15 = add nsw i32 %14, -1
store i32 %15, i32* %4
br label %9
16: ; preds = %9
%17 = load i32*, i32** %1
%18 = call i32 @free(i32* %17)
ret void
}

LLVM IR (-O2):
define void @test_number_get_digits() {
%1 = alloca i32*
%2 = alloca i32
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32* @malloc(i32 4)
store i32* %5, i32** %1
%6 = call i32 @number_get_digits(i64 1529587, i32** %1, i32* %2)
%7 = load i32*, i32** %1
%8 = call i32 @free(i32* %7)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tm_to_time(struct tm *);
time_t timegm(struct tm *tm) { return tm_to_time(tm); }


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

x86 assembly (clang, -O2):
<timegm>:
jmp    1030 <tm_to_time@plt>

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @timegm(%struct.tm* %0) {
%2 = tail call i32 @tm_to_time(%struct.tm* %0)
ret i32 %2
}
/* Variables and functions */
char *strdup(char *);
int /*<<< orphan*/ xnomem(char *);
char *xstrdup(char *s) {
  char *c = strdup(s);
  xnomem(c);
  return c;
}


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

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <xnomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i32 @xnomem(i8* %2)
ret i8* %2
}
void g_random_int() {}


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

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

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

LLVM IR (-O2):
define void @g_random_int() {
ret void
}
int _dlinfo(void *ptr1, int x, void *ptr2) {}


x86 assembly (clang, -O0):
<_dlinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_dlinfo(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void md_free_int(int *fld) {
  free(fld);
  fld = NULL;
}


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

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

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

LLVM IR (-O2):
define void @md_free_int(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
extern signed char ReturnByte() { return -103; }


x86 assembly (clang, -O0):
<ReturnByte>:
push   %rbp
mov    %rsp,%rbp
mov    $0x99,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReturnByte>:
mov    $0x99,%al
ret

LLVM IR (-O0):
define signext i8 @ReturnByte() {
ret i8 -103
}

LLVM IR (-O2):
define signext i8 @ReturnByte() {
ret i8 -103
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cginc1pi(int v) { ngen("%s\t$%d,(%%rax)", "addq", v); }


x86 assembly (clang, -O0):
<cginc1pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginc1pi>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeef(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s\09$%d,(%%rax)\00"
@.str.1 = [5 x i8] c"addq\00"
define void @cginc1pi(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s\09$%d,(%%rax)\00"
@.str.1 = [5 x i8] c"addq\00"
define void @cginc1pi(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
double log10(double);
double db10_0_(int n, double *x) {
  if (*x < 1e-20) {
    return -999.99f;
  }
  double f = (n == 1) ? 20.f : 10.f;
  return f * log10(*x);
}


x86 assembly (clang, -O0):
<db10_0_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xed5(%rip),%xmm0
ucomisd (%rax),%xmm0
jbe    1147 <db10_0_+0x37>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ad <db10_0_+0x9d>
mov    -0xc(%rbp),%eax
movss  0xebe(%rip),%xmm0
movss  0xeba(%rip),%xmm1
movss  %xmm1,-0x28(%rbp)
cmp    $0x1,%eax
movss  %xmm0,-0x24(%rbp)
je     1177 <db10_0_+0x67>
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <log10@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db10_0_>:
push   %rbx
movsd  (%rsi),%xmm0
movsd  0xeeb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    112d <db10_0_+0x1d>
movsd  0xed5(%rip),%xmm0
pop    %rbx
ret
xor    %ebx,%ebx
cmp    $0x1,%edi
sete   %bl
call   1030 <log10@plt>
lea    0xecf(%rip),%rax
mulsd  (%rax,%rbx,8),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @db10_0_(i32 %0, double* %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double*
%6 = alloca double
store i32 %0, i32* %4
store double* %1, double** %5
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = fcmp olt double %8, 0x3BC79CA10C924223
br i1 %9, label %10, label %11
10: ; preds = %2
store double 0xC08F3FEB80000000, double* %3
br label %22
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
%14 = zext i1 %13 to i64
%15 = select i1 %13, float 2.000000e+01, float 1.000000e+01
%16 = fpext float %15 to double
store double %16, double* %6
%17 = load double, double* %6
%18 = load double*, double** %5
%19 = load double, double* %18
%20 = call double @log10(double %19)
%21 = fmul double %17, %20
store double %21, double* %3
br label %22
22: ; preds = %11, %10
%23 = load double, double* %3
ret double %23
}

LLVM IR (-O2):
define double @db10_0_(i32 %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp olt double %3, 0x3BC79CA10C924223
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = icmp eq i32 %0, 1
%7 = select i1 %6, double 2.000000e+01, double 1.000000e+01
%8 = tail call double @log10(double %3)
%9 = fmul double %7, %8
br label %10
10: ; preds = %2, %5
%11 = phi double [ %9, %5 ], [ 0xC08F3FEB80000000, %2 ]
ret double %11
}
/* Variables and functions */
char *U_EMR_CORE5_set(int);
char *U_EMRSAVEDC_set(void) { return (U_EMR_CORE5_set(33)); }


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

x86 assembly (clang, -O2):
<U_EMRSAVEDC_set>:
mov    $0x21,%edi
jmp    1030 <U_EMR_CORE5_set@plt>

LLVM IR (-O0):
define i8* @U_EMRSAVEDC_set() {
%1 = call i8* @U_EMR_CORE5_set(i32 33)
ret i8* %1
}

LLVM IR (-O2):
define i8* @U_EMRSAVEDC_set() {
%1 = tail call i8* @U_EMR_CORE5_set(i32 33)
ret i8* %1
}
char *strcpy(char *s, const char *ct) {
  char *s1 = s;
  if (s1 && ct) {
    while ((*s1++ = *ct++) != '\0') {
    };
  }
  return (s);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1167 <strcpy+0x67>
cmpq   $0x0,-0x10(%rbp)
je     1167 <strcpy+0x67>
jmp    112f <strcpy+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1162 <strcpy+0x62>
jmp    112f <strcpy+0x2f>
jmp    1167 <strcpy+0x67>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
test   %rdi,%rdi
je     111f <strcpy+0x1f>
test   %rsi,%rsi
je     111f <strcpy+0x1f>
xor    %ecx,%ecx
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %1, %2 ]
%8 = phi i8* [ %11, %6 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %7
%11 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %10, i8* %8
%12 = icmp eq i8 %10, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xcf() {
  Assert_real((ispunct(207) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              1040, ("ispunct should be 0 for 0xcf"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xcf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcf,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x410,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x410,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xcf\00"
define void @t_ispunct_0xcf() {
%1 = call i64 @ispunct(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xcf\00"
define void @t_ispunct_0xcf() {
%1 = tail call i64 @ispunct(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int lower(int c) {
  if (c >= 'A' && c <= 'Z')
    return (c + 'a' - 'A');
  else
    return c;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     112c <lower+0x2c>
cmpl   $0x5a,-0x8(%rbp)
jg     112c <lower+0x2c>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <lower+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @lower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 97
%12 = sub nsw i32 %11, 65
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void GPMCLimitedAddrDevSupportConfig(unsigned int baseAddr, unsigned int flag) {
  if (flag == (1)) {
    (*((volatile unsigned int *)(baseAddr + (0x50)))) |= ((0x00000002u));
  } else if (flag == (0)) {
    (*((volatile unsigned int *)(baseAddr + (0x50)))) &= (~(0x00000002u));
  }
}


x86 assembly (clang, -O0):
<GPMCLimitedAddrDevSupportConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1128 <GPMCLimitedAddrDevSupportConfig+0x28>
mov    -0x4(%rbp),%eax
add    $0x50,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    %ecx,(%rax)
jmp    1146 <GPMCLimitedAddrDevSupportConfig+0x46>
cmpl   $0x0,-0x8(%rbp)
jne    1141 <GPMCLimitedAddrDevSupportConfig+0x41>
mov    -0x4(%rbp),%eax
add    $0x50,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    %ecx,(%rax)
jmp    1146 <GPMCLimitedAddrDevSupportConfig+0x46>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCLimitedAddrDevSupportConfig>:
test   %esi,%esi
je     1110 <GPMCLimitedAddrDevSupportConfig+0x10>
cmp    $0x1,%esi
jne    1116 <GPMCLimitedAddrDevSupportConfig+0x16>
add    $0x50,%edi
orl    $0x2,(%rdi)
ret
add    $0x50,%edi
andl   $0xfffffffd,(%rdi)
ret

LLVM IR (-O0):
define void @GPMCLimitedAddrDevSupportConfig(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add i32 %8, 80
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
%13 = or i32 %12, 2
store volatile i32 %13, i32* %11
br label %25
14: ; preds = %2
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i32, i32* %3
%19 = add i32 %18, 80
%20 = zext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load volatile i32, i32* %21
%23 = and i32 %22, -3
store volatile i32 %23, i32* %21
br label %24
24: ; preds = %17, %14
br label %25
25: ; preds = %24, %7
ret void
}

LLVM IR (-O2):
define void @GPMCLimitedAddrDevSupportConfig(i32 %0, i32 %1) {
switch i32 %1, label %15 [
i32 1, label %3
i32 0, label %9
]
3: ; preds = %2
%4 = add i32 %0, 80
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 2
store volatile i32 %8, i32* %6
br label %15
9: ; preds = %2
%10 = add i32 %0, 80
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
%14 = and i32 %13, -3
store volatile i32 %14, i32* %12
br label %15
15: ; preds = %2, %9, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void print_event_to_log(Display *dpy, XEvent *ev) {}


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

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

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

LLVM IR (-O2):
define void @print_event_to_log(i32* nocapture %0, i32* nocapture %1) {
ret void
}