xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ do_stuff(int);
int /*<<< orphan*/ printf(char *);
void recurse(int ctr, int v) {
  if (ctr--) {
    recurse(ctr, v);
  } else {
    do_stuff(v);
  }
  printf("ERROR!\n");
}


x86 assembly (clang, -O0):
<recurse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1162 <recurse+0x32>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <recurse@plt>
jmp    116a <recurse+0x3a>
mov    -0x8(%rbp),%edi
call   1050 <do_stuff@plt>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recurse>:
push   %rax
test   %edi,%edi
je     113f <recurse+0xf>
add    $0xffffffff,%edi
call   1030 <recurse@plt>
jmp    1146 <recurse+0x16>
mov    %esi,%edi
call   1050 <do_stuff@plt>
lea    0xeb3(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR!\0A\00"
define void @recurse(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 = add nsw i32 %5, -1
store i32 %6, i32* %3
%7 = icmp ne i32 %5, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
br label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @do_stuff(i32 %12)
br label %14
14: ; preds = %11, %8
%15 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"ERROR!\00"
define void @recurse(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = add nsw i32 %0, -1
tail call void @recurse(i32 %5, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @do_stuff(i32 %1)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int compare_size_t(const void *a, const void *b) {
  return *((size_t *)a) - *((size_t *)b);
}


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

x86 assembly (clang, -O2):
<compare_size_t>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_size_t(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 i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @compare_size_t(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 i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hola mundo.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hola mundo.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
void zerovector(float *result) { memset(result, 0, 12); }


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

x86 assembly (clang, -O2):
<zerovector>:
xor    %esi,%esi
mov    $0xc,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @zerovector(float* %0) {
%2 = tail call i32 @memset(float* %0, i32 0, i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void rm(char *command) { remove(command); }


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

x86 assembly (clang, -O2):
<rm>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @rm(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
void _M2_errno_finish(int argc, char *p) {}


x86 assembly (clang, -O0):
<_M2_errno_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_M2_errno_finish(i32 %0, i8* nocapture %1) {
ret void
}
void gzip_free(struct connection *conn) {}


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

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

LLVM IR (-O0):
%struct.connection = type opaque
define void @gzip_free(%struct.connection* %0) {
%2 = alloca %struct.connection*
store %struct.connection* %0, %struct.connection** %2
ret void
}

LLVM IR (-O2):
%struct.connection = type opaque
define void @gzip_free(%struct.connection* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello\n");
  return 0;
  printf("MY world!!!!111\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mdelay(int);
void blogic_delay(int seconds) { mdelay(1000 * seconds); }


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

x86 assembly (clang, -O2):
<blogic_delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <mdelay@plt>

LLVM IR (-O0):
define void @blogic_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @mdelay(i32 %4)
ret void
}

LLVM IR (-O2):
define void @blogic_delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @mdelay(i32 %2)
ret void
}
void CFGMR3GetParent(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3GetParent() {
ret void
}
/* Variables and functions */
int count_change(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) { printf("%d\n", count_change(100)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x64,%edi
call   1030 <count_change@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @count_change(i32 100)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMRB2_get(void) { return U_WMRCORENONE_get("U_WMRB2"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRB2\00"
define i32 @U_WMRB2_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRB2\00"
define i32 @U_WMRB2_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
void av_opt_free() {}


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

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

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

LLVM IR (-O2):
define void @av_opt_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
gen_twos_complement() { gen_call("ccneg"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"ccneg\00"
define i32 @gen_twos_complement() {
%1 = alloca i32
%2 = call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccneg\00"
define i32 @gen_twos_complement() {
%1 = tail call i32 @gen_call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
unsigned short decode_artnet_uint16_lohi(unsigned char *data) {
  return (data[1] << 8) | data[0];
}


x86 assembly (clang, -O0):
<decode_artnet_uint16_lohi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_artnet_uint16_lohi>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @decode_artnet_uint16_lohi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @decode_artnet_uint16_lohi(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i16
%8 = or i16 %5, %7
ret i16 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __builtin_rdctl(int);
uint32_t _Nios2_Get_ctlreg_ipending(void) {
  return (uint32_t)__builtin_rdctl(4);
}


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

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

LLVM IR (-O0):
define i32 @_Nios2_Get_ctlreg_ipending() {
%1 = call i32 @__builtin_rdctl(i32 4)
ret i32 %1
}

LLVM IR (-O2):
define i32 @_Nios2_Get_ctlreg_ipending() {
%1 = tail call i32 @__builtin_rdctl(i32 4)
ret i32 %1
}
/* Variables and functions */
scalar_t__ getmdate(char *);
int fexists(char *name) { return getmdate(name) != 0; }


x86 assembly (clang, -O0):
<fexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getmdate@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexists>:
push   %rax
call   1030 <getmdate@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fexists(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @getmdate(i8* %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @fexists(i8* %0) {
%2 = tail call i64 @getmdate(i8* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void buf_set_uint16_be(void *buf, unsigned long addr, unsigned short val) {
  unsigned char *tmp = (unsigned char *)buf + addr;
  tmp[0] = (val >> 8) & 0xff;
  tmp[1] = val & 0xff;
}


x86 assembly (clang, -O0):
<buf_set_uint16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movzwl -0x12(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x12(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_set_uint16_be>:
rol    $0x8,%dx
mov    %dx,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @buf_set_uint16_be(i8* %0, i64 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i16
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i16 %2, i16* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %7
%11 = load i16, i16* %6
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 %15, i8* %17
%18 = load i16, i16* %6
%19 = zext i16 %18 to i32
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @buf_set_uint16_be(i8* nocapture writeonly %0, i64 %1, i16 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = lshr i16 %2, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %2 to i8
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
char *getfname(char *);
void doSaveCommand(FILE **f, char *fname) {
  *f = NULL;
  if (!fname) {
    fname = getfname("Save file as:");
  }
  *f = fopen(fname, "w");
}


x86 assembly (clang, -O0):
<doSaveCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <doSaveCommand+0x36>
lea    0xeb3(%rip),%rdi
call   1030 <getfname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doSaveCommand>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
movq   $0x0,(%rdi)
test   %rsi,%rsi
jne    113f <doSaveCommand+0x1f>
lea    0xec6(%rip),%rdi
call   1030 <getfname@plt>
lea    0xec8(%rip),%rsi
mov    %rax,%rdi
call   1040 <fopen@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Save file as:\00"
@.str.1 = [2 x i8] c"w\00"
define void @doSaveCommand(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
store i32* null, i32** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i8* @getfname(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %9, i8** %4
br label %10
10: ; preds = %8, %2
%11 = load i8*, i8** %4
%12 = call i32* @fopen(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32**, i32*** %3
store i32* %12, i32** %13
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Save file as:\00"
@.str.1 = [2 x i8] c"w\00"
define void @doSaveCommand(i32** nocapture writeonly %0, i8* %1) {
store i32* null, i32** %0
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i8* @getfname(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = phi i8* [ %1, %2 ], [ %5, %4 ]
%8 = tail call i32* @fopen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void branch_one() {
  int r;
  if (r) {
    int i = 0;
    while (i < 10)
      i++;
  } else {
    while (1)
      assert(1);
  }
}


x86 assembly (clang, -O0):
<branch_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,-0x4(%rbp)
je     1146 <branch_one+0x36>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1141 <branch_one+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <branch_one+0x19>
jmp    115a <branch_one+0x4a>
jmp    114b <branch_one+0x3b>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    114b <branch_one+0x3b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<branch_one>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <branch_one+0x10>

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

LLVM IR (-O2):
define void @branch_one() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @assert(i32 1)
br label %1
}
void OCSP_RESPONSE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_RESPONSE_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main() {
  fputc(350, stdout);
  fputc('\n', stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
mov    $0x5e,%edi
call   1030 <fputc@plt>
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
mov    $0x5e,%edi
call   1030 <fputc@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputc(i8 signext 94, i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fputc(i8 signext 10, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputc(i8 signext 94, i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputc(i8 signext 10, i32 %3)
ret i32 0
}
/* Variables and functions */
int read(int, char *, int);
int write(int, char *, int);
int errGen(int fd) {
  char buffer[100];
  int bs;
  bs = read(fd, buffer, 10);
  if (bs < 0)
    return (-1);
  bs = write(fd, buffer, 1);
  if (bs < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<errGen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0xa,%edx
call   1040 <read@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0x0,-0x74(%rbp)
jge    1158 <errGen+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <errGen+0x69>
mov    -0x8(%rbp),%edi
lea    -0x70(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x74(%rbp)
cmpl   $0x0,-0x74(%rbp)
jge    1182 <errGen+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1189 <errGen+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errGen>:
push   %rbx
sub    $0x70,%rsp
mov    %edi,%ebx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1040 <read@plt>
test   %eax,%eax
js     114c <errGen+0x2c>
mov    %rsp,%rsi
mov    %ebx,%edi
mov    $0x1,%edx
call   1030 <write@plt>
shr    $0x1f,%eax
jmp    1151 <errGen+0x31>
mov    $0xffffffff,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @errGen(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 10)
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @write(i32 %0, i8* %3, i32 1)
%8 = lshr i32 %7, 31
br label %9
9: ; preds = %6, %1
%10 = phi i32 [ -1, %1 ], [ %8, %6 ]
ret i32 %10
}
char *strset(str, c)
char *str;
char c;
{
  while (*str) {
    *str = c;
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1135 <strset+0x35>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <strset+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strset>:
cmpb   $0x0,(%rdi)
je     1121 <strset+0x21>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %sil,(%rdi)
lea    0x1(%rdi),%rax
cmpb   $0x0,0x1(%rdi)
mov    %rax,%rdi
jne    1110 <strset+0x10>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @strset(i8* %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %8, %6 ], [ %0, %2 ]
store i8 %3, i8* %7
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = phi i8* [ %0, %2 ], [ %8, %6 ]
ret i8* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_float_sum_to_all(float *target, float *source, int nreduce,
                                   int PE_start, int logPE_stride, int PE_size,
                                   float *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_float_sum_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_float_sum_to_all(float* %0, float* %1, i32 %2, i32 %3, i32 %4, i32 %5, float* %6, i64* %7) {
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float*
%16 = alloca i64*
store float* %0, float** %9
store float* %1, float** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store float* %6, float** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_float_sum_to_all(float* nocapture readnone %0, float* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, float* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int soru_6(int dizi[], int N, int aranan) { return 0; }


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

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

LLVM IR (-O0):
define i32 @soru_6(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
ret i32 0
}

LLVM IR (-O2):
define i32 @soru_6(i32* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int Maxu(unsigned int, int /*<<< orphan*/);
int /*<<< orphan*/ Minu(unsigned int, unsigned int);
unsigned Clampu(unsigned v, unsigned min, unsigned max) {
  return Maxu(min, Minu(v, max));
}


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

x86 assembly (clang, -O2):
<Clampu>:
push   %rbx
mov    %esi,%ebx
mov    %edx,%esi
call   1040 <Minu@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <Maxu@plt>

LLVM IR (-O0):
define i32 @Clampu(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* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = call i32 @Minu(i32 %8, i32 %9)
%11 = call i32 @Maxu(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @Clampu(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @Minu(i32 %0, i32 %2)
%5 = tail call i32 @Maxu(i32 %1, i32 %4)
ret i32 %5
}
unsigned int getSize(const long int num) {
  if (num < 10)
    return 1;
  return 1 + getSize(num / 10);
}


x86 assembly (clang, -O0):
<getSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0xa,-0x10(%rbp)
jge    1133 <getSize+0x23>
movl   $0x1,-0x4(%rbp)
jmp    114f <getSize+0x3f>
mov    -0x10(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,%rdi
call   1030 <getSize@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSize>:
mov    $0x1,%ecx
cmp    $0xa,%rdi
jl     1136 <getSize+0x36>
mov    $0x1,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
nopw   0x0(%rax,%rax,1)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <getSize+0x20>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getSize(i64 %0) {
%2 = icmp slt i64 %0, 10
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = udiv i64 %4, 10
%7 = add i32 %5, 1
%8 = icmp ult i64 %4, 100
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = add i32 %5, 2
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 1, %1 ], [ %10, %9 ]
ret i32 %12
}
void f() {
  char a;
  int b;
  void *data1 = &a;
  void *data2 = data1;
  b = *(int *)(data2);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
lea    -0x1(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
int f(int y, int x) { return x | ((~x) & y); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x4(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = load i32, i32* %4
%7 = xor i32 %6, -1
%8 = load i32, i32* %3
%9 = and i32 %7, %8
%10 = or i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
void Led_On() {
  (*(volatile unsigned long *)0xE0200280) = 0x00001111;
  (*(volatile unsigned long *)0xE0200284) = 0;
}


x86 assembly (clang, -O0):
<Led_On>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200280,%eax
movq   $0x1111,(%rax)
mov    $0xe0200284,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Led_On>:
mov    $0xe0200280,%eax
movq   $0x1111,(%rax)
movq   $0x0,0x4(%rax)
ret

LLVM IR (-O0):
define void @Led_On() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
store volatile i64 0, i64* inttoptr (i64 3760194180 to i64*)
ret void
}

LLVM IR (-O2):
define void @Led_On() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
store volatile i64 0, i64* inttoptr (i64 3760194180 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *dup = strdup(s);
  if (dup == NULL)
    err(104, "strdup");
  return dup;
}


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)
cmpq   $0x0,-0x10(%rbp)
jne    1155 <xstrdup+0x35>
mov    $0x68,%edi
lea    0xeb0(%rip),%rsi
call   1030 <err@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
test   %rax,%rax
jne    113f <xstrdup+0x1f>
lea    0xecb(%rip),%rsi
mov    $0x68,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"strdup\00"
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 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err(i32 104, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [7 x i8] c"strdup\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i32 104, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_251() {
  Assert_real((isqrt(251) == 15),
              "/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/stdlib/isqrt.c",
              1260, ("Integer square root of 251 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_251>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfb,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4ec,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_251>:
push   %rax
mov    $0xfb,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4ec,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 251 should be 15\00"
define void @t_sqrt_251() {
%1 = call i32 @isqrt(i32 251)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1260, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 251 should be 15\00"
define void @t_sqrt_251() {
%1 = tail call i32 @isqrt(i32 251)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1260, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, long);
void equ(char *sym, long val) { printf("(equ %s %ld)\n", sym, val); }


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

x86 assembly (clang, -O2):
<equ>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"(equ %s %ld)\0A\00"
define void @equ(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"(equ %s %ld)\0A\00"
define void @equ(i8* %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
ret void
}
int config_WITH_SSL(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @config_WITH_SSL() {
ret i32 0
}

LLVM IR (-O2):
define i32 @config_WITH_SSL() {
ret i32 0
}
void uart_scanf(char *type, int *addr) {}


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

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

LLVM IR (-O0):
define void @uart_scanf(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 @uart_scanf(i8* nocapture %0, i32* nocapture %1) {
ret void
}
int max_n(int a, int b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}


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

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

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

LLVM IR (-O2):
define i32 @max_n(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
size_t str_rindex(char const *, char const *);
size_t u_rindex(const char *haystack, const char *needle) {
  return str_rindex(haystack, needle);
}


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

x86 assembly (clang, -O2):
<u_rindex>:
jmp    1030 <str_rindex@plt>

LLVM IR (-O0):
define i64 @u_rindex(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 = load i8*, i8** %4
%7 = call i64 @str_rindex(i8* %5, i8* %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @u_rindex(i8* %0, i8* %1) {
%3 = tail call i64 @str_rindex(i8* %0, i8* %1)
ret i64 %3
}
void foo_1_2_2_2_2_2_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_2_2_2_1_1_2() {
ret void
}
void RTAvlrU64Destroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrU64Destroy() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void EMACHashFilterSet(uint32_t ui32Base, uint32_t ui32HashHi,
                       uint32_t ui32HashLo) {
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) = ui32HashLo;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) = ui32HashHi;
}


x86 assembly (clang, -O0):
<EMACHashFilterSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACHashFilterSet>:
mov    %rdx,0xc(%rdi)
mov    %rsi,0x8(%rdi)
ret

LLVM IR (-O0):
define void @EMACHashFilterSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i64, i64* %4
%9 = add nsw i64 %8, 12
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = add nsw i64 %12, 8
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @EMACHashFilterSet(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %0, 12
%5 = inttoptr i64 %4 to i64*
store volatile i64 %2, i64* %5
%6 = add nsw i64 %0, 8
%7 = inttoptr i64 %6 to i64*
store volatile i64 %1, i64* %7
ret void
}
void IntFuncClkFreeRunSet(void) {
  (*((volatile unsigned int *)((0x48200000) + (0x50)))) |= (0x00000001u);
}


x86 assembly (clang, -O0):
<IntFuncClkFreeRunSet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48200050,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x48200050,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntFuncClkFreeRunSet>:
orl    $0x1,0x48200050
01
ret

LLVM IR (-O0):
define void @IntFuncClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056784 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1210056784 to i32*)
ret void
}

LLVM IR (-O2):
define void @IntFuncClkFreeRunSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056784 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1210056784 to i32*)
ret void
}
/* Variables and functions */
float exp(scalar_t__);
scalar_t__ gammln(float);
float beta(float z, float w) {
  return exp(gammln(z) + gammln(w) - gammln(z + w));
}


x86 assembly (clang, -O0):
<beta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <gammln@plt>
mov    %rax,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <gammln@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
call   1040 <gammln@plt>
mov    -0x10(%rbp),%rdi
sub    %rax,%rdi
call   1030 <exp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beta>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
call   1040 <gammln@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
call   1040 <gammln@plt>
add    %rax,%rbx
movss  0xc(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
call   1040 <gammln@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <exp@plt>

LLVM IR (-O0):
define float @beta(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = call i64 @gammln(float %5)
%7 = load float, float* %4
%8 = call i64 @gammln(float %7)
%9 = add nsw i64 %6, %8
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fadd float %10, %11
%13 = call i64 @gammln(float %12)
%14 = sub nsw i64 %9, %13
%15 = call float @exp(i64 %14)
ret float %15
}

LLVM IR (-O2):
define float @beta(float %0, float %1) {
%3 = tail call i64 @gammln(float %0)
%4 = tail call i64 @gammln(float %1)
%5 = add nsw i64 %4, %3
%6 = fadd float %0, %1
%7 = tail call i64 @gammln(float %6)
%8 = sub i64 %5, %7
%9 = tail call float @exp(i64 %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ reach_error();
void ldv_assert(int expression) {
  if (!expression) {
  ERROR : {
    reach_error();
    abort();
  }
  };
  return;
}


x86 assembly (clang, -O0):
<ldv_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <ldv_assert+0x28>
jmp    113a <ldv_assert+0x1a>
mov    $0x0,%al
call   1040 <reach_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldv_assert>:
test   %edi,%edi
je     1125 <ldv_assert+0x5>
ret
push   %rax
xor    %eax,%eax
call   1040 <reach_error@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @ldv_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
br label %6
6: ; preds = %5
%7 = call i32 (...) @reach_error()
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @ldv_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (...) @reach_error()
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
void swap(int *a, int *b) {
  if (a == b)
    return;
  *a = (*a) ^ (*b);
  *b = (*a) ^ (*b);
  *a = (*a) ^ (*b);
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    111f <swap+0x1f>
jmp    1155 <swap+0x55>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
xor    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %rsi,%rdi
je     1111 <swap+0x11>
mov    (%rsi),%eax
xor    (%rdi),%eax
mov    %eax,(%rdi)
xor    (%rsi),%eax
mov    %eax,(%rsi)
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @swap(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 eq i32* %5, %6
br i1 %7, label %8, label %9
8: ; preds = %2
br label %28
9: ; preds = %2
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = xor i32 %11, %13
%15 = load i32*, i32** %3
store i32 %14, i32* %15
%16 = load i32*, i32** %3
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %18
%20 = xor i32 %17, %19
%21 = load i32*, i32** %4
store i32 %20, i32* %21
%22 = load i32*, i32** %3
%23 = load i32, i32* %22
%24 = load i32*, i32** %4
%25 = load i32, i32* %24
%26 = xor i32 %23, %25
%27 = load i32*, i32** %3
store i32 %26, i32* %27
br label %28
28: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @swap(i32* %0, i32* %1) {
%3 = icmp eq i32* %0, %1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i32, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = xor i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %0
%11 = xor i32 %10, %9
store i32 %11, i32* %0
br label %12
12: ; preds = %2, %4
ret void
}
int f2(int (*q[][3])[5]) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f2([3 x [5 x i32]*]* %0) {
%2 = alloca [3 x [5 x i32]*]*
store [3 x [5 x i32]*]* %0, [3 x [5 x i32]*]** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @f2([3 x [5 x i32]*]* nocapture readnone %0) {
ret i32 0
}