xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
scalar_t__ safe_malloc(size_t);
char *CopyText(const char *string, size_t length) {
  char *out = (char *)safe_malloc(length + 1);
  memcpy(out, string, length);
  out[length] = '\0';
  return out;
}


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

x86 assembly (clang, -O2):
<CopyText>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1030 <safe_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @CopyText(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i64 @safe_malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @CopyText(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @safe_malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
%7 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %7
ret i8* %5
}
int CircularBuffer_incr(int val, int length) { return (val + 1) % length; }


x86 assembly (clang, -O0):
<CircularBuffer_incr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CircularBuffer_incr>:
lea    0x1(%rdi),%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @CircularBuffer_incr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @CircularBuffer_incr(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = srem i32 %3, %1
ret i32 %4
}
int INTEGER(const double a) {
  return (0 < a) ? (int)(a + 0.5) : (int)(a - 0.5);
}


x86 assembly (clang, -O0):
<INTEGER>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1134 <INTEGER+0x34>
movsd  0xedd(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
jmp    114c <INTEGER+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<INTEGER>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
lea    0xeec(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @INTEGER(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double 0.000000e+00, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = fptosi double %7 to i32
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = fptosi double %11 to i32
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ %8, %5 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @INTEGER(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = select i1 %2, double 5.000000e-01, double -5.000000e-01
%4 = fadd double %3, %0
%5 = fptosi double %4 to i32
ret i32 %5
}
int test_imm_62uint8_mem(unsigned char *val) {
  return ((*val) & (-0x62 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_62uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff9e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_62uint8_mem>:
testb  $0x9e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_62uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -98
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_62uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -98
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ sample1();
int /*<<< orphan*/ sample2();
int /*<<< orphan*/ sample3();
int main() {
  sample1();
  sample2();
  sample3();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <sample1@plt>
mov    $0x0,%al
call   1050 <sample2@plt>
mov    $0x0,%al
call   1040 <sample3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sample1@plt>
xor    %eax,%eax
call   1050 <sample2@plt>
xor    %eax,%eax
call   1040 <sample3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @sample1()
%3 = call i32 (...) @sample2()
%4 = call i32 (...) @sample3()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sample1()
%2 = tail call i32 (...) @sample2()
%3 = tail call i32 (...) @sample3()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strupr(char *);
int main(void) {
  char texto[] = "teste";
  strupr(texto);
  printf("%s", texto);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0x6(%rbp),%rdi
call   1040 <strupr@plt>
lea    -0x6(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x65,0xc(%rsp)
movl   $0x74736574,0x8(%rsp)
74
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <strupr@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.texto = [6 x i8] c"teste\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = bitcast [6 x i8]* %1 to i8*
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = call i32 @strupr(i8* %3)
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.texto = [6 x i8] c"teste\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @strupr(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("I knew you'd come back.", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"I knew you'd come back.\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"I knew you'd come back.\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int foo(int);
int entrypoint() { return foo(5); }


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

x86 assembly (clang, -O2):
<entrypoint>:
mov    $0x5,%edi
jmp    1030 <foo@plt>

LLVM IR (-O0):
define i32 @entrypoint() {
%1 = call i32 @foo(i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @entrypoint() {
%1 = tail call i32 @foo(i32 5)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int cread(int fd, char *buf, int n) {
  int nread;
  if ((nread = read(fd, buf, n)) < 0) {
    perror("Reading data");
    exit(1);
  }
  return nread;
}


x86 assembly (clang, -O0):
<cread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1173 <cread+0x43>
lea    0xe9c(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cread>:
push   %rax
call   1030 <read@plt>
test   %eax,%eax
js     113c <cread+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Reading data\00"
define i32 @cread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %3
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
@.str = [13 x i8] c"Reading data\00"
define i32 @cread(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int);
void printversion(FILE *fp) {
  fprintf(fp, "sfet %s, file version: %d\n", "pre3.0-0", 8);
}


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

x86 assembly (clang, -O2):
<printversion>:
lea    0xee9(%rip),%rsi
lea    0xefd(%rip),%rdx
mov    $0x8,%ecx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"sfet %s, file version: %d\0A\00"
@.str.1 = [9 x i8] c"pre3.0-0\00"
define void @printversion(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"sfet %s, file version: %d\0A\00"
@.str.1 = [9 x i8] c"pre3.0-0\00"
define void @printversion(i32* nocapture %0) {
%2 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret void
}
int num_curves(plot)
struct curve_points *plot;
{
  int curves;
  int first_point;
  int num_points;
  first_point = 0;
  curves = 0;
  while ((num_points = next_curve(plot, &first_point)) > 0) {
    curves++;
    first_point += num_points;
  }
  return (curves);
}


x86 assembly (clang, -O0):
<num_curves>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <next_curve@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jle    115c <num_curves+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    112a <num_curves+0x1a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_curves>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
xor    %ebp,%ebp
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <next_curve@plt>
test   %eax,%eax
jle    1158 <num_curves+0x48>
lea    0xc(%rsp),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
add    $0x1,%ebp
add    %eax,0xc(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <next_curve@plt>
test   %eax,%eax
jg     1140 <num_curves+0x30>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.curve_points = type opaque
define i32 @num_curves(%struct.curve_points* %0) {
%2 = alloca %struct.curve_points*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store %struct.curve_points* %0, %struct.curve_points** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load %struct.curve_points*, %struct.curve_points** %2
%8 = call i32 (%struct.curve_points*, i32*, ...) bitcast (i32 (...)* @next_curve to i32 (%struct.curve_points*, i32*, ...)*)(%struct.curve_points* %7, i32* %4)
store i32 %8, i32* %5
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
br label %6
16: ; preds = %6
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.curve_points = type opaque
define i32 @num_curves(%struct.curve_points* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 (%struct.curve_points*, i32*, ...) bitcast (i32 (...)* @next_curve to i32 (%struct.curve_points*, i32*, ...)*)(%struct.curve_points* %0, i32* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1, %6
%7 = phi i32 [ %12, %6 ], [ %4, %1 ]
%8 = phi i32 [ %9, %6 ], [ 0, %1 ]
%9 = add nuw nsw i32 %8, 1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %7
store i32 %11, i32* %2
%12 = call i32 (%struct.curve_points*, i32*, ...) bitcast (i32 (...)* @next_curve to i32 (%struct.curve_points*, i32*, ...)*)(%struct.curve_points* %0, i32* %2)
%13 = icmp sgt i32 %12, 0
br i1 %13, label %6, label %14
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x8e() {
  Assert_real((isalnum(142) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              715, ("isalnum should be 0 for 0x8e"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x8e>:
push   %rax
mov    $0x8e,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2cb,%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_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x8e\00"
define void @t_isalnum_0x8e() {
%1 = call i64 @isalnum(i32 142)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 715, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0x8e\00"
define void @t_isalnum_0x8e() {
%1 = tail call i64 @isalnum(i32 142)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 715, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ferror(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void nocrash_ferror() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    ferror(f);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_ferror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116c <nocrash_ferror+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <ferror@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_ferror>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     115d <nocrash_ferror+0x2d>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <ferror@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_ferror() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 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 = icmp ne i32* %3, null
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @ferror(i32* %6)
%8 = load i32*, i32** %1
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @nocrash_ferror() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @ferror(i32* %1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %3, %0
ret void
}
/* Variables and functions */
char tolower(char);
extern void string_tolower(char *str, size_t len) {
  ((void)0);
  for (char *end = str + len; str < end; str++)
    *str = tolower(*str);
}


x86 assembly (clang, -O0):
<string_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115f <string_tolower+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <string_tolower+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_tolower>:
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
jle    1143 <string_tolower+0x33>
mov    %rsi,%r14
mov    %rdi,%rbx
add    %rdi,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
cmp    %r14,%rbx
jb     1130 <string_tolower+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @string_tolower(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
%4 = icmp sgt i64 %1, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %2
ret void
6: ; preds = %2, %6
%7 = phi i8* [ %10, %6 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = tail call signext i8 @tolower(i8 signext %8)
store i8 %9, i8* %7
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = icmp ult i8* %10, %3
br i1 %11, label %6, label %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  char is_hint;
};
struct TYPE_4__ {
  TYPE_1__ xmotion;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmotion_is_hint(void *_p, char _v) {
  ((XEvent *)_p)->xmotion.is_hint = (char)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xmotion_is_hint>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xmotion_is_hint>:
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i8 }
define void @set_XEvent_xmotion_is_hint(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i8 %5, i8* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmotion_is_hint(i8* nocapture writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
ret void
}
void common_sid_block_end() {}


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

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

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

LLVM IR (-O2):
define void @common_sid_block_end() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_mpy_op();
int /*<<< orphan*/ arm_mpy_smull(int /*<<< orphan*/);
void arm_smull() { arm_mpy_smull(arm_mpy_op()); }


x86 assembly (clang, -O0):
<arm_smull>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_mpy_op@plt>
mov    %eax,%edi
call   1040 <arm_mpy_smull@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_smull>:
push   %rax
xor    %eax,%eax
call   1030 <arm_mpy_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_mpy_smull@plt>

LLVM IR (-O0):
define void @arm_smull() {
%1 = call i32 (...) @arm_mpy_op()
%2 = call i32 @arm_mpy_smull(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_smull() {
%1 = tail call i32 (...) @arm_mpy_op()
%2 = tail call i32 @arm_mpy_smull(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ iconv_t;

/* Variables and functions */
int /*<<< orphan*/ libiconv_open(char const *, char const *);
iconv_t iconv_open(const char *tocode, const char *fromcode) {
  return libiconv_open(tocode, fromcode);
}


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

x86 assembly (clang, -O2):
<iconv_open>:
jmp    1030 <libiconv_open@plt>

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

LLVM IR (-O2):
define i32 @iconv_open(i8* %0, i8* %1) {
%3 = tail call i32 @libiconv_open(i8* %0, i8* %1)
ret i32 %3
}
int adds_si_test3(int a, int b, int c) {
  int d = a + (b << 3);
  if (d == 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<adds_si_test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1133 <adds_si_test3+0x33>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <adds_si_test3+0x3f>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adds_si_test3>:
lea    (%rdi,%rsi,8),%ecx
lea    (%rsi,%rcx,1),%eax
test   %ecx,%ecx
cmove  %edi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @adds_si_test3(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 3
%5 = add nsw i32 %4, %0
%6 = icmp eq i32 %5, 0
%7 = add nsw i32 %5, %1
%8 = select i1 %6, i32 %0, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
#pragma omp parallel
  printf("Hello World\n");
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
scalar_t__ strlen(char *);
int *getResponseLen(char *response) {
  int *len = (int *)malloc(sizeof(int *));
  *len = (int)strlen(response);
  return len;
}


x86 assembly (clang, -O0):
<getResponseLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getResponseLen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @getResponseLen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
%9 = load i32*, i32** %3
store i32 %8, i32* %9
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @getResponseLen(i8* nocapture %0) {
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to i32*
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ check(long);
main() {
  int i = -5;
  check((char)i % (char)2);
  check((short)i % (short)2);
  check(i % 2);
  check((long)i % 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffffb,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rdi
call   1030 <check@plt>
mov    -0x8(%rbp),%eax
cwtl
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rdi
call   1030 <check@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rdi
call   1030 <check@plt>
movslq -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rdx,%rdi
call   1030 <check@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -5, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = sext i8 %4 to i32
%6 = srem i32 %5, 2
%7 = sext i32 %6 to i64
%8 = call i32 @check(i64 %7)
%9 = load i32, i32* %2
%10 = trunc i32 %9 to i16
%11 = sext i16 %10 to i32
%12 = srem i32 %11, 2
%13 = sext i32 %12 to i64
%14 = call i32 @check(i64 %13)
%15 = load i32, i32* %2
%16 = srem i32 %15, 2
%17 = sext i32 %16 to i64
%18 = call i32 @check(i64 %17)
%19 = load i32, i32* %2
%20 = sext i32 %19 to i64
%21 = srem i64 %20, 2
%22 = call i32 @check(i64 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @check(i64 -1)
%2 = tail call i32 @check(i64 -1)
%3 = tail call i32 @check(i64 -1)
%4 = tail call i32 @check(i64 -1)
ret i32 0
}
void ice_clear_arfs(struct ice_vsi *vsi) {}


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

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

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

LLVM IR (-O2):
%struct.ice_vsi = type opaque
define void @ice_clear_arfs(%struct.ice_vsi* nocapture %0) {
ret void
}
int runner() {
  static int count = 0;
  count++;
  return count;
}


x86 assembly (clang, -O0):
<runner>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
mov    0x2f0b(%rip),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<runner>:
mov    0x2f1e(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f15(%rip)
ret

LLVM IR (-O0):
@runner.count = internal global i32 0
define i32 @runner() {
%1 = load i32, i32* @runner.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @runner.count
%3 = load i32, i32* @runner.count
ret i32 %3
}

LLVM IR (-O2):
@runner.count = internal unnamed_addr global i32 0
define i32 @runner() {
%1 = load i32, i32* @runner.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @runner.count
ret i32 %2
}
genrandom(buf) int buf[];
{
  int i;
  srand(_in_(0x1d));
  for (i = 0; i < 256; ++i)
    buf[i] = rand() & 0x3ff;
}


x86 assembly (clang, -O0):
<genrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x1d,%edi
mov    $0x0,%al
call   1040 <_in_@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <srand@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    118d <genrandom+0x5d>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,%edx
and    $0x3ff,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <genrandom+0x28>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrandom>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1d,%edi
xor    %eax,%eax
call   1040 <_in_@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1030 <srand@plt>
xor    %ebx,%ebx
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <rand@plt>
and    $0x3ff,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1150 <genrandom+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @genrandom(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @_in_ to i32 (i32, ...)*)(i32 29)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %5)
store i32 0, i32* %4
br label %7
7: ; preds = %17, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = call i32 (...) @rand()
%12 = and i32 %11, 1023
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 %12, i32* %16
br label %17
17: ; preds = %10
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %7
20: ; preds = %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @genrandom(i32* nocapture writeonly %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @_in_ to i32 (i32, ...)*)(i32 29)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %2)
br label %4
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %9, %4 ]
%6 = tail call i32 (...) @rand()
%7 = and i32 %6, 1023
%8 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %7, i32* %8
%9 = add nuw nsw i64 %5, 1
%10 = icmp eq i64 %9, 256
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 undef
}
void osalSysEnable(void) {}


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

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

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

LLVM IR (-O2):
define void @osalSysEnable() {
ret void
}
int minstrel_ewmv(int old_ewmv, int cur_prob, int prob_ewma, int weight) {
  int diff, incr;
  diff = cur_prob - prob_ewma;
  incr = (128 - weight) * diff / 128;
  return weight * (old_ewmv + ((diff * incr) >> 12)) / 128;
}


x86 assembly (clang, -O0):
<minstrel_ewmv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x80,%eax
sub    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x14(%rbp),%edx
imul   -0x18(%rbp),%edx
sar    $0xc,%edx
add    %edx,%ecx
imul   %ecx,%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<minstrel_ewmv>:
sub    %edx,%esi
mov    $0x80,%eax
sub    %ecx,%eax
imul   %esi,%eax
lea    0x7f(%rax),%edx
test   %eax,%eax
cmovns %eax,%edx
sar    $0x7,%edx
imul   %esi,%edx
sar    $0xc,%edx
add    %edi,%edx
imul   %ecx,%edx
lea    0x7f(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
sar    $0x7,%eax
ret

LLVM IR (-O0):
define i32 @minstrel_ewmv(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %8
%15 = sub nsw i32 128, %14
%16 = load i32, i32* %9
%17 = mul nsw i32 %15, %16
%18 = sdiv i32 %17, 128
store i32 %18, i32* %10
%19 = load i32, i32* %8
%20 = load i32, i32* %5
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = mul nsw i32 %21, %22
%24 = ashr i32 %23, 12
%25 = add nsw i32 %20, %24
%26 = mul nsw i32 %19, %25
%27 = sdiv i32 %26, 128
ret i32 %27
}

LLVM IR (-O2):
define i32 @minstrel_ewmv(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %1, %2
%6 = sub nsw i32 128, %3
%7 = mul nsw i32 %6, %5
%8 = sdiv i32 %7, 128
%9 = mul nsw i32 %8, %5
%10 = ashr i32 %9, 12
%11 = add nsw i32 %10, %0
%12 = mul nsw i32 %11, %3
%13 = sdiv i32 %12, 128
ret i32 %13
}
void EEPROMWaitForDone(void) {
  while ((*((volatile unsigned long *)(0x400AF018))) & 0x00000001) {
  }
}


x86 assembly (clang, -O0):
<EEPROMWaitForDone>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <EEPROMWaitForDone+0x9>
mov    $0x400af018,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1124 <EEPROMWaitForDone+0x24>
jmp    1109 <EEPROMWaitForDone+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMWaitForDone>:
mov    0x400af018,%rax
40
test   $0x1,%al
jne    1100 <EEPROMWaitForDone>
ret

LLVM IR (-O0):
define void @EEPROMWaitForDone() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
%3 = and i64 %2, 1
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @EEPROMWaitForDone() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1074458648 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int w;
  scanf("%d", &w);
  if (w != 2 && w % 2 == 0)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
je     116e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116e <main+0x4e>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    117a <main+0x5a>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
test   $0x1,%al
lea    0xec7(%rip),%rdi
lea    0xebd(%rip),%rcx
cmovne %rcx,%rdi
cmp    $0x2,%eax
cmove  %rcx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [3 x i8] c"NO\00"
@str.3 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 2
%6 = and i32 %4, 1
%7 = icmp eq i32 %6, 0
%8 = and i1 %5, %7
%9 = select i1 %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
/* Variables and functions */
void Default_TIMER0_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @Default_TIMER0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eth_addr_mark_random(int /*<<< orphan*/ *);
int /*<<< orphan*/ random_bytes(int /*<<< orphan*/ *, int);
void eth_addr_random(uint8_t ea[6]) {
  random_bytes(ea, 6);
  eth_addr_mark_random(ea);
}


x86 assembly (clang, -O0):
<eth_addr_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1040 <random_bytes@plt>
mov    -0x8(%rbp),%rdi
call   1030 <eth_addr_mark_random@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eth_addr_random>:
push   %rbx
mov    %rdi,%rbx
mov    $0x6,%esi
call   1040 <random_bytes@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <eth_addr_mark_random@plt>

LLVM IR (-O0):
define void @eth_addr_random(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @random_bytes(i32* %3, i32 6)
%5 = load i32*, i32** %2
%6 = call i32 @eth_addr_mark_random(i32* %5)
ret void
}

LLVM IR (-O2):
define void @eth_addr_random(i32* %0) {
%2 = tail call i32 @random_bytes(i32* %0, i32 6)
%3 = tail call i32 @eth_addr_mark_random(i32* %0)
ret void
}
/* Variables and functions */
int swapNibble16(unsigned int);
unsigned int swapNibble32(unsigned int value) {
  return swapNibble16(value >> 16) | (swapNibble16(value) << 16);
}


x86 assembly (clang, -O0):
<swapNibble32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
shr    $0x10,%edi
call   1030 <swapNibble16@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <swapNibble16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x10,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapNibble32>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
shr    $0x10,%edi
call   1030 <swapNibble16@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <swapNibble16@plt>
shl    $0x10,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @swapNibble32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = call i32 @swapNibble16(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @swapNibble16(i32 %6)
%8 = shl i32 %7, 16
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @swapNibble32(i32 %0) {
%2 = lshr i32 %0, 16
%3 = tail call i32 @swapNibble16(i32 %2)
%4 = tail call i32 @swapNibble16(i32 %0)
%5 = shl i32 %4, 16
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int fio_write_8(int /*<<< orphan*/ *, int);
scalar_t__ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
int fio_abs_write_8(FILE *f, long offset, int val) {
  if (fseek(f, offset, SEEK_SET) != 0)
    return -1;
  return (fio_write_8(f, val));
}


x86 assembly (clang, -O0):
<fio_abs_write_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
cmp    $0x0,%rax
je     115f <fio_abs_write_8+0x3f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <fio_abs_write_8+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <fio_write_8@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fio_abs_write_8>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
test   %rax,%rax
je     1147 <fio_abs_write_8+0x27>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fio_write_8@plt>

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

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @fio_abs_write_8(i32* %0, i64 %1, i32 %2) {
%4 = load i32, i32* @SEEK_SET
%5 = tail call i64 @fseek(i32* %0, i64 %1, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @fio_write_8(i32* %0, i32 %2)
br label %9
9: ; preds = %3, %7
%10 = phi i32 [ %8, %7 ], [ -1, %3 ]
ret i32 %10
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ initTermios(int);
scalar_t__ isprint(char);
int /*<<< orphan*/ resetTermios();
char getch_(void) {
  char ch;
  ch = getchar();
  if (isprint(ch)) {
    initTermios(1);
  } else {
    initTermios(0);
  }
  resetTermios();
  return ch;
}


x86 assembly (clang, -O0):
<getch_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     1174 <getch_+0x34>
mov    $0x1,%edi
call   1060 <initTermios@plt>
jmp    117b <getch_+0x3b>
xor    %edi,%edi
call   1060 <initTermios@plt>
mov    $0x0,%al
call   1030 <resetTermios@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch_>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1050 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <initTermios@plt>
xor    %eax,%eax
call   1030 <resetTermios@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @getch_() {
%1 = alloca i8
%2 = call signext i8 (...) @getchar()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = call i64 @isprint(i8 signext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @initTermios(i32 1)
br label %10
8: ; preds = %0
%9 = call i32 @initTermios(i32 0)
br label %10
10: ; preds = %8, %6
%11 = call i32 (...) @resetTermios()
%12 = load i8, i8* %1
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @getch_() {
%1 = tail call signext i8 (...) @getchar()
%2 = tail call i64 @isprint(i8 signext %1)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @initTermios(i32 %4)
%6 = tail call i32 (...) @resetTermios()
ret i8 %1
}