xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t func_outputs_max(void) { return 1; }


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

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

LLVM IR (-O0):
define i64 @func_outputs_max() {
ret i64 1
}

LLVM IR (-O2):
define i64 @func_outputs_max() {
ret i64 1
}
/* Type definitions */
struct itimerval {
  int /*<<< orphan*/ it_value;
  int /*<<< orphan*/ it_interval;
};

/* Variables and functions */
int /*<<< orphan*/ ptimeval(int /*<<< orphan*/ *);
pitimes(struct itimerval *itv) {
  ptimeval(&itv->it_interval);
  ptimeval(&itv->it_value);
}


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

x86 assembly (clang, -O2):
<pitimes>:
push   %rbx
mov    %rdi,%rbx
add    $0x4,%rdi
call   1030 <ptimeval@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ptimeval@plt>

LLVM IR (-O0):
%struct.itimerval = type { i32, i32 }
define i32 @pitimes(%struct.itimerval* %0) {
%2 = alloca i32
%3 = alloca %struct.itimerval*
store %struct.itimerval* %0, %struct.itimerval** %3
%4 = load %struct.itimerval*, %struct.itimerval** %3
%5 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %4, i32 0, i32 1
%6 = call i32 @ptimeval(i32* %5)
%7 = load %struct.itimerval*, %struct.itimerval** %3
%8 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %7, i32 0, i32 0
%9 = call i32 @ptimeval(i32* %8)
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
%struct.itimerval = type { i32, i32 }
define i32 @pitimes(%struct.itimerval* %0) {
%2 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %0, i64 0, i32 1
%3 = tail call i32 @ptimeval(i32* %2)
%4 = getelementptr inbounds %struct.itimerval, %struct.itimerval* %0, i64 0, i32 0
%5 = tail call i32 @ptimeval(i32* %4)
ret i32 undef
}
/* Type definitions */
struct String {
  int dummy;
};

/* Variables and functions */
int string_matches_heap(struct String *, struct String *);
bool string_matches_vv(void *base, void *compare) {
  return string_matches_heap((struct String *)base, (struct String *)compare);
}


x86 assembly (clang, -O0):
<string_matches_vv>:
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 <string_matches_heap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_matches_vv>:
jmp    1030 <string_matches_heap@plt>

LLVM IR (-O0):
%struct.String = type { i32 }
define i32 @string_matches_vv(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 %struct.String*
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to %struct.String*
%9 = call i32 @string_matches_heap(%struct.String* %6, %struct.String* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.String = type { i32 }
define i32 @string_matches_vv(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to %struct.String*
%4 = bitcast i8* %1 to %struct.String*
%5 = tail call i32 @string_matches_heap(%struct.String* %3, %struct.String* %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int main() {
  FILE *my_stream;
  my_stream = fopen("foo", "r");
  fclose(my_stream);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xece(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ perfect_below(int);
int main() {
  perfect_below(9000);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2328,%edi
call   1030 <perfect_below@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @perfect_below(i32 9000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @perfect_below(i32 9000)
ret i32 0
}
const unsigned int FourCharInt32(const char *str) {
  return ((((*(const unsigned int *)(str)) & 0xff000000) >> 24) |
          (((*(const unsigned int *)(str)) & 0x00ff0000) >> 8) |
          (((*(const unsigned int *)(str)) & 0x0000ff00) << 8) |
          (((*(const unsigned int *)(str)) & 0x000000ff) << 24));
}


x86 assembly (clang, -O0):
<FourCharInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FourCharInt32>:
mov    (%rdi),%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @FourCharInt32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = and i32 %5, -16777216
%7 = lshr i32 %6, 24
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %7, %12
%14 = load i8*, i8** %2
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
%17 = and i32 %16, 65280
%18 = shl i32 %17, 8
%19 = or i32 %13, %18
%20 = load i8*, i8** %2
%21 = bitcast i8* %20 to i32*
%22 = load i32, i32* %21
%23 = and i32 %22, 255
%24 = shl i32 %23, 24
%25 = or i32 %19, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @FourCharInt32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
ret i32 %4
}
int sigfiddle_ilog2(int n) {
  int ret = -1;
  while (n) {
    n >>= 1;
    ret++;
  }
  return (ret);
}


x86 assembly (clang, -O0):
<sigfiddle_ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <sigfiddle_ilog2+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <sigfiddle_ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigfiddle_ilog2>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     111c <sigfiddle_ilog2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <sigfiddle_ilog2+0x10>
ret

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

LLVM IR (-O2):
define i32 @sigfiddle_ilog2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ -1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
int puts(const char *s) {
  while (*s) {
    putchar(*s);
    s++;
  }
  return 1;
}


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

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

LLVM IR (-O0):
define i32 @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 = load i8, i8* %8
%10 = call i32 @putchar(i8 signext %9)
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
br label %3
13: ; preds = %3
ret i32 1
}

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


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

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

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

LLVM IR (-O2):
define void @XcmsCIELuvWhiteShiftColors() {
ret void
}
float CG_OpFuncSubtract(const float a, const float b) { return a - b; }


x86 assembly (clang, -O0):
<CG_OpFuncSubtract>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_OpFuncSubtract>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @CG_OpFuncSubtract(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 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @CG_OpFuncSubtract(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
void fg_init(struct cell_state *cell, short voltage) {}


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

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

LLVM IR (-O0):
%struct.cell_state = type opaque
define void @fg_init(%struct.cell_state* %0, i16 signext %1) {
%3 = alloca %struct.cell_state*
%4 = alloca i16
store %struct.cell_state* %0, %struct.cell_state** %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
%struct.cell_state = type opaque
define void @fg_init(%struct.cell_state* nocapture %0, i16 signext %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void clear() { system("clear"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @clear() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
char *malloc(size)
unsigned size;
{ return (lmalloc((unsigned long)size)); }


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

x86 assembly (clang, -O2):
<malloc>:
push   %rax
mov    %edi,%edi
xor    %eax,%eax
call   1030 <lmalloc@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @malloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = call i32 (i64, ...) bitcast (i32 (...)* @lmalloc to i32 (i64, ...)*)(i64 %4)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @malloc(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @lmalloc to i32 (i64, ...)*)(i64 %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
char hw_read_key();
char hw_wait_for_key() {
  while (hw_read_key() == 0)
    ;
  return hw_read_key();
}


x86 assembly (clang, -O0):
<hw_wait_for_key>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <hw_wait_for_key+0x9>
mov    $0x0,%al
call   1030 <hw_read_key@plt>
movsbl %al,%eax
cmp    $0x0,%eax
jne    1131 <hw_wait_for_key+0x21>
jmp    1119 <hw_wait_for_key+0x9>
mov    $0x0,%al
call   1030 <hw_read_key@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw_wait_for_key>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <hw_read_key@plt>
test   %al,%al
je     1120 <hw_wait_for_key+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <hw_read_key@plt>

LLVM IR (-O0):
define signext i8 @hw_wait_for_key() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @hw_read_key()
%3 = sext i8 %2 to i32
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call signext i8 (...) @hw_read_key()
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @hw_wait_for_key() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @hw_read_key()
%3 = icmp eq i8 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call signext i8 (...) @hw_read_key()
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ cnfImprt(char *const, int, char *);
int /*<<< orphan*/ errFacer(char *, int);
int /*<<< orphan*/ starFree(char *);
char *starMallocAtomic(int);
void err_facer_(char *const TOKEN, int *const STATUS, int TOKEN_length) {
  char *token;
  int status;
  ;
  token = starMallocAtomic(TOKEN_length + 1);
  cnfImprt(TOKEN, TOKEN_length, token);
  status = *STATUS;
  errFacer(token, status);
  starFree(token);
}


x86 assembly (clang, -O0):
<err_facer_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <starMallocAtomic@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1060 <cnfImprt@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <errFacer@plt>
mov    -0x20(%rbp),%rdi
call   1040 <starFree@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_facer_>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r12d
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%r12),%edi
call   1050 <starMallocAtomic@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r12d,%esi
mov    %rax,%rdx
call   1060 <cnfImprt@plt>
mov    (%r14),%esi
mov    %rbx,%rdi
call   1030 <errFacer@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <starFree@plt>

LLVM IR (-O0):
define void @err_facer_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
%11 = call i8* @starMallocAtomic(i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = load i8*, i8** %7
%15 = call i32 @cnfImprt(i8* %12, i32 %13, i8* %14)
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
store i32 %17, i32* %8
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = call i32 @errFacer(i8* %18, i32 %19)
%21 = load i8*, i8** %7
%22 = call i32 @starFree(i8* %21)
ret void
}

LLVM IR (-O2):
define void @err_facer_(i8* %0, i32* nocapture %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i8* @starMallocAtomic(i32 %4)
%6 = tail call i32 @cnfImprt(i8* %0, i32 %2, i8* %5)
%7 = load i32, i32* %1
%8 = tail call i32 @errFacer(i8* %5, i32 %7)
%9 = tail call i32 @starFree(i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;

/* Variables and functions */
int _write(SSL_CTX *ctx, int sockfd) {
  int res = 0;
  return res;
}


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_write(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
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @_write(i32* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
float bounce_out(float, float, float);
float bounce_f_out(float step, float max_steps, float max_val) {
  return bounce_out(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<bounce_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 <bounce_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bounce_f_out>:
jmp    1030 <bounce_out@plt>

LLVM IR (-O0):
define float @bounce_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 @bounce_out(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @bounce_f_out(float %0, float %1, float %2) {
%4 = tail call float @bounce_out(float %0, float %1, float %2)
ret float %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t alignp(const void *x, uint32_t pow2) {
  uintptr_t xp = (uintptr_t)x;
  uintptr_t r = xp & (pow2 - 1);
  if (!r)
    return 0;
  return pow2 - r;
}


x86 assembly (clang, -O0):
<alignp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    113e <alignp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1149 <alignp+0x49>
movslq -0x14(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignp>:
lea    -0x1(%rsi),%eax
movslq %eax,%rcx
and    %rdi,%rcx
sub    %ecx,%esi
xor    %eax,%eax
test   %rcx,%rcx
cmovne %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @alignp(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = add nsw i32 %1, -1
%5 = sext i32 %4 to i64
%6 = and i64 %5, %3
%7 = icmp eq i64 %6, 0
%8 = trunc i64 %6 to i32
%9 = sub i32 %1, %8
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Display_Main_Menu() {
  printf("\n1 - Enter new cipher\n");
  printf("2 - Open existing analysis *.dat file\n");
  printf("3 - Exit\n");
  printf("\nPlease enter a selection, 1 - 3:  ");
  return;
}


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

x86 assembly (clang, -O2):
<Display_Main_Menu>:
push   %rax
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb4(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"\0A1 - Enter new cipher\0A\00"
@.str.1 = [39 x i8] c"2 - Open existing analysis *.dat file\0A\00"
@.str.2 = [10 x i8] c"3 - Exit\0A\00"
@.str.3 = [36 x i8] c"\0APlease enter a selection, 1 - 3: \00"
define void @Display_Main_Menu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.3 = [36 x i8] c"\0APlease enter a selection, 1 - 3: \00"
@str = [22 x i8] c"\0A1 - Enter new cipher\00"
@str.4 = [38 x i8] c"2 - Open existing analysis *.dat file\00"
@str.5 = [9 x i8] c"3 - Exit\00"
define void @Display_Main_Menu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret void
}
float deposit_money(float fncAmount, float fncMoney) {
  fncMoney = fncMoney - fncAmount;
  return (fncMoney);
}


x86 assembly (clang, -O0):
<deposit_money>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deposit_money>:
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @deposit_money(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %5, %6
store float %7, float* %4
%8 = load float, float* %4
ret float %8
}

LLVM IR (-O2):
define float @deposit_money(float %0, float %1) {
%3 = fsub float %1, %0
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f(int a[]) { printf("the sizeof(a) = %lu\n", sizeof(a)); }


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

x86 assembly (clang, -O2):
<f>:
lea    0xee9(%rip),%rdi
mov    $0x8,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"the sizeof(a) = %lu\0A\00"
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"the sizeof(a) = %lu\0A\00"
define void @f(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x40() {
  Assert_real((isprint(64)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              325, ("isprint should be 1 for @"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x40>:
push   %rax
mov    $0x40,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x145,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for @\00"
define void @t_isprint_0x40() {
%1 = call i32 @isprint(i32 64)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for @\00"
define void @t_isprint_0x40() {
%1 = tail call i32 @isprint(i32 64)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 325, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ exp10f(float);
int /*<<< orphan*/ link_failure_exp10f();
void test_exp10f(float f) {
  if (exp10f(f) != exp10f(f))
    link_failure_exp10f();
}


x86 assembly (clang, -O0):
<test_exp10f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <exp10f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <exp10f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_exp10f+0x3c>
mov    $0x0,%al
call   1040 <link_failure_exp10f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_exp10f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <exp10f@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <exp10f@plt>
cmp    %rax,%rbx
jne    1149 <test_exp10f+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_exp10f@plt>

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

LLVM IR (-O2):
define void @test_exp10f(float %0) {
%2 = tail call i64 @exp10f(float %0)
%3 = tail call i64 @exp10f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_exp10f()
br label %7
7: ; preds = %5, %1
ret void
}
/* Type definitions */
struct rte_ring {
  int dummy;
};

/* Variables and functions */
int rte_ring_mc_dequeue_bulk(struct rte_ring *, void **, int);
int rte_ring_mc_dequeue(struct rte_ring *r, void **obj_p) {
  return rte_ring_mc_dequeue_bulk(r, obj_p, 1);
}


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

x86 assembly (clang, -O2):
<rte_ring_mc_dequeue>:
mov    $0x1,%edx
jmp    1030 <rte_ring_mc_dequeue_bulk@plt>

LLVM IR (-O0):
%struct.rte_ring = type { i32 }
define i32 @rte_ring_mc_dequeue(%struct.rte_ring* %0, i8** %1) {
%3 = alloca %struct.rte_ring*
%4 = alloca i8**
store %struct.rte_ring* %0, %struct.rte_ring** %3
store i8** %1, i8*** %4
%5 = load %struct.rte_ring*, %struct.rte_ring** %3
%6 = load i8**, i8*** %4
%7 = call i32 @rte_ring_mc_dequeue_bulk(%struct.rte_ring* %5, i8** %6, i32 1)
ret i32 %7
}

LLVM IR (-O2):
%struct.rte_ring = type { i32 }
define i32 @rte_ring_mc_dequeue(%struct.rte_ring* %0, i8** %1) {
%3 = tail call i32 @rte_ring_mc_dequeue_bulk(%struct.rte_ring* %0, i8** %1, i32 1)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
__attribute__((always_)) void CSA(uint64_t *h, uint64_t *l, uint64_t a,
                                  uint64_t b, uint64_t c) {
  uint64_t u = a ^ b;
  *h = (a & b) | (u & c);
  *l = u ^ c;
}


x86 assembly (clang, -O0):
<CSA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%ecx
and    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%eax
and    -0x1c(%rbp),%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
xor    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CSA>:
mov    %ecx,%eax
xor    %edx,%eax
and    %edx,%ecx
mov    %eax,%edx
and    %r8d,%edx
or     %ecx,%edx
mov    %edx,(%rdi)
xor    %r8d,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @CSA(i32* %0, i32* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = xor i32 %12, %13
store i32 %14, i32* %11
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = and i32 %15, %16
%18 = load i32, i32* %11
%19 = load i32, i32* %10
%20 = and i32 %18, %19
%21 = or i32 %17, %20
%22 = load i32*, i32** %6
store i32 %21, i32* %22
%23 = load i32, i32* %11
%24 = load i32, i32* %10
%25 = xor i32 %23, %24
%26 = load i32*, i32** %7
store i32 %25, i32* %26
ret void
}

LLVM IR (-O2):
define void @CSA(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2, i32 %3, i32 %4) {
%6 = xor i32 %3, %2
%7 = and i32 %3, %2
%8 = and i32 %6, %4
%9 = or i32 %8, %7
store i32 %9, i32* %0
%10 = xor i32 %6, %4
store i32 %10, i32* %1
ret void
}
/* Variables and functions */
void *mymemalign(size_t boundary, size_t size) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @mymemalign(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @mymemalign(i64 %0, i64 %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *);
int ftruncate(int fd __attribute__((unused)),
              off_t length __attribute__((unused))) {
  printf("ftruncate\n");
  errno = EPERM;
  return (-1);
}


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

x86 assembly (clang, -O2):
<ftruncate>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
mov    0x2eb3(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
@str = [10 x i8] c"ftruncate\00"
define i32 @ftruncate(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EPERM
store i32 %4, i32* @errno
ret i32 -1
}
int PDL_GetHardwareID(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PDL_GetHardwareID() {
ret i32 0
}
/* Variables and functions */
unsigned long long bar(unsigned long long);
int main(int argc, char **argv) {
  unsigned long long d = bar((unsigned long long)(argc + 1));
  return d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
call   1030 <bar@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
add    $0x1,%edi
movslq %edi,%rdi
jmp    1030 <bar@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = add nsw i32 %0, 1
%4 = sext i32 %3 to i64
%5 = tail call i64 @bar(i64 %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
void interrupt_nmi(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<interrupt_nmi>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <interrupt_nmi+0x9>
jmp    1109 <interrupt_nmi+0x9>

x86 assembly (clang, -O2):
<interrupt_nmi>:
jmp    1100 <interrupt_nmi>

LLVM IR (-O0):
define void @interrupt_nmi() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @interrupt_nmi() {
br label %1
1: ; preds = %0, %1
br label %1
}
void test_basic() {
  typeof(int) a = 5;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "typeof.c",
          7, 5, a);
  ;
  typeof(a) b = 6;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/"
          "typeof.c",
          9, 6, b);
  ;
}


x86 assembly (clang, -O0):
<test_basic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xed7(%rip),%rdi
mov    $0x7,%esi
mov    $0x5,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
movl   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
lea    0xeb5(%rip),%rdi
mov    $0x9,%esi
mov    $0x6,%edx
mov    $0x0,%al
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_basic>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <fexpect@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x6,%edx
mov    $0x6,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/typeof.c\00"
define void @test_basic() {
%1 = alloca i32
%2 = alloca i32
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 7, i32 5, i32 %3)
store i32 6, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 9, i32 6, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/input/8cc/typeof.c\00"
define void @test_basic() {
%1 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 7, i32 5, i32 5)
%2 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @fexpect to i32 (i8*, i32, i32, i32, ...)*)(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 9, i32 6, i32 6)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int8_t;

/* Variables and functions */
int8_t clearBit_fun_int8_t(int8_t x, uint32_t i) { return x & ~(1 << i); }


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

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

LLVM IR (-O0):
define i32 @clearBit_fun_int8_t(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 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @clearBit_fun_int8_t(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void *busy(void *ptr) {
  printf("threadIndex %d is doing sth\n", *((int *)ptr));
  sleep(2);
  return (void *)12345;
}


x86 assembly (clang, -O0):
<busy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    $0x3039,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    $0x3039,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"threadIndex %d is doing sth\0A\00"
define i8* @busy(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @sleep(i32 2)
ret i8* inttoptr (i64 12345 to i8*)
}

LLVM IR (-O2):
@.str = [29 x i8] c"threadIndex %d is doing sth\0A\00"
define i8* @busy(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @sleep(i32 2)
ret i8* inttoptr (i64 12345 to i8*)
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int fsop_path_isreg(const char *path) {
  struct stat st;
  if (stat(path, &st) < 0)
    return -1;
  return S_ISREG(st.st_mode);
}


x86 assembly (clang, -O0):
<fsop_path_isreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    114f <fsop_path_isreg+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    115a <fsop_path_isreg+0x3a>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsop_path_isreg>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     1138 <fsop_path_isreg+0x18>
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fsop_path_isreg(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISREG(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fsop_path_isreg(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int SOL_SOCKET;
int mips_change_level(int level) {
  switch (level) {
  case 1:
    level = SOL_SOCKET;
    break;
  }
  return level;
}


x86 assembly (clang, -O0):
<mips_change_level>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
jne    1124 <mips_change_level+0x24>
jmp    1118 <mips_change_level+0x18>
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mips_change_level>:
mov    %edi,%eax
cmp    $0x1,%edi
jne    1110 <mips_change_level+0x10>
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
define i32 @mips_change_level(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 1, label %4
]
4: ; preds = %1
%5 = load i32, i32* @SOL_SOCKET
store i32 %5, i32* %2
br label %6
6: ; preds = %1, %4
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
define i32 @mips_change_level(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = load i32, i32* @SOL_SOCKET
%4 = select i1 %2, i32 %3, i32 %0
ret i32 %4
}
void file3(void) { printf("Control in function %s\n", __func__); }


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

x86 assembly (clang, -O2):
<file3>:
lea    0xee9(%rip),%rdi
lea    0xefa(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file3 = [6 x i8] c"file3\00"
define void @file3() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Control in function %s\0A\00"
@__func__.file3 = [6 x i8] c"file3\00"
define void @file3() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.file3, i64 0, i64 0))
ret void
}
void pathconN_nm3_incref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm3_incref() {
ret void
}
letter(c) register int c;
{
  if (c >= 'a' && c <= 'z')
    return (c);
  if (c >= 'A' && c <= 'Z')
    return (c + 'a' - 'A');
  return (0);
}


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1126 <letter+0x26>
cmpl   $0x7a,-0x8(%rbp)
jg     1126 <letter+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <letter+0x52>
cmpl   $0x41,-0x8(%rbp)
jl     114b <letter+0x4b>
cmpl   $0x5a,-0x8(%rbp)
jg     114b <letter+0x4b>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1152 <letter+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%edx
xor    %eax,%eax
cmp    $0x1a,%ecx
cmovb  %edx,%eax
lea    -0x61(%rdi),%ecx
cmp    $0x1a,%ecx
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @letter(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add i32 %0, -65
%5 = icmp ult i32 %4, 26
%6 = add nsw i32 %0, 32
%7 = select i1 %5, i32 %6, i32 0
%8 = select i1 %3, i32 %0, i32 %7
ret i32 %8
}