xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(size_t, size_t);
void *__xcalloc(size_t nmemb, size_t size, char *file, int line) {
  return calloc(nmemb, size);
}


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

x86 assembly (clang, -O2):
<__xcalloc>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__xcalloc(i64 %0, i64 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %5
}
int IMIN(int m, int n) { return ((((m) < (n)) ? (m) : (n))); }


x86 assembly (clang, -O0):
<IMIN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <IMIN+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <IMIN+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IMIN>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @IMIN(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ terminate(char *);
void sigint_handler(int sig) {
  (void)(sig);
  terminate("interrupted");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<sigint_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <terminate@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<sigint_handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <terminate@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"interrupted\00"
@EXIT_FAILURE = global i32 0
define void @sigint_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @terminate(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"interrupted\00"
@EXIT_FAILURE = global i32 0
define void @sigint_handler(i32 %0) {
%2 = tail call i32 @terminate(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void __attribute__((destructor)) my_fini(void) {}


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @my_fini, i8* null }]
define void @my_fini() {
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @my_fini, i8* null }]
define void @my_fini() {
ret void
}
/* Type definitions */
struct rtbst_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ tree_to_vine(struct rtbst_table *);
int /*<<< orphan*/ vine_to_tree(struct rtbst_table *);
void rtbst_balance(struct rtbst_table *tree) {
  assert(tree != NULL);
  tree_to_vine(tree);
  vine_to_tree(tree);
}


x86 assembly (clang, -O0):
<rtbst_balance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <tree_to_vine@plt>
mov    -0x8(%rbp),%rdi
call   1040 <vine_to_tree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtbst_balance>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1030 <tree_to_vine@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <vine_to_tree@plt>

LLVM IR (-O0):
%struct.rtbst_table = type { i32 }
define void @rtbst_balance(%struct.rtbst_table* %0) {
%2 = alloca %struct.rtbst_table*
store %struct.rtbst_table* %0, %struct.rtbst_table** %2
%3 = load %struct.rtbst_table*, %struct.rtbst_table** %2
%4 = icmp ne %struct.rtbst_table* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.rtbst_table*, %struct.rtbst_table** %2
%8 = call i32 @tree_to_vine(%struct.rtbst_table* %7)
%9 = load %struct.rtbst_table*, %struct.rtbst_table** %2
%10 = call i32 @vine_to_tree(%struct.rtbst_table* %9)
ret void
}

LLVM IR (-O2):
%struct.rtbst_table = type { i32 }
define void @rtbst_balance(%struct.rtbst_table* %0) {
%2 = icmp ne %struct.rtbst_table* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @tree_to_vine(%struct.rtbst_table* %0)
%6 = tail call i32 @vine_to_tree(%struct.rtbst_table* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void sleep_disable() {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/"
         "mock/avr/sleep.c",
         13);
}


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

x86 assembly (clang, -O2):
<sleep_disable>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0xd,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/avr/sleep.c\00"
define void @sleep_disable() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/avr/sleep.c\00"
define void @sleep_disable() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret void
}
void yy_2_LinkOptionGarbage(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_2_LinkOptionGarbage(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
char *read_uint16(char *, int *);
char *read_string(char *buf, char **str, uint16_t *str_len) {
  buf = read_uint16(buf, str_len);
  *str = buf;
  return buf + *str_len + 1;
}


x86 assembly (clang, -O0):
<read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <read_uint16@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1030 <read_uint16@plt>
mov    %rax,(%r14)
movslq (%rbx),%rcx
add    %rcx,%rax
add    $0x1,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @read_string(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 = load i32*, i32** %6
%9 = call i8* @read_uint16(i8* %7, i32* %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8**, i8*** %5
store i8* %10, i8** %11
%12 = load i8*, i8** %4
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
%17 = getelementptr inbounds i8, i8* %16, i64 1
ret i8* %17
}

LLVM IR (-O2):
define i8* @read_string(i8* %0, i8** nocapture writeonly %1, i32* %2) {
%4 = tail call i8* @read_uint16(i8* %0, i32* %2)
store i8* %4, i8** %1
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 1
ret i8* %8
}
void FREE(void *ptr, char *str) {
  bwx_DEBUG(__FUNCTION__);
  free(ptr);
}


x86 assembly (clang, -O0):
<FREE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FREE>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@__FUNCTION__.FREE = [5 x i8] c"FREE\00"
define void @FREE(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.FREE, i64 0, i64 0))
%6 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@__FUNCTION__.FREE = [5 x i8] c"FREE\00"
define void @FREE(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @__FUNCTION__.FREE, i64 0, i64 0))
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int xorshift8();
char rand12() {
  unsigned char res = 13;
  while (res >= 12) {
    res = xorshift8() & 15;
  }
  return res;
}


x86 assembly (clang, -O0):
<rand12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xd,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xc,%eax
jl     113b <rand12+0x2b>
mov    $0x0,%al
call   1030 <xorshift8@plt>
and    $0xf,%eax
mov    %al,-0x1(%rbp)
jmp    111c <rand12+0xc>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand12>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <xorshift8@plt>
and    $0xf,%al
cmp    $0xb,%al
ja     1120 <rand12+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @rand12() {
%1 = alloca i8
store i8 13, i8* %1
br label %2
2: ; preds = %6, %0
%3 = load i8, i8* %1
%4 = zext i8 %3 to i32
%5 = icmp sge i32 %4, 12
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = call i32 (...) @xorshift8()
%8 = and i32 %7, 15
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
br label %2
10: ; preds = %2
%11 = load i8, i8* %1
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @rand12() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @xorshift8()
%3 = trunc i32 %2 to i8
%4 = and i8 %3, 15
%5 = icmp ugt i8 %4, 11
br i1 %5, label %1, label %6
6: ; preds = %1
ret i8 %4
}
void graph_plot(void) {}


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

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

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

LLVM IR (-O2):
define void @graph_plot() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void manos_prepare_watcher_destroy(void *watcher) { free(watcher); }


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

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

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

LLVM IR (-O2):
define void @manos_prepare_watcher_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long time_msf_to_frame(int m, int s, int f) { return (m * 60 + s) * 75 + f; }


x86 assembly (clang, -O0):
<time_msf_to_frame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x3c,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
imul   $0x4b,%eax,%eax
add    -0xc(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_msf_to_frame>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
imul   $0x4b,%eax,%eax
add    %edx,%eax
cltq
ret

LLVM IR (-O0):
define i64 @time_msf_to_frame(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 60
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = mul nsw i32 %10, 75
%12 = load i32, i32* %6
%13 = add nsw i32 %11, %12
%14 = sext i32 %13 to i64
ret i64 %14
}

LLVM IR (-O2):
define i64 @time_msf_to_frame(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 60
%5 = add nsw i32 %4, %1
%6 = mul nsw i32 %5, 75
%7 = add nsw i32 %6, %2
%8 = sext i32 %7 to i64
ret i64 %8
}
int PR8962_e(int *t) {
  if (({ (t ? (int)(int)0L : (int)(int)1L); }))
    return 0;
  return *t;
}


x86 assembly (clang, -O0):
<PR8962_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1133 <PR8962_e+0x33>
movl   $0x0,-0x4(%rbp)
jmp    113c <PR8962_e+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PR8962_e>:
test   %rdi,%rdi
je     1108 <PR8962_e+0x8>
mov    (%rdi),%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @PR8962_e(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = load i32, i32* %0
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ ispunct(int);
void t_ispunct_0x23() {
  Assert_real((ispunct(35)),
              "/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",
              180, ("ispunct should be 1 for #"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x23>:
push   %rbp
mov    %rsp,%rbp
mov    $0x23,%edi
call   1030 <ispunct@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xb4,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x23>:
push   %rax
mov    $0x23,%edi
call   1030 <ispunct@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xb4,%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 = [26 x i8] c"ispunct should be 1 for #\00"
define void @t_ispunct_0x23() {
%1 = call i32 @ispunct(i32 35)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"ispunct should be 1 for #\00"
define void @t_ispunct_0x23() {
%1 = tail call i32 @ispunct(i32 35)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 180, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ protect(int /*<<< orphan*/);
int /*<<< orphan*/ set_led(int /*<<< orphan*/);
void ignore_me(void) {
  protect(0);
  set_led(0);
}


x86 assembly (clang, -O0):
<ignore_me>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <protect@plt>
xor    %edi,%edi
call   1040 <set_led@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignore_me>:
push   %rax
xor    %edi,%edi
call   1030 <protect@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <set_led@plt>

LLVM IR (-O0):
define void @ignore_me() {
%1 = call i32 @protect(i32 0)
%2 = call i32 @set_led(i32 0)
ret void
}

LLVM IR (-O2):
define void @ignore_me() {
%1 = tail call i32 @protect(i32 0)
%2 = tail call i32 @set_led(i32 0)
ret void
}
void gdk_image_put_pixel() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XCharStruct(void) {
  XCharStruct *_p = (XCharStruct *)malloc(sizeof(XCharStruct));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XCharStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XCharStruct+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XCharStruct>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XCharStruct+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @alloc_XCharStruct() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = bitcast i32* %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @alloc_XCharStruct() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_strlist_free() {
  printf("NOT IMPLEMENTED:"
         "pa_strlist_free"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_strlist_free\00"
define i32 @pa_strlist_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int floatformat_always_valid(const struct floatformat *fmt
                             __attribute__((__unused__)),
                             const void *from __attribute__((__unused__))) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.floatformat = type opaque
define i32 @floatformat_always_valid(%struct.floatformat* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ add(int, int, int);
int main() { add(2, 12, 34); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0xc,%esi
mov    $0x22,%edx
call   1030 <add@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0xc,%esi
mov    $0x22,%edx
call   1030 <add@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @add(i32 2, i32 12, i32 34)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @add(i32 2, i32 12, i32 34)
ret i32 0
}
/* Type definitions */
typedef int GLdouble;

/* Variables and functions */
int sqrt(int);
GLdouble length3(GLdouble v[3]) {
  return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
}


x86 assembly (clang, -O0):
<length3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
imul   (%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0x4(%rcx),%eax
add    %eax,%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0x8(%rcx),%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length3>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
imul   %eax,%eax
imul   %ecx,%ecx
add    %eax,%ecx
mov    0x8(%rdi),%edi
imul   %edi,%edi
add    %ecx,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define i32 @length3(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %5, %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = mul nsw i32 %12, %15
%17 = add nsw i32 %9, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = mul nsw i32 %20, %23
%25 = add nsw i32 %17, %24
%26 = call i32 @sqrt(i32 %25)
ret i32 %26
}

LLVM IR (-O2):
define i32 @length3(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, %2
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, %5
%7 = add nuw nsw i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = mul nsw i32 %9, %9
%11 = add nuw nsw i32 %7, %10
%12 = tail call i32 @sqrt(i32 %11)
ret i32 %12
}
/* Variables and functions */
size_t int_hash(const void *const key) {
  size_t i = *(long *)key;
  return i * 2654435761;
}


x86 assembly (clang, -O0):
<int_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movabs $0x9e3779b1,%rax
imul   -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_hash>:
mov    $0x9e3779b1,%eax
imul   (%rdi),%rax
ret

LLVM IR (-O0):
define i64 @int_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i64*
%6 = load i64, i64* %5
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = mul i64 %7, 2654435761
ret i64 %8
}

LLVM IR (-O2):
define i64 @int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = mul i64 %3, 2654435761
ret i64 %4
}
/* Type definitions */
struct RAA {
  int dummy;
};

/* Variables and functions */
struct RAA *real_raa_init(int /*<<< orphan*/);
struct RAA *raa_init(void) {
  return real_raa_init(0);
}


x86 assembly (clang, -O0):
<raa_init>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <real_raa_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<raa_init>:
xor    %edi,%edi
jmp    1030 <real_raa_init@plt>

LLVM IR (-O0):
%struct.RAA = type { i32 }
define %struct.RAA* @raa_init() {
%1 = call %struct.RAA* @real_raa_init(i32 0)
ret %struct.RAA* %1
}

LLVM IR (-O2):
%struct.RAA = type { i32 }
define %struct.RAA* @raa_init() {
%1 = tail call %struct.RAA* @real_raa_init(i32 0)
ret %struct.RAA* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int print_done_without_loop(unsigned int times) {
  if (times) {
    printf("DONE\n");
    print_done_without_loop(times - 1);
  }
}


x86 assembly (clang, -O0):
<print_done_without_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <print_done_without_loop+0x2c>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <print_done_without_loop@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_done_without_loop>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
je     113d <print_done_without_loop+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebx
jne    1130 <print_done_without_loop+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@str = [5 x i8] c"DONE\00"
define i32 @print_done_without_loop(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = add i32 %4, -1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret i32 undef
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ _stdout_hook(int);
scalar_t__ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int puts(const char *string) {
  if (fputs(string, stdout) == EOF) {
    return EOF;
  }
  return (_stdout_hook((int)'\n') == EOF) ? EOF : 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
jne    1160 <puts+0x40>
mov    0x2e93(%rip),%rax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
jmp    119f <puts+0x7f>
mov    $0xa,%edi
call   1030 <_stdout_hook@plt>
mov    0x2e77(%rip),%rcx
cmp    (%rcx),%rax
jne    118d <puts+0x6d>
mov    0x2e67(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1198 <puts+0x78>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1198 <puts+0x78>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    0x2eb2(%rip),%rbx
cmp    (%rbx),%rax
je     1153 <puts+0x33>
mov    $0xa,%edi
call   1030 <_stdout_hook@plt>
mov    %rax,%rcx
mov    (%rbx),%rax
xor    %edx,%edx
cmp    %rax,%rcx
cmovne %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@EOF = global i64 0
define i32 @puts(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @stdout
%6 = call i64 @fputs(i8* %4, i32 %5)
%7 = load i64, i64* @EOF
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i64, i64* @EOF
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
br label %22
12: ; preds = %1
%13 = call i64 @_stdout_hook(i32 10)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i64, i64* @EOF
br label %19
18: ; preds = %12
br label %19
19: ; preds = %18, %16
%20 = phi i64 [ %17, %16 ], [ 0, %18 ]
%21 = trunc i64 %20 to i32
store i32 %21, i32* %2
br label %22
22: ; preds = %19, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@stdout = global i32 0
@EOF = global i64 0
define i32 @puts(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i64 @fputs(i8* %0, i32 %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = trunc i64 %3 to i32
br label %14
8: ; preds = %1
%9 = tail call i64 @_stdout_hook(i32 10)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
%12 = trunc i64 %10 to i32
%13 = select i1 %11, i32 %12, i32 0
br label %14
14: ; preds = %8, %6
%15 = phi i32 [ %7, %6 ], [ %13, %8 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glRasterPos2sv(int /*<<< orphan*/ *);
void RasterPos2sv(GLshort v[2]) { glRasterPos2sv(v); }


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

x86 assembly (clang, -O2):
<RasterPos2sv>:
jmp    1030 <glRasterPos2sv@plt>

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

LLVM IR (-O2):
define void @RasterPos2sv(i32* %0) {
%2 = tail call i32 @glRasterPos2sv(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int counter = 1;
  while (counter <= 10) {
    if (counter == 5)
      break;
    printf("%i\n", counter);
    counter++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     115c <main+0x4c>
cmpl   $0x5,-0x8(%rbp)
jne    113f <main+0x2f>
jmp    115c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 5
br i1 %8, label %9, label %10
9: ; preds = %6
br label %15
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %3
15: ; preds = %9, %3
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)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
float dt_fast_expf(const float x) {
  const int i1 = 0x3f800000u;
  const int i2 = 0x402DF854u;
  const int k0 = i1 + x * (i2 - i1);
  union {
    float f;
    int k;
  } u;
  u.k = k0 > 0 ? k0 : 0;
  return u.f;
}


x86 assembly (clang, -O0):
<dt_fast_expf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movl   $0x3f800000,-0x8(%rbp)
movl   $0x402df854,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xedc(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xed4(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1150 <dt_fast_expf+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <dt_fast_expf+0x5a>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    115a <dt_fast_expf+0x5a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_fast_expf>:
mulss  0xef8(%rip),%xmm0
addss  0xef4(%rip),%xmm0
cvttss2si %xmm0,%eax
xor    %ecx,%ecx
test   %eax,%eax
cmovns %eax,%ecx
movd   %ecx,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @dt_fast_expf(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %union.anon
store float %0, float* %2
store i32 1065353216, i32* %3
store i32 1076754516, i32* %4
%7 = load float, float* %2
%8 = call float @llvm.fmuladd.f32(float %7, float 1.140130e+07, float 0x41CFC00000000000)
%9 = fptosi float %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = load i32, i32* %5
br label %15
14: ; preds = %1
br label %15
15: ; preds = %14, %12
%16 = phi i32 [ %13, %12 ], [ 0, %14 ]
%17 = bitcast %union.anon* %6 to i32*
store i32 %16, i32* %17
%18 = bitcast %union.anon* %6 to float*
%19 = load float, float* %18
ret float %19
}

LLVM IR (-O2):
define float @dt_fast_expf(float %0) {
%2 = tail call float @llvm.fmuladd.f32(float %0, float 1.140130e+07, float 0x41CFC00000000000)
%3 = fptosi float %2 to i32
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
%6 = bitcast i32 %5 to float
ret float %6
}
/* Type definitions */
typedef char uint32_t;

/* Variables and functions */
int strlen(char *);
int str2sig(char *arg, uint32_t *sig) {
  if (strlen(arg) != 4)
    return -1;
  *sig = arg[0] | (arg[1] << 8) | (arg[2] << 16) | (arg[3] << 24);
  return 0;
}


x86 assembly (clang, -O0):
<str2sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
je     113e <str2sig+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    117b <str2sig+0x6b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movsbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2sig>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    $0x4,%ecx
jne    1132 <str2sig+0x22>
mov    (%rbx),%al
mov    %al,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @str2sig(i8* %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp eq i32 %3, 4
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = load i8, i8* %0
store i8 %6, i8* %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_standard_pole_step(double *step) {
  int fail;
  int precision = 0;
  int *b;
  fail = _ada_use_c2phc4c(886, &precision, b, step, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_standard_pole_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x376,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_standard_pole_step>:
push   %rax
mov    %rdi,%rcx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x376,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_get_standard_pole_step(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store double* %0, double** %2
store i32 0, i32* %4
%6 = load i32*, i32** %5
%7 = load double*, double** %2
%8 = call i32 @_ada_use_c2phc4c(i32 886, i32* %4, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @padcon_get_standard_pole_step(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 886, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
void WriteLevel(char *filename) {}


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

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

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

LLVM IR (-O2):
define void @WriteLevel(i8* nocapture %0) {
ret void
}
int test_and_set_bit(unsigned long nr, unsigned long *bitmap) {
  unsigned long offset = nr / ((int)sizeof(long) * 8);
  unsigned long bit = nr & (((int)sizeof(long) * 8) - 1);
  int rc = (bitmap[offset] >> bit) & 1;
  bitmap[offset] |= 1UL << bit;
  return rc;
}


x86 assembly (clang, -O0):
<test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x6,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    $0x3f,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x20(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set_bit>:
mov    %rdi,%rcx
mov    %rdi,%rdx
shr    $0x6,%rdx
mov    (%rsi,%rdx,8),%rdi
mov    %rdi,%rax
shr    %cl,%rax
and    $0x1,%eax
bts    %rcx,%rdi
mov    %rdi,(%rsi,%rdx,8)
ret

LLVM IR (-O0):
define i32 @test_and_set_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%8 = load i64, i64* %3
%9 = udiv i64 %8, 64
store i64 %9, i64* %5
%10 = load i64, i64* %3
%11 = and i64 %10, 63
store i64 %11, i64* %6
%12 = load i64*, i64** %4
%13 = load i64, i64* %5
%14 = getelementptr inbounds i64, i64* %12, i64 %13
%15 = load i64, i64* %14
%16 = load i64, i64* %6
%17 = lshr i64 %15, %16
%18 = and i64 %17, 1
%19 = trunc i64 %18 to i32
store i32 %19, i32* %7
%20 = load i64, i64* %6
%21 = shl i64 1, %20
%22 = load i64*, i64** %4
%23 = load i64, i64* %5
%24 = getelementptr inbounds i64, i64* %22, i64 %23
%25 = load i64, i64* %24
%26 = or i64 %25, %21
store i64 %26, i64* %24
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @test_and_set_bit(i64 %0, i64* nocapture %1) {
%3 = lshr i64 %0, 6
%4 = and i64 %0, 63
%5 = getelementptr inbounds i64, i64* %1, i64 %3
%6 = load i64, i64* %5
%7 = lshr i64 %6, %4
%8 = trunc i64 %7 to i32
%9 = and i32 %8, 1
%10 = shl nuw i64 1, %4
%11 = or i64 %6, %10
store i64 %11, i64* %5
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void DieWithSystemMessage(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<DieWithSystemMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<DieWithSystemMessage>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @DieWithSystemMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @DieWithSystemMessage(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
#pragma omp parallel for
  for (int i = 0; i < 100; i++) {
    printf("tid=%d\n", omp_get_thread_num());
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    116a <main+0x4a>
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    $0x64,%ebp
lea    0xed1(%rip),%rbx
nop
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0xffffffff,%ebp
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"tid=%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = call i32 (...) @omp_get_thread_num()
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"tid=%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %8, %4 ]
%6 = tail call i32 (...) @omp_get_thread_num()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 100
br i1 %9, label %3, label %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(int argc, char **argv) { return (EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int *malloc_wrapper() { return (int *)malloc(sizeof(int)); }


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

x86 assembly (clang, -O2):
<malloc_wrapper>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @malloc_wrapper() {
%1 = call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
define i32* @malloc_wrapper() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
/* Variables and functions */
int cg_unified_cached(int);
int cg_unified(void) { return cg_unified_cached(true); }


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

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

LLVM IR (-O0):
define i32 @cg_unified() {
%1 = call i32 @cg_unified_cached(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @cg_unified() {
%1 = tail call i32 @cg_unified_cached(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void evilfunction(char *input) {
  char buffer[1000];
  strcpy(buffer, input);
}


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

x86 assembly (clang, -O2):
<evilfunction>:
sub    $0x3e8,%rsp
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <strcpy@plt>
add    $0x3e8,%rsp
ret

LLVM IR (-O0):
define void @evilfunction(i8* %0) {
%2 = alloca i8*
%3 = alloca [1000 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %4, i8* %5)
ret void
}

LLVM IR (-O2):
define void @evilfunction(i8* %0) {
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
ret void
}