xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void push(void *stack, size_t *count, size_t size, const void *data) {
  if (stack == NULL || count == NULL)
    return;
  if (data == NULL)
    return;
  memcpy(stack + (*count) * size, data, size);
  (*count) += 1;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <push+0x2e>
cmpq   $0x0,-0x10(%rbp)
jne    1143 <push+0x33>
jmp    1181 <push+0x71>
cmpq   $0x0,-0x20(%rbp)
jne    1153 <push+0x43>
jmp    1181 <push+0x71>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
imul   -0x18(%rbp),%rax
add    %rax,%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
push   %rbx
test   %rdi,%rdi
je     1139 <push+0x29>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1139 <push+0x29>
test   %rcx,%rcx
je     1139 <push+0x29>
mov    (%rbx),%rax
imul   %rdx,%rax
add    %rax,%rdi
mov    %rcx,%rsi
call   1030 <memcpy@plt>
addq   $0x1,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @push(i8* %0, i64* %1, i64 %2, i8* %3) {
%5 = icmp eq i8* %0, null
%6 = icmp eq i64* %1, null
%7 = or i1 %5, %6
%8 = icmp eq i8* %3, null
%9 = or i1 %7, %8
br i1 %9, label %17, label %10
10: ; preds = %4
%11 = load i64, i64* %1
%12 = mul i64 %11, %2
%13 = getelementptr i8, i8* %0, i64 %12
%14 = tail call i32 @memcpy(i8* %13, i8* %3, i64 %2)
%15 = load i64, i64* %1
%16 = add i64 %15, 1
store i64 %16, i64* %1
br label %17
17: ; preds = %4, %10
ret void
}
/* Type definitions */
struct Complex {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Complex *);
int complex_free(struct Complex *a) {
  free(a);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.Complex = type { i32 }
define i32 @complex_free(%struct.Complex* nocapture %0) {
%2 = tail call i32 @free(%struct.Complex* %0)
ret i32 0
}
/* Type definitions */
typedef unsigned char const uint16_t;

/* Variables and functions */
uint16_t read_le16(const char *buf) {
  const unsigned char *b = (const unsigned char *)buf;
  return b[0] | (b[1] << 8);
}


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

x86 assembly (clang, -O2):
<read_le16>:
mov    (%rdi),%al
ret

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

LLVM IR (-O2):
define zeroext i8 @read_le16(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_help(void) {
  fprintf(stdout,
          "memdlopen :\n            -f path : load a library from a file\n     "
          "       -l port : listen on a given port to get library\n");
}


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [122 x i8] c"memdlopen :\0A -f path : load a library from a file\0A -l port : listen on a given port to get library\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [122 x i8] c"memdlopen :\0A -f path : load a library from a file\0A -l port : listen on a given port to get library\0A\00"
define void @print_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([122 x i8], [122 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
long inw(int);
int /*<<< orphan*/ outl(long, int);
long cwfetch(long cfgadr) {
  outl((cfgadr | 0x80000000) & ~3, 0xcf8);
  return inw((0xcfc + (cfgadr & 3)));
}


x86 assembly (clang, -O0):
<cwfetch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movabs $0x80000000,%rdi
or     -0x8(%rbp),%rdi
and    $0xfffffffffffffffc,%rdi
mov    $0xcf8,%esi
call   1040 <outl@plt>
mov    -0x8(%rbp),%rax
and    $0x3,%rax
add    $0xcfc,%rax
mov    %eax,%edi
call   1030 <inw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwfetch>:
push   %rbx
mov    %rdi,%rbx
movabs $0xffffffff7ffffffc,%rax
ff ff ff
and    %rdi,%rax
mov    $0x80000000,%edi
or     %rax,%rdi
mov    $0xcf8,%esi
call   1040 <outl@plt>
or     $0xcfc,%ebx
and    $0xcff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <inw@plt>

LLVM IR (-O0):
define i64 @cwfetch(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = or i64 %3, 2147483648
%5 = and i64 %4, -4
%6 = call i32 @outl(i64 %5, i32 3320)
%7 = load i64, i64* %2
%8 = and i64 %7, 3
%9 = add nsw i64 3324, %8
%10 = trunc i64 %9 to i32
%11 = call i64 @inw(i32 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @cwfetch(i64 %0) {
%2 = and i64 %0, -2147483652
%3 = or i64 %2, 2147483648
%4 = tail call i32 @outl(i64 %3, i32 3320)
%5 = trunc i64 %0 to i32
%6 = and i32 %5, 3
%7 = or i32 %6, 3324
%8 = tail call i64 @inw(i32 %7)
ret i64 %8
}
int fun576() { return 576; }


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

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

LLVM IR (-O0):
define i32 @fun576() {
ret i32 576
}

LLVM IR (-O2):
define i32 @fun576() {
ret i32 576
}
void strength_result6(int *data) {
  int j = 21 * data[0];
  int i = 21 * data[1];
  do {
    data[data[2]] = 2;
    i = i + j;
  } while (i < data[3]);
}


x86 assembly (clang, -O0):
<strength_result6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x15,(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x15,0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jl     111d <strength_result6+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_result6>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
lea    (%rax,%rax,4),%edx
lea    (%rax,%rdx,4),%eax
lea    (%rcx,%rcx,4),%edx
lea    (%rcx,%rdx,4),%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    %eax,%ecx
movslq 0x8(%rdi),%rdx
movl   $0x2,(%rdi,%rdx,4)
cmp    0xc(%rdi),%ecx
jl     1120 <strength_result6+0x20>
ret

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

LLVM IR (-O2):
define void @strength_result6(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 21
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 21
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = getelementptr inbounds i32, i32* %0, i64 3
br label %9
9: ; preds = %9, %1
%10 = phi i32 [ %6, %1 ], [ %14, %9 ]
%11 = load i32, i32* %7
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %0, i64 %12
store i32 2, i32* %13
%14 = add nsw i32 %10, %3
%15 = load i32, i32* %8
%16 = icmp slt i32 %14, %15
br i1 %16, label %9, label %17
17: ; preds = %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fortran2cstring(char *, char *, int, int);
int PAPI_add_named_event(int, char *);
void papif_add_named_event__(int *EventSet, char *EventName, int *check,
                             int Event_len) {
  char tmp[128];
  Fortran2cstring(tmp, EventName, 128, Event_len);
  *check = PAPI_add_named_event(*EventSet, tmp);
}


x86 assembly (clang, -O0):
<papif_add_named_event__>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%ecx
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0xa0(%rbp),%rsi
call   1030 <PAPI_add_named_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_add_named_event__>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x80,%edx
call   1040 <Fortran2cstring@plt>
mov    (%rbx),%edi
mov    %r15,%rsi
call   1030 <PAPI_add_named_event@plt>
mov    %eax,(%r14)
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @papif_add_named_event__(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [128 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%11 = load i8*, i8** %6
%12 = load i32, i32* %8
%13 = call i32 @Fortran2cstring(i8* %10, i8* %11, i32 128, i32 %12)
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%17 = call i32 @PAPI_add_named_event(i32 %15, i8* %16)
%18 = load i32*, i32** %7
store i32 %17, i32* %18
ret void
}

LLVM IR (-O2):
define void @papif_add_named_event__(i32* nocapture %0, i8* %1, i32* nocapture writeonly %2, i32 %3) {
%5 = alloca [128 x i8]
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = call i32 @Fortran2cstring(i8* %6, i8* %1, i32 128, i32 %3)
%8 = load i32, i32* %0
%9 = call i32 @PAPI_add_named_event(i32 %8, i8* %6)
store i32 %9, i32* %2
ret void
}
void *f2(void *a, int b) { return a + b; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @f2(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @f2(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr i8, i8* %0, i64 %3
ret i8* %4
}
/* Variables and functions */
float circular_out(float, float, float);
float circular_f_out(float step, float max_steps, float max_val) {
  return circular_out(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<circular_f_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <circular_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_f_out>:
jmp    1030 <circular_out@plt>

LLVM IR (-O0):
define float @circular_f_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @circular_out(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @circular_f_out(float %0, float %1, float %2) {
%4 = tail call float @circular_out(float %0, float %1, float %2)
ret float %4
}
unsigned long *stack_init(unsigned long *sp, void (*task)(void)) {
  (*sp) = (unsigned long)0x01000000L;
  *(--sp) = (unsigned long)task;
  return (sp - 14);
}


x86 assembly (clang, -O0):
<stack_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x1000000,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x8(%rbp)
mov    %rcx,-0x8(%rax)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffff90,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_init>:
movq   $0x1000000,(%rdi)
mov    %rsi,-0x8(%rdi)
lea    -0x78(%rdi),%rax
ret

LLVM IR (-O0):
define i64* @stack_init(i64* %0, void ()* %1) {
%3 = alloca i64*
%4 = alloca void ()*
store i64* %0, i64** %3
store void ()* %1, void ()** %4
%5 = load i64*, i64** %3
store i64 16777216, i64* %5
%6 = load void ()*, void ()** %4
%7 = ptrtoint void ()* %6 to i64
%8 = load i64*, i64** %3
%9 = getelementptr inbounds i64, i64* %8, i32 -1
store i64* %9, i64** %3
store i64 %7, i64* %9
%10 = load i64*, i64** %3
%11 = getelementptr inbounds i64, i64* %10, i64 -14
ret i64* %11
}

LLVM IR (-O2):
define i64* @stack_init(i64* writeonly %0, void ()* %1) {
store i64 16777216, i64* %0
%3 = ptrtoint void ()* %1 to i64
%4 = getelementptr inbounds i64, i64* %0, i64 -1
store i64 %3, i64* %4
%5 = getelementptr inbounds i64, i64* %0, i64 -15
ret i64* %5
}
/* Variables and functions */
int /*<<< orphan*/ log_logf(int, char *);
int /*<<< orphan*/ system(char *);
int git_check(void) {
  log_logf(2, "Checking if git is installed...\n");
  return !system("git help > /dev/null 2>&1");
}


x86 assembly (clang, -O0):
<git_check>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
call   1030 <log_logf@plt>
lea    0xee5(%rip),%rdi
call   1040 <system@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_check>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
call   1030 <log_logf@plt>
lea    0xee8(%rip),%rdi
call   1040 <system@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Checking if git is installed...\0A\00"
@.str.1 = [26 x i8] c"git help > /dev/null 2>&1\00"
define i32 @git_check() {
%1 = call i32 @log_logf(i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@.str = [33 x i8] c"Checking if git is installed...\0A\00"
@.str.1 = [26 x i8] c"git help > /dev/null 2>&1\00"
define i32 @git_check() {
%1 = tail call i32 @log_logf(i32 2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int get_opposite_letter(char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char c;
  scanf("%c", &c);
  printf("%c\n", get_opposite_letter(c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1040 <get_opposite_letter@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1040 <get_opposite_letter@plt>
lea    0xeb0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = call i32 @get_opposite_letter(i8 signext %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tester_test_passed();
void test_reset(const void *test_data) { tester_test_passed(); }


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

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

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

LLVM IR (-O2):
define void @test_reset(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @tester_test_passed()
ret void
}
/* Type definitions */
struct Vec3 {
  int dummy;
};

/* Variables and functions */
float sqrt(int /*<<< orphan*/);
int /*<<< orphan*/ vec3_dot(struct Vec3 const *, struct Vec3 const *);
float vec3_length(const struct Vec3 *v) { return sqrt(vec3_dot(v, v)); }


x86 assembly (clang, -O0):
<vec3_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec3_dot@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_length>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec3_dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
%struct.Vec3 = type { i32 }
define float @vec3_length(%struct.Vec3* %0) {
%2 = alloca %struct.Vec3*
store %struct.Vec3* %0, %struct.Vec3** %2
%3 = load %struct.Vec3*, %struct.Vec3** %2
%4 = load %struct.Vec3*, %struct.Vec3** %2
%5 = call i32 @vec3_dot(%struct.Vec3* %3, %struct.Vec3* %4)
%6 = call float @sqrt(i32 %5)
ret float %6
}

LLVM IR (-O2):
%struct.Vec3 = type { i32 }
define float @vec3_length(%struct.Vec3* %0) {
%2 = tail call i32 @vec3_dot(%struct.Vec3* %0, %struct.Vec3* %0)
%3 = tail call float @sqrt(i32 %2)
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ message;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ stdin;
char yoink(int format) {
  if (format) {
    return getchar();
  } else {
    char message[256];
    fgets(message, sizeof(message), stdin);
    return message[0];
  }
}


x86 assembly (clang, -O0):
<yoink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1147 <yoink+0x27>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
jmp    116a <yoink+0x4a>
lea    -0x110(%rbp),%rdi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
mov    $0x100,%esi
call   1030 <fgets@plt>
mov    -0x110(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yoink>:
test   %edi,%edi
je     112b <yoink+0xb>
xor    %eax,%eax
jmp    1040 <getchar@plt>
sub    $0x108,%rsp
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <fgets@plt>
mov    (%rsp),%al
add    $0x108,%rsp
ret

LLVM IR (-O0):
@stdin = global i32 0
define signext i8 @yoink(i32 %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca [256 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %2
br label %15
9: ; preds = %1
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%11 = load i32, i32* @stdin
%12 = call i32 @fgets(i8* %10, i32 256, i32 %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%14 = load i8, i8* %13
store i8 %14, i8* %2
br label %15
15: ; preds = %9, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
@stdin = global i32 0
define signext i8 @yoink(i32 %0) {
%2 = alloca [256 x i8]
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call signext i8 (...) @getchar()
br label %11
6: ; preds = %1
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %7, i32 256, i32 %8)
%10 = load i8, i8* %7
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ %5, %4 ], [ %10, %6 ]
ret i8 %12
}
void swapf(float *x, float *y) {
  float t;
  t = *y;
  *y = *x;
  *x = t;
}


x86 assembly (clang, -O0):
<swapf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapf>:
movss  (%rsi),%xmm0
movss  (%rdi),%xmm1
movss  %xmm1,(%rsi)
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @swapf(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca float
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %4
%7 = load float, float* %6
store float %7, float* %5
%8 = load float*, float** %3
%9 = load float, float* %8
%10 = load float*, float** %4
store float %9, float* %10
%11 = load float, float* %5
%12 = load float*, float** %3
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @swapf(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = load float, float* %0
store float %4, float* %1
store float %3, float* %0
ret void
}
int break_loop(int p, int t) {
  for (int i = 0; i < p; i++) {
    if (t < 0)
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<break_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113f <break_loop+0x3f>
cmpl   $0x0,-0x8(%rbp)
jge    112c <break_loop+0x2c>
jmp    113f <break_loop+0x3f>
jmp    1131 <break_loop+0x31>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <break_loop+0x11>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @break_loop(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int isatty(int /*<<< orphan*/);
int __stdin_is_tty() {
  static int iknow;
  if (!iknow)
    iknow = isatty(0) + 1;
  return (iknow - 1);
}


x86 assembly (clang, -O0):
<__stdin_is_tty>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
jne    1131 <__stdin_is_tty+0x21>
xor    %edi,%edi
call   1030 <isatty@plt>
add    $0x1,%eax
mov    %eax,0x2efb(%rip)
mov    0x2ef5(%rip),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__stdin_is_tty>:
push   %rax
mov    0x2f15(%rip),%eax
test   %eax,%eax
jne    112b <__stdin_is_tty+0x1b>
xor    %edi,%edi
call   1030 <isatty@plt>
add    $0x1,%eax
mov    %eax,0x2f01(%rip)
add    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__stdin_is_tty.iknow = internal global i32 0
define i32 @__stdin_is_tty() {
%1 = load i32, i32* @__stdin_is_tty.iknow
%2 = icmp ne i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 @isatty(i32 0)
%5 = add nsw i32 %4, 1
store i32 %5, i32* @__stdin_is_tty.iknow
br label %6
6: ; preds = %3, %0
%7 = load i32, i32* @__stdin_is_tty.iknow
%8 = sub nsw i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
@__stdin_is_tty.iknow = internal unnamed_addr global i32 0
define i32 @__stdin_is_tty() {
%1 = load i32, i32* @__stdin_is_tty.iknow
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @isatty(i32 0)
%5 = add nsw i32 %4, 1
store i32 %5, i32* @__stdin_is_tty.iknow
br label %6
6: ; preds = %3, %0
%7 = phi i32 [ %5, %3 ], [ %1, %0 ]
%8 = add nsw i32 %7, -1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ __free_cf(void *);
void CGColorRelease(void *item) { __free_cf(item); }


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

x86 assembly (clang, -O2):
<CGColorRelease>:
jmp    1030 <__free_cf@plt>

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

LLVM IR (-O2):
define void @CGColorRelease(i8* %0) {
%2 = tail call i32 @__free_cf(i8* %0)
ret void
}
int hash_ix(char *s) {
  unsigned int h = 17;
  while (*s) {
    h = ((h << 5) + h) + *s++;
  }
  return (h % 151);
}


x86 assembly (clang, -O0):
<hash_ix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x11,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <hash_ix+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash_ix+0xf>
mov    -0xc(%rbp),%eax
mov    $0x97,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_ix>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <hash_ix+0x3d>
add    $0x1,%rdi
mov    $0x11,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_ix+0x10>
mov    %eax,%ecx
imul   $0x36406c81,%rcx,%rcx
shr    $0x25,%rcx
imul   $0x97,%ecx,%ecx
sub    %ecx,%eax
ret
mov    $0x11,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_ix(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 17, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %11, 151
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 17, %1 ], [ %15, %14 ]
ret i32 %17
}
void handle_RETRACT(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_RETRACT(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_1() {
  Assert_real((isqrt(1) == 1),
              "/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",
              10, ("Integer square root of 1 should be 1"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_1>:
push   %rax
mov    $0x1,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0xa,%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 = [37 x i8] c"Integer square root of 1 should be 1\00"
define void @t_sqrt_1() {
%1 = call i32 @isqrt(i32 1)
%2 = icmp eq i32 %1, 1
%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 10, i8* getelementptr inbounds ([37 x i8], [37 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 = [37 x i8] c"Integer square root of 1 should be 1\00"
define void @t_sqrt_1() {
%1 = tail call i32 @isqrt(i32 1)
%2 = icmp eq i32 %1, 1
%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 10, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int bind_socket(char const *);
int /*<<< orphan*/ exit(int);
int main(void) {
  int sock_fd;
  int kid;
  char const *filename = "conftest.unixsock.sock";
  alarm(15);
  if ((sock_fd = bind_socket(filename)) < 0)
    exit(1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0xf,%edi
call   1040 <alarm@plt>
mov    -0x18(%rbp),%rdi
call   1030 <bind_socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1173 <main+0x43>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
call   1040 <alarm@plt>
lea    0xebe(%rip),%rdi
call   1030 <bind_socket@plt>
test   %eax,%eax
jns    1155 <main+0x25>
mov    $0x1,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"conftest.unixsock.sock\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = call i32 @alarm(i32 15)
%6 = load i8*, i8** %4
%7 = call i32 @bind_socket(i8* %6)
store i32 %7, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"conftest.unixsock.sock\00"
define i32 @main() {
%1 = tail call i32 @alarm(i32 15)
%2 = tail call i32 @bind_socket(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @exit(i32 0)
unreachable
}
void Fun_s7_EXIT(void) {}


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

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

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

LLVM IR (-O2):
define void @Fun_s7_EXIT() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glk_put_char(char);
int /*<<< orphan*/ glk_put_string(char *);
void accel_error(char *msg) {
  glk_put_char('\n');
  glk_put_string(msg);
  glk_put_char('\n');
}


x86 assembly (clang, -O0):
<accel_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xa,%edi
call   1030 <glk_put_char@plt>
mov    -0x8(%rbp),%rdi
call   1040 <glk_put_string@plt>
mov    $0xa,%edi
call   1030 <glk_put_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accel_error>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <glk_put_char@plt>
mov    %rbx,%rdi
call   1040 <glk_put_string@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <glk_put_char@plt>

LLVM IR (-O0):
define void @accel_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @glk_put_char(i8 signext 10)
%4 = load i8*, i8** %2
%5 = call i32 @glk_put_string(i8* %4)
%6 = call i32 @glk_put_char(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @accel_error(i8* %0) {
%2 = tail call i32 @glk_put_char(i8 signext 10)
%3 = tail call i32 @glk_put_string(i8* %0)
%4 = tail call i32 @glk_put_char(i8 signext 10)
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *str_cat(char *a, char *b) {
  char *target = (char *)malloc(strlen(a) + strlen(b) + 1);
  strcpy(target, a);
  strcat(target, b);
  return target;
}


x86 assembly (clang, -O0):
<str_cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cat>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_cat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add nsw i64 %7, %9
%11 = add nsw i64 %10, 1
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i32 @strcat(i8* %17, i8* %18)
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @str_cat(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = tail call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = tail call i32 @strcat(i8* %8, i8* %1)
ret i8* %8
}
/* Variables and functions */
int semaphore_incr(int, int);
int mutex_unlock(int m_id) { return semaphore_incr(m_id, 1); }


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

x86 assembly (clang, -O2):
<mutex_unlock>:
mov    $0x1,%esi
jmp    1030 <semaphore_incr@plt>

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

LLVM IR (-O2):
define i32 @mutex_unlock(i32 %0) {
%2 = tail call i32 @semaphore_incr(i32 %0, i32 1)
ret i32 %2
}
void foo_1_2_1_1_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_1_1_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BLS_LOAD_BINARY_A_ASM();
int /*<<< orphan*/ BLS_LOAD_BINARY_COMMON_C();
int /*<<< orphan*/ common_level_init();
int /*<<< orphan*/ load_level(int);
void loader_main() {
  BLS_LOAD_BINARY_COMMON_C();
  BLS_LOAD_BINARY_A_ASM();
  common_level_init();
  load_level(1);
}


x86 assembly (clang, -O0):
<loader_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <BLS_LOAD_BINARY_COMMON_C@plt>
mov    $0x0,%al
call   1030 <BLS_LOAD_BINARY_A_ASM@plt>
mov    $0x0,%al
call   1050 <common_level_init@plt>
mov    $0x1,%edi
call   1060 <load_level@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<loader_main>:
push   %rax
xor    %eax,%eax
call   1040 <BLS_LOAD_BINARY_COMMON_C@plt>
xor    %eax,%eax
call   1030 <BLS_LOAD_BINARY_A_ASM@plt>
xor    %eax,%eax
call   1050 <common_level_init@plt>
mov    $0x1,%edi
pop    %rax
jmp    1060 <load_level@plt>

LLVM IR (-O0):
define void @loader_main() {
%1 = call i32 (...) @BLS_LOAD_BINARY_COMMON_C()
%2 = call i32 (...) @BLS_LOAD_BINARY_A_ASM()
%3 = call i32 (...) @common_level_init()
%4 = call i32 @load_level(i32 1)
ret void
}

LLVM IR (-O2):
define void @loader_main() {
%1 = tail call i32 (...) @BLS_LOAD_BINARY_COMMON_C()
%2 = tail call i32 (...) @BLS_LOAD_BINARY_A_ASM()
%3 = tail call i32 (...) @common_level_init()
%4 = tail call i32 @load_level(i32 1)
ret void
}
int rec_check(int n) {
  if (n == 0)
    return 1;
  else if (n > 0)
    return !rec_check(n - 1);
  else
    return !rec_check(n + 1);
}


x86 assembly (clang, -O0):
<rec_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <rec_check+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1176 <rec_check+0x66>
cmpl   $0x0,-0x8(%rbp)
jle    115b <rec_check+0x4b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <rec_check@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <rec_check+0x66>
mov    -0x8(%rbp),%edi
add    $0x1,%edi
call   1030 <rec_check@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec_check>:
test   %edi,%edi
je     1134 <rec_check+0x24>
push   %rax
setle  %al
movzbl %al,%eax
lea    (%rdi,%rax,2),%edi
add    $0xffffffff,%edi
call   1030 <rec_check@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @rec_check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %24
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 @rec_check(i32 %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %24
17: ; preds = %7
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
%20 = call i32 @rec_check(i32 %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
store i32 %23, i32* %2
br label %24
24: ; preds = %17, %10, %6
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
define i32 @rec_check(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 1
%5 = select i1 %4, i32 1, i32 -1
%6 = add nsw i32 %5, %0
%7 = tail call i32 @rec_check(i32 %6)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %9, %3 ]
ret i32 %11
}
/* Variables and functions */
char *stdc_DEBEE2AF(char const *, int);
char *strchr(const char *str, int c) { return stdc_DEBEE2AF(str, c); }


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

x86 assembly (clang, -O2):
<strchr>:
jmp    1030 <stdc_DEBEE2AF@plt>

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = tail call i8* @stdc_DEBEE2AF(i8* %0, i32 %1)
ret i8* %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *strdupdelim(const char *beg, const char *end) {
  char *res = (char *)malloc(end - beg + 1);
  memcpy(res, beg, end - beg);
  res[end - beg] = '\0';
  return res;
}


x86 assembly (clang, -O0):
<strdupdelim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
sub    %rdx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupdelim>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdupdelim(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = add nsw i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = load i8*, i8** %3
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
%22 = trunc i64 %21 to i32
%23 = call i32 @memcpy(i8* %15, i8* %16, i32 %22)
%24 = load i8*, i8** %5
%25 = load i8*, i8** %4
%26 = load i8*, i8** %3
%27 = ptrtoint i8* %25 to i64
%28 = ptrtoint i8* %26 to i64
%29 = sub i64 %27, %28
%30 = getelementptr inbounds i8, i8* %24, i64 %29
store i8 0, i8* %30
%31 = load i8*, i8** %5
ret i8* %31
}

LLVM IR (-O2):
define i8* @strdupdelim(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add i32 %6, 1
%8 = tail call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %6)
%11 = getelementptr inbounds i8, i8* %9, i64 %5
store i8 0, i8* %11
ret i8* %9
}
int XContextDependentDrawing() {}


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

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

LLVM IR (-O0):
define i32 @XContextDependentDrawing() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XContextDependentDrawing() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ tty_put(int /*<<< orphan*/);
void tty_puts(const char *p) {
  while (*p)
    tty_put(*p++);
}


x86 assembly (clang, -O0):
<tty_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <tty_puts+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <tty_put@plt>
jmp    111c <tty_puts+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <tty_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tty_put@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tty_puts+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @tty_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @tty_put(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}