xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int h, r, b;
  scanf("%d", &h);
  b = h * h;
  r = b * h;
  printf("%d\n", b);
  printf("%d\n", r);
  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>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
imul   %esi,%ebx
lea    0xebb(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ showarray_1(int *);
void array_1(void) {
  int primes[] = {2, 3, 5, 7, 9, 11, 13};
  showarray_1(primes);
}


x86 assembly (clang, -O0):
<array_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed9(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <showarray_1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_1>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <showarray_1@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.array_1.primes = [7 x i32] [i32 2, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13]
define void @array_1() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @showarray_1(i32* %3)
ret void
}

LLVM IR (-O2):
@__const.array_1.primes = [7 x i32] [i32 2, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13]
define void @array_1() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @showarray_1(i32* %3)
ret void
}
/* Variables and functions */
int html_string(char *, char *);
int html_tablecloserow() { return html_string("%s\n", "</TR>"); }


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

x86 assembly (clang, -O2):
<html_tablecloserow>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <html_string@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"</TR>\00"
define i32 @html_tablecloserow() {
%1 = call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"</TR>\00"
define i32 @html_tablecloserow() {
%1 = tail call i32 @html_string(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
double sin(double);
double Tween_SinusoidalOutEasing(double k) { return sin(k * 3.14159265 / 2); }


x86 assembly (clang, -O0):
<Tween_SinusoidalOutEasing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xece(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Tween_SinusoidalOutEasing>:
mulsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @Tween_SinusoidalOutEasing(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB53C8D4F1
%5 = fdiv double %4, 2.000000e+00
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @Tween_SinusoidalOutEasing(double %0) {
%2 = fmul double %0, 0x400921FB53C8D4F1
%3 = fmul double %2, 5.000000e-01
%4 = tail call double @sin(double %3)
ret double %4
}
int wfile_slash(int c) { return (c == '/'); }


x86 assembly (clang, -O0):
<wfile_slash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x2f,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wfile_slash>:
xor    %eax,%eax
cmp    $0x2f,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @wfile_slash(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 47
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @wfile_slash(i32 %0) {
%2 = icmp eq i32 %0, 47
%3 = zext i1 %2 to i32
ret i32 %3
}
int Operand_bs16_encode(unsigned int *valp) {
  int error;
  error = (*valp & ~(0 << 4)) != 0;
  *valp = *valp >> 4;
  return error;
}


x86 assembly (clang, -O0):
<Operand_bs16_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0xffffffff,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shr    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Operand_bs16_encode>:
mov    (%rdi),%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
shr    $0x4,%ecx
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define i32 @Operand_bs16_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = and i32 %5, -1
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = lshr i32 %10, 4
%12 = load i32*, i32** %2
store i32 %11, i32* %12
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @Operand_bs16_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
%5 = lshr i32 %2, 4
store i32 %5, i32* %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rrc_hl();
void opcb_0e() { rrc_hl(); }


x86 assembly (clang, -O0):
<opcb_0e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rrc_hl@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @opcb_0e() {
%1 = call i32 (...) @rrc_hl()
ret void
}

LLVM IR (-O2):
define void @opcb_0e() {
%1 = tail call i32 (...) @rrc_hl()
ret void
}
int gcd(int m, int n) {
  int tmp;
  while (m) {
    tmp = m;
    m = n % m;
    n = tmp;
  }
  return n;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112f <gcd+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110a <gcd+0xa>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
je     111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %5, %4 ], [ %1, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %1, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int i(int);
int /*<<< orphan*/ printf(char *, int);
int h(int param1) {
  int g1;
  printf("h(%d)\n", param1);
  g1 = param1;
  if (param1 > 0) {
    g1 = i(param1 - 1);
  }
  return g1;
}


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1158 <h+0x38>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <i@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
test   %ebx,%ebx
jle    1140 <h+0x20>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <i@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"h(%d)\0A\00"
define i32 @h(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @i(i32 %5)
br label %7
7: ; preds = %4, %1
%8 = phi i32 [ %6, %4 ], [ %0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ db_init(int);
int /*<<< orphan*/ random_value();
void db_init_test(int show) {
  random_value();
  db_init((1024 * 1024 * 1024));
}


x86 assembly (clang, -O0):
<db_init_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <random_value@plt>
mov    $0x40000000,%edi
call   1030 <db_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_init_test>:
push   %rax
xor    %eax,%eax
call   1040 <random_value@plt>
mov    $0x40000000,%edi
pop    %rax
jmp    1030 <db_init@plt>

LLVM IR (-O0):
define void @db_init_test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @random_value()
%4 = call i32 @db_init(i32 1073741824)
ret void
}

LLVM IR (-O2):
define void @db_init_test(i32 %0) {
%2 = tail call i32 (...) @random_value()
%3 = tail call i32 @db_init(i32 1073741824)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testmod_display_version();
int main(int argc, char *argv[]) {
  testmod_display_version();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testmod_display_version()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void trouble(void) {
  fprintf(stderr, "diff3: logic error\n");
  abort();
}


x86 assembly (clang, -O0):
<trouble>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<trouble>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"diff3: logic error\0A\00"
define void @trouble() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"diff3: logic error\0A\00"
define void @trouble() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
void XtIsTopLevelShell() {}


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

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

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

LLVM IR (-O2):
define void @XtIsTopLevelShell() {
ret void
}
char *XScreenResourceString() {}


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

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

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

LLVM IR (-O2):
define noalias i8* @XScreenResourceString() {
ret i8* undef
}
/* Variables and functions */
size_t fread(void *, size_t, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ fwrite(void *, size_t, size_t, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
size_t pump(void *ptr, size_t isz, size_t cnt) {
  size_t i = fread(ptr, isz, cnt, stdin);
  if (i)
    fwrite(ptr, isz, i, stdout);
  return i;
}


x86 assembly (clang, -O0):
<pump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
call   1030 <fread@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1177 <pump+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    0x2e68(%rip),%rax
mov    (%rax),%ecx
call   1040 <fwrite@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pump>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2eb6(%rip),%rax
mov    (%rax),%ecx
call   1030 <fread@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <pump+0x38>
mov    0x2e90(%rip),%rax
mov    (%rax),%ecx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <fwrite@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@stdout = global i32 0
define i64 @pump(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i64, i64* %6
%11 = load i32, i32* @stdin
%12 = call i64 @fread(i8* %8, i64 %9, i64 %10, i32 %11)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i64, i64* %5
%18 = load i64, i64* %7
%19 = load i32, i32* @stdout
%20 = call i32 @fwrite(i8* %16, i64 %17, i64 %18, i32 %19)
br label %21
21: ; preds = %15, %3
%22 = load i64, i64* %7
ret i64 %22
}

LLVM IR (-O2):
@stdin = global i32 0
@stdout = global i32 0
define i64 @pump(i8* %0, i64 %1, i64 %2) {
%4 = load i32, i32* @stdin
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = load i32, i32* @stdout
%9 = tail call i32 @fwrite(i8* %0, i64 %1, i64 %5, i32 %8)
br label %10
10: ; preds = %7, %3
ret i64 %5
}
int minmax_fanspeed(int fanspeed) {
  if (fanspeed > 5800) {
    return 5800;
  }
  if (fanspeed < 1500) {
    return 1500;
  }
  return fanspeed;
}


x86 assembly (clang, -O0):
<minmax_fanspeed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x16a8,-0x8(%rbp)
jle    1120 <minmax_fanspeed+0x20>
movl   $0x16a8,-0x4(%rbp)
jmp    113f <minmax_fanspeed+0x3f>
cmpl   $0x5dc,-0x8(%rbp)
jge    1139 <minmax_fanspeed+0x39>
movl   $0x5dc,-0x4(%rbp)
jmp    113f <minmax_fanspeed+0x3f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minmax_fanspeed>:
cmp    $0x5dd,%edi
mov    $0x5dc,%ecx
cmovge %edi,%ecx
cmp    $0x16a8,%ecx
mov    $0x16a8,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @minmax_fanspeed(i32 %0) {
%2 = icmp sgt i32 %0, 1500
%3 = select i1 %2, i32 %0, i32 1500
%4 = icmp ult i32 %3, 5800
%5 = select i1 %4, i32 %3, i32 5800
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SETVAL;
int /*<<< orphan*/ handle_fatal_error(char *);
scalar_t__ semctl(int, int, int /*<<< orphan*/, int);
void initialize_semaphore(int semid, int index, int valeur) {
  if (semctl(semid, index, SETVAL, valeur) < 0) {
    handle_fatal_error("Error when initializing semaphore.\n");
  }
}


x86 assembly (clang, -O0):
<initialize_semaphore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
call   1040 <semctl@plt>
cmp    $0x0,%rax
jge    115e <initialize_semaphore+0x3e>
lea    0xea7(%rip),%rdi
call   1030 <handle_fatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_semaphore>:
push   %rax
mov    %edx,%ecx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
call   1040 <semctl@plt>
test   %rax,%rax
js     1138 <initialize_semaphore+0x18>
pop    %rax
ret
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1030 <handle_fatal_error@plt>

LLVM IR (-O0):
@SETVAL = global i32 0
@.str = [36 x i8] c"Error when initializing semaphore.\0A\00"
define void @initialize_semaphore(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* @SETVAL
%10 = load i32, i32* %6
%11 = call i64 @semctl(i32 %7, i32 %8, i32 %9, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @handle_fatal_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
@SETVAL = global i32 0
@.str = [36 x i8] c"Error when initializing semaphore.\0A\00"
define void @initialize_semaphore(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @SETVAL
%5 = tail call i64 @semctl(i32 %0, i32 %1, i32 %4, i32 %2)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @handle_fatal_error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %3
ret void
}
/* Type definitions */
struct hostlist_t {
  int dummy;
};

/* Variables and functions */
struct hostlist_t *hostlist_push(struct hostlist_t **, char *, unsigned long,
                                 unsigned long);
struct hostlist_t *hostlist_ip_push(struct hostlist_t **hl,
                                    unsigned long int ip,
                                    unsigned long int netmask) {
  return hostlist_push(hl, (char *)0, ip, netmask);
}


x86 assembly (clang, -O0):
<hostlist_ip_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <hostlist_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hostlist_ip_push>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <hostlist_push@plt>

LLVM IR (-O0):
%struct.hostlist_t = type { i32 }
define %struct.hostlist_t* @hostlist_ip_push(%struct.hostlist_t** %0, i64 %1, i64 %2) {
%4 = alloca %struct.hostlist_t**
%5 = alloca i64
%6 = alloca i64
store %struct.hostlist_t** %0, %struct.hostlist_t*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load %struct.hostlist_t**, %struct.hostlist_t*** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call %struct.hostlist_t* @hostlist_push(%struct.hostlist_t** %7, i8* null, i64 %8, i64 %9)
ret %struct.hostlist_t* %10
}

LLVM IR (-O2):
%struct.hostlist_t = type { i32 }
define %struct.hostlist_t* @hostlist_ip_push(%struct.hostlist_t** %0, i64 %1, i64 %2) {
%4 = tail call %struct.hostlist_t* @hostlist_push(%struct.hostlist_t** %0, i8* null, i64 %1, i64 %2)
ret %struct.hostlist_t* %4
}
/* Variables and functions */
int __sbtoupper(int);
int toupper(int c) { return (__sbtoupper(c)); }


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

x86 assembly (clang, -O2):
<toupper>:
jmp    1030 <__sbtoupper@plt>

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i32 @__sbtoupper(i32 %0)
ret i32 %2
}
void rte_prefetch2(const volatile void *p) {
  __asm__ volatile("prefetcht2 %[p]" : : [p] "m"(*(const volatile char *)p));
}


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

x86 assembly (clang, -O2):
<rte_prefetch2>:
prefetcht2 (%rdi)
ret

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

LLVM IR (-O2):
define void @rte_prefetch2(i8* %0) {
tail call void asm sideeffect "prefetcht2 $0", "*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret void
}
int main(void) {
  volatile int j = 0x7fffffff;
  volatile int i = 1;
  volatile int k = j + i;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x7fffffff,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x7fffffff,-0x8(%rsp)
7f
movl   $0x1,-0xc(%rsp)
mov    -0x8(%rsp),%eax
add    -0xc(%rsp),%eax
mov    %eax,-0x4(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store volatile i32 2147483647, i32* %1
%5 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %2
%6 = bitcast i32* %3 to i8*
%7 = load volatile i32, i32* %1
%8 = load volatile i32, i32* %2
%9 = add nsw i32 %8, %7
store volatile i32 %9, i32* %3
ret i32 0
}
int nonagon(int num) { return (num * ((7 * num) - 5)) / 2; }


x86 assembly (clang, -O0):
<nonagon>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x7,-0x4(%rbp),%ecx
sub    $0x5,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<nonagon>:
lea    0x0(,%rdi,8),%ecx
sub    %edi,%ecx
add    $0xfffffffb,%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @nonagon(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 7, %4
%6 = sub nsw i32 %5, 5
%7 = mul nsw i32 %3, %6
%8 = sdiv i32 %7, 2
ret i32 %8
}

LLVM IR (-O2):
define i32 @nonagon(i32 %0) {
%2 = mul nsw i32 %0, 7
%3 = add nsw i32 %2, -5
%4 = mul nsw i32 %3, %0
%5 = sdiv i32 %4, 2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int func(short sw, char *str) {
  printf("first char = %c\n", *str);
  if (sw)
    return 2;
  return 3;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
cmpw   $0x0,-0x6(%rbp)
je     114d <func+0x3d>
movl   $0x2,-0x4(%rbp)
jmp    1154 <func+0x44>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
mov    %edi,%ebx
movsbl (%rsi),%esi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
test   %bx,%bx
sete   %al
or     $0x2,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [17 x i8] c"first char = %c\0A\00"
define i32 @func(i16 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp eq i16 %0, 0
%6 = select i1 %5, i32 3, i32 2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ hz_abort(char *);
char *hz_strncpy(char *, char const *, size_t);
char *hz_assert_strncpy_ok(char *dest, const char *src, size_t count) {
  char *ret = hz_strncpy(dest, src, count);
  if (ret == NULL) {
    hz_abort("strncpy failed when it shouldn't have");
  }
  return ret;
}


x86 assembly (clang, -O0):
<hz_assert_strncpy_ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <hz_strncpy@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1160 <hz_assert_strncpy_ok+0x40>
lea    0xea5(%rip),%rdi
call   1030 <hz_abort@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hz_assert_strncpy_ok>:
push   %rbx
call   1040 <hz_strncpy@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <hz_assert_strncpy_ok+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <hz_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"strncpy failed when it shouldn't have\00"
define i8* @hz_assert_strncpy_ok(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @hz_strncpy(i8* %8, i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @hz_abort(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@.str = [38 x i8] c"strncpy failed when it shouldn't have\00"
define i8* @hz_assert_strncpy_ok(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @hz_strncpy(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @hz_abort(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i8* %4
}
unsigned char _ucAsyncSendBuf(void *pBuf, unsigned int uiLen) { return (1); }


x86 assembly (clang, -O0):
<_ucAsyncSendBuf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define zeroext i8 @_ucAsyncSendBuf(i8* nocapture readnone %0, i32 %1) {
ret i8 1
}
void av_bsf_next() {}


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

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

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

LLVM IR (-O2):
define void @av_bsf_next() {
ret void
}
int wTimer_num(void) { return 100; }


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

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

LLVM IR (-O0):
define i32 @wTimer_num() {
ret i32 100
}

LLVM IR (-O2):
define i32 @wTimer_num() {
ret i32 100
}
long double nanl(const char *tagp) { return __builtin_nanl(""); }


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

x86 assembly (clang, -O2):
<nanl>:
flds   0xefa(%rip)
ret

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

LLVM IR (-O2):
define x86_fp80 @nanl(i8* nocapture readnone %0) {
ret x86_fp80 0xK7FFFC000000000000000
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void jtag_reset_to_idle(volatile uint32_t *host) {
  host[0] = 0x80000000 | (5 << 16) | 0x1F;
}


x86 assembly (clang, -O0):
<jtag_reset_to_idle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x8005001f,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<jtag_reset_to_idle>:
movl   $0x8005001f,(%rdi)
ret

LLVM IR (-O0):
define void @jtag_reset_to_idle(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
store volatile i32 -2147155937, i32* %4
ret void
}

LLVM IR (-O2):
define void @jtag_reset_to_idle(i32* %0) {
store volatile i32 -2147155937, i32* %0
ret void
}
void disable_fiq(int fiq) {}


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

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

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

LLVM IR (-O2):
define void @disable_fiq(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void thread(void) {
  int i;
  for (i = 0; i < 3; ++i) {
    printf("This is a pthread.\n");
  }
}


x86 assembly (clang, -O0):
<thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x3,-0x4(%rbp)
jge    1143 <thread+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <thread+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"This is a pthread.\0A\00"
define void @thread() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 3
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"This is a pthread.\00"
define void @thread() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *join(char, char const *, char const *);
char *join_path(const char *base, const char *suffix) {
  return join('/', base, suffix);
}


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

x86 assembly (clang, -O2):
<join_path>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2f,%edi
jmp    1030 <join@plt>

LLVM IR (-O0):
define i8* @join_path(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 i8* @join(i8 signext 47, i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @join_path(i8* %0, i8* %1) {
%3 = tail call i8* @join(i8 signext 47, i8* %0, i8* %1)
ret i8* %3
}
void __DELETE_java_util_PropertyPermission(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_util_PropertyPermission(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void l4x_debug_stats_pagefault_but_in_PTs_hit(void) {}


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

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

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

LLVM IR (-O2):
define void @l4x_debug_stats_pagefault_but_in_PTs_hit() {
ret void
}
char compl(char c) {
  if (c == 0)
    return 3;
  if (c == 1)
    return 2;
  if (c == 2)
    return 1;
  if (c == 3)
    return 0;
  return 99;
}


x86 assembly (clang, -O0):
<compl>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1120 <compl+0x20>
movb   $0x3,-0x1(%rbp)
jmp    1166 <compl+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1136 <compl+0x36>
movb   $0x2,-0x1(%rbp)
jmp    1166 <compl+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x2,%eax
jne    114c <compl+0x4c>
movb   $0x1,-0x1(%rbp)
jmp    1166 <compl+0x66>
movsbl -0x2(%rbp),%eax
cmp    $0x3,%eax
jne    1162 <compl+0x62>
movb   $0x0,-0x1(%rbp)
jmp    1166 <compl+0x66>
movb   $0x63,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compl>:
mov    $0x3,%al
sub    %dil,%al
cmp    $0x4,%dil
movzbl %al,%ecx
mov    $0x63,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @compl(i8 signext %0) {
%2 = icmp ult i8 %0, 4
%3 = sub i8 3, %0
%4 = select i1 %2, i8 %3, i8 99
ret i8 %4
}
void mdea_string_input_destroy(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @mdea_string_input_destroy(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getch();
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void System_Pause(void) {
  getchar();
  printf("\nPress any key to continue:");
  getch();
}


x86 assembly (clang, -O0):
<System_Pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<System_Pause>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <getch@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"\0APress any key to continue:\00"
define void @System_Pause() {
%1 = call i32 (...) @getchar()
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"\0APress any key to continue:\00"
define void @System_Pause() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @getch()
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ memset(struct timezone *, int /*<<< orphan*/, int);
unsigned long mytime() {
  struct timeval tv;
  struct timezone tz;
  memset(&tz, 0, sizeof(struct timezone));
  gettimeofday(&tv, &tz);
  return 1000000 * tv.tv_sec + tv.tv_usec;
}


x86 assembly (clang, -O0):
<mytime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mytime>:
push   %rbx
sub    $0x20,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <gettimeofday@plt>
movslq 0x10(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x18(%rsp),%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define i64 @mytime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @memset(%struct.timezone* %2, i32 0, i32 4)
%4 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 1000000, %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.timezone = type { i32 }
define i64 @mytime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @memset(%struct.timezone* %2, i32 0, i32 4)
%6 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000000
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%12 = load i64, i64* %11
%13 = add i64 %12, %10
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_102() {
  Assert_real((isqrt(102) == 10),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              515, ("Integer square root of 102 should be 10"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 102 should be 10\00"
define void @t_sqrt_102() {
%1 = call i32 @isqrt(i32 102)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 102 should be 10\00"
define void @t_sqrt_102() {
%1 = tail call i32 @isqrt(i32 102)
%2 = icmp eq i32 %1, 10
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 515, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int socket(int, int, int);
int Socket(int family, int type, int protocol) {
  int sock_fd;
  sock_fd = socket(family, type, protocol);
  if (sock_fd < 0) {
    return -1;
  }
  return sock_fd;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <socket@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1148 <Socket+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <Socket+0x3e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rax
call   1030 <socket@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Socket(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 = load i32, i32* %7
%12 = call i32 @socket(i32 %9, i32 %10, i32 %11)
store i32 %12, i32* %8
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i32 -1, i32* %4
br label %18
16: ; preds = %3
%17 = load i32, i32* %8
store i32 %17, i32* %4
br label %18
18: ; preds = %16, %15
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp sgt i32 %4, -1
%6 = select i1 %5, i32 %4, i32 -1
ret i32 %6
}
void avpriv_slicethread_create() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_slicethread_create() {
ret void
}
/* Variables and functions */
int ex_large_model(int);
int exlgmd(int *idexo) { return (ex_large_model(*idexo)); }


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

x86 assembly (clang, -O2):
<exlgmd>:
mov    (%rdi),%edi
jmp    1030 <ex_large_model@plt>

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

LLVM IR (-O2):
define i32 @exlgmd(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ex_large_model(i32 %2)
ret i32 %3
}