xunge/DecIR huggingface dataset:
double xi(int i, int k, int j, double kappa, double beta, double alpha) {
  double val = 0.0;
  if (i == 1) {
    val = beta;
  } else {
    val = kappa;
  }
  return (val);
}


x86 assembly (clang, -O0):
<xi>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113d <xi+0x3d>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    1147 <xi+0x47>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<xi>:
cmp    $0x1,%edi
je     1108 <xi+0x8>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @xi(i32 %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
store double 0.000000e+00, double* %13
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %18
16: ; preds = %6
%17 = load double, double* %11
store double %17, double* %13
br label %20
18: ; preds = %6
%19 = load double, double* %10
store double %19, double* %13
br label %20
20: ; preds = %18, %16
%21 = load double, double* %13
ret double %21
}

LLVM IR (-O2):
define double @xi(i32 %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = icmp eq i32 %0, 1
%8 = select i1 %7, double %4, double %3
ret double %8
}
int test_imm_7Auint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x7A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Auint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x7a,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Auint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 122
%7 = icmp ne i64 %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_7Auint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 523986010112
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long grib_op_and(long a, long b) { return a && b; }


x86 assembly (clang, -O0):
<grib_op_and>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1127 <grib_op_and+0x27>
cmpq   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_and>:
test   %rdi,%rdi
setne  %al
test   %rsi,%rsi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i64 @grib_op_and(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
define i64 @grib_op_and(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, 0
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun1() { printf("This Fun1 \n"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"This Fun1 \0A\00"
define void @fun1() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"This Fun1 \00"
define void @fun1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndExit(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS)
    stream = stdout;
  fprintf(stream, "Usage: %s [file] [proj]\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndExit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndExit+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndExit>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndExit+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndExit+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [25 x i8] c"Usage: %s [file] [proj]\0A\00"
define void @helpAndExit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [25 x i8] c"Usage: %s [file] [proj]\0A\00"
define void @helpAndExit(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
char zerotomin(char c) {
  if (c == 0)
    return 'n';
  if (c == 1)
    return 'y';
  return c;
}


x86 assembly (clang, -O0):
<zerotomin>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1120 <zerotomin+0x20>
movb   $0x6e,-0x1(%rbp)
jmp    113c <zerotomin+0x3c>
movsbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1136 <zerotomin+0x36>
movb   $0x79,-0x1(%rbp)
jmp    113c <zerotomin+0x3c>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zerotomin>:
mov    %edi,%eax
test   %al,%al
je     110d <zerotomin+0xd>
cmp    $0x1,%al
jne    110c <zerotomin+0xc>
mov    $0x79,%al
ret
mov    $0x6e,%al
ret

LLVM IR (-O0):
define signext i8 @zerotomin(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 110, i8* %2
br label %15
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 121, i8* %2
br label %15
13: ; preds = %8
%14 = load i8, i8* %3
store i8 %14, i8* %2
br label %15
15: ; preds = %13, %12, %7
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @zerotomin(i8 signext %0) {
switch i8 %0, label %3 [
i8 0, label %4
i8 1, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i8 [ 121, %2 ], [ %0, %3 ], [ 110, %1 ]
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int get_octet(int block) {
  assert(block >= 0 && block < 8);
  return (block * 5) / 8;
}


x86 assembly (clang, -O0):
<get_octet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1134 <get_octet+0x24>
cmpl   $0x8,-0x4(%rbp)
setl   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
imul   $0x5,-0x4(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_octet>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x8,%ebx
setb   %dil
call   1030 <assert@plt>
lea    (%rbx,%rbx,4),%ecx
lea    (%rbx,%rbx,4),%eax
add    $0x7,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_octet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 8
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 5
%14 = sdiv i32 %13, 8
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_octet(i32 %0) {
%2 = icmp ult i32 %0, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = mul nsw i32 %0, 5
%6 = sdiv i32 %5, 8
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_7044() {
  Assert_real((isqrt(7044) == 83),
              "/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",
              1420, ("Integer square root of 7044 should be 83"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_7044>:
push   %rax
mov    $0x1b84,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x53,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x58c,%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 = [41 x i8] c"Integer square root of 7044 should be 83\00"
define void @t_sqrt_7044() {
%1 = call i32 @isqrt(i32 7044)
%2 = icmp eq i32 %1, 83
%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 1420, i8* getelementptr inbounds ([41 x i8], [41 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 = [41 x i8] c"Integer square root of 7044 should be 83\00"
define void @t_sqrt_7044() {
%1 = tail call i32 @isqrt(i32 7044)
%2 = icmp eq i32 %1, 83
%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 1420, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ matchcurves(char *, char *, char **);
int /*<<< orphan*/ matchfree(char **);
int isfunc(char *string) {
  char *res[3] = {0};
  char *decollator = "()";
  if (matchcurves(string, decollator, res)) {
    matchfree(res);
    return 1;
  }
  matchfree(res);
  return 0;
}


x86 assembly (clang, -O0):
<isfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x18,%edx
call   1040 <memset@plt>
lea    0xead(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1050 <matchcurves@plt>
cmp    $0x0,%rax
je     1187 <isfunc+0x57>
lea    -0x30(%rbp),%rdi
call   1030 <matchfree@plt>
movl   $0x1,-0x4(%rbp)
jmp    1197 <isfunc+0x67>
lea    -0x30(%rbp),%rdi
call   1030 <matchfree@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isfunc>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movq   $0x0,0x10(%rsp)
lea    0xec3(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <matchcurves@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %rbx,%rdi
call   1030 <matchfree@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"()\00"
define i32 @isfunc(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [3 x i8*]
%5 = alloca i8*
store i8* %0, i8** %3
%6 = bitcast [3 x i8*]* %4 to i8*
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%10 = call i64 @matchcurves(i8* %7, i8* %8, i8** %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%14 = call i32 @matchfree(i8** %13)
store i32 1, i32* %2
br label %18
15: ; preds = %1
%16 = getelementptr inbounds [3 x i8*], [3 x i8*]* %4, i64 0, i64 0
%17 = call i32 @matchfree(i8** %16)
store i32 0, i32* %2
br label %18
18: ; preds = %15, %12
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@.str = [3 x i8] c"()\00"
define i32 @isfunc(i8* %0) {
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%5 = call i64 @matchcurves(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4)
%6 = icmp ne i64 %5, 0
%7 = call i32 @matchfree(i8** %4)
%8 = zext i1 %6 to i32
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dummy_xship(int /*<<< orphan*/ *, int, char *, int);
int flate_xship(FILE *f, int filter, char *s, int len) {
  return dummy_xship(f, filter, s, len);
}


x86 assembly (clang, -O0):
<flate_xship>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <dummy_xship@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flate_xship>:
jmp    1030 <dummy_xship@plt>

LLVM IR (-O0):
define i32 @flate_xship(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @dummy_xship(i32* %9, i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @flate_xship(i32* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @dummy_xship(i32* %0, i32 %1, i8* %2, i32 %3)
ret i32 %5
}
int get_lpo2(int x) { return (sizeof(x) * 8) - (__builtin_clz(x - 1) + 1); }


x86 assembly (clang, -O0):
<get_lpo2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
bsr    %eax,%eax
xor    $0x1f,%eax
add    $0x1,%eax
movslq %eax,%rcx
mov    $0x20,%eax
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_lpo2>:
add    $0xffffffff,%edi
bsr    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_lpo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 1
%5 = call i32 @llvm.ctlz.i32(i32 %4, i1 true)
%6 = add nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = sub i64 32, %7
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_lpo2(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @llvm.ctlz.i32(i32 %2, i1 true)
%4 = xor i32 %3, 31
ret i32 %4
}
int test_imm_38int64_highword_reg(long long val) {
  return ((val >> 32) & (0x38 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_38int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x38,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_38int64_highword_reg>:
movabs $0x3800000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_38int64_highword_reg(i64 %0) {
%2 = and i64 %0, 240518168576
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned nul_word_index_loongson(unsigned r) {
  if (r & 0x01)
    return 0;
  if (r & 0x04)
    return 1;
  if (r & 0x10)
    return 2;
  return 3;
}


x86 assembly (clang, -O0):
<nul_word_index_loongson>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1122 <nul_word_index_loongson+0x22>
movl   $0x0,-0x4(%rbp)
jmp    115f <nul_word_index_loongson+0x5f>
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     113d <nul_word_index_loongson+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    115f <nul_word_index_loongson+0x5f>
mov    -0x8(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     1158 <nul_word_index_loongson+0x58>
movl   $0x2,-0x4(%rbp)
jmp    115f <nul_word_index_loongson+0x5f>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nul_word_index_loongson>:
xor    %eax,%eax
test   $0x1,%dil
jne    111f <nul_word_index_loongson+0x1f>
mov    $0x1,%eax
test   $0x4,%dil
jne    111f <nul_word_index_loongson+0x1f>
xor    %eax,%eax
test   $0x10,%dil
sete   %al
or     $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @nul_word_index_loongson(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = and i32 %0, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = and i32 %0, 16
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 3, i32 2
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
void sysfs_notify_dirent(struct sysfs_dirent *sd) {}


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

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

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

LLVM IR (-O2):
%struct.sysfs_dirent = type opaque
define void @sysfs_notify_dirent(%struct.sysfs_dirent* nocapture %0) {
ret void
}
int fib(int n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else {
    return (fib(n - 1) + fib(n - 2));
  }
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
int main() {
  fprintf(stdout, "OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"OK\0A\00"
define i32 @main() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void print_help(const char *default_host, const char *default_port) {
  printf(
      "usage:\n"
      "    blogc-runserver [-h] [-v] [-t HOST] [-p PORT] [-m THREADS] DOCROOT\n"
      "                    - A simple HTTP server to test blogc websites.\n"
      "\n"
      "positional arguments:\n"
      "    DOCROOT       document root directory\n"
      "\n"
      "optional arguments:\n"
      "    -h            show this help message and exit\n"
      "    -v            show version and exit\n"
      "    -t HOST       set server listen address (default: %s)\n"
      "    -p PORT       set server listen port (default: %s)\n"
      "    -m THREADS    set maximum number of threads to spawn (default: "
      "20)\n",
      default_host, default_port);
}


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

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

LLVM IR (-O0):
@.str = [506 x i8] c"usage:\0A blogc-runserver [-h] [-v] [-t HOST] [-p PORT] [-m THREADS] DOCROOT\0A - A simple HTTP server to test blogc websites.\0A\0Apositional arguments:\0A DOCROOT document root directory\0A\0Aoptional arguments:\0A -h show this help message and exit\0A -v show version and exit\0A -t HOST set server listen address (default: %s)\0A -p PORT set server listen port (default: %s)\0A -m THREADS set maximum number of threads to spawn (default: 20)\0A\00"
define void @print_help(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 @printf(i8* getelementptr inbounds ([506 x i8], [506 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [506 x i8] c"usage:\0A blogc-runserver [-h] [-v] [-t HOST] [-p PORT] [-m THREADS] DOCROOT\0A - A simple HTTP server to test blogc websites.\0A\0Apositional arguments:\0A DOCROOT document root directory\0A\0Aoptional arguments:\0A -h show this help message and exit\0A -v show version and exit\0A -t HOST set server listen address (default: %s)\0A -p PORT set server listen port (default: %s)\0A -m THREADS set maximum number of threads to spawn (default: 20)\0A\00"
define void @print_help(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([506 x i8], [506 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *);
void print_error_no_memory(void) {
  print_error("Out of memory");
  return;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define void @print_error_no_memory() {
%1 = call i32 @print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define void @print_error_no_memory() {
%1 = tail call i32 @print_error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
int main(int argc, char **argv) {
  if (argc || argc - 1)
    return 2;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    112b <main+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cmp    $0x0,%eax
je     1137 <main+0x37>
movl   $0x2,-0x4(%rbp)
jmp    113e <main+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x2,%eax
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 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8, %2
store i32 2, i32* %3
br label %14
13: ; preds = %8
store i32 1, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ gator_hrtimer_online(int /*<<< orphan*/);
int /*<<< orphan*/ smp_processor_id();
void gator_hrtimer_switch_cpus_online(void *unused) {
  gator_hrtimer_online(smp_processor_id());
}


x86 assembly (clang, -O0):
<gator_hrtimer_switch_cpus_online>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <smp_processor_id@plt>
mov    %eax,%edi
call   1030 <gator_hrtimer_online@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @gator_hrtimer_switch_cpus_online(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @smp_processor_id()
%3 = tail call i32 @gator_hrtimer_online(i32 %2)
ret void
}
/* Variables and functions */
int f382(int *);
int f383(int *p) { return f382(p); }


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

x86 assembly (clang, -O2):
<f383>:
jmp    1030 <f382@plt>

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

LLVM IR (-O2):
define i32 @f383(i32* %0) {
%2 = tail call i32 @f382(i32* %0)
ret i32 %2
}
/* Variables and functions */
int errno;
int *H__errno_location() { return &errno; }


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

x86 assembly (clang, -O2):
<H__errno_location>:
mov    0x2ed9(%rip),%rax
ret

LLVM IR (-O0):
@errno = global i32 0
define i32* @H__errno_location() {
ret i32* @errno
}

LLVM IR (-O2):
@errno = global i32 0
define i32* @H__errno_location() {
ret i32* @errno
}
long reverse(long num, int base) {
  long rev = 0;
  while (num > 0) {
    int digit = num % base;
    num /= base;
    rev *= base;
    rev += digit;
  }
  return rev;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    115f <reverse+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0x1c(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
movslq -0xc(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
movslq -0x1c(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <reverse+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
test   %rdi,%rdi
jle    1137 <reverse+0x37>
mov    %rdi,%rax
movslq %esi,%rdi
xor    %ecx,%ecx
jmp    1121 <reverse+0x21>
nop
cqto
idiv   %rdi
imul   %rdi,%rcx
add    %rdx,%rcx
test   %rax,%rax
jle    1133 <reverse+0x33>
mov    %rax,%rdx
or     %rdi,%rdx
shr    $0x20,%rdx
jne    1110 <reverse+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <reverse+0x15>
mov    %rcx,%rax
ret
xor    %ecx,%ecx
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @reverse(i64 %0, i32 %1) {
%3 = icmp sgt i64 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = sext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %0, %4 ], [ %10, %6 ]
%8 = phi i64 [ 0, %4 ], [ %12, %6 ]
%9 = srem i64 %7, %5
%10 = sdiv i64 %7, %5
%11 = mul nsw i64 %8, %5
%12 = add nsw i64 %9, %11
%13 = icmp sgt i64 %10, 0
br i1 %13, label %6, label %14
14: ; preds = %6, %2
%15 = phi i64 [ 0, %2 ], [ %12, %6 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void envia_mensagem(char *s, int fd) { write(fd, s, strlen(s)); }


x86 assembly (clang, -O0):
<envia_mensagem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<envia_mensagem>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @envia_mensagem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @envia_mensagem(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vga__clear();
void printk__init(void) { vga__clear(); }


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

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

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

LLVM IR (-O2):
define void @printk__init() {
%1 = tail call i32 (...) @vga__clear()
ret void
}
/* Variables and functions */
int get_maxdim(int, int const *, int);
int fftwnd_work_size(int rank, const int *n, int flags, int ncopies) {
  return (ncopies * get_maxdim(rank, n, flags) + (ncopies - 1) * 8);
}


x86 assembly (clang, -O0):
<fftwnd_work_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <get_maxdim@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x3,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fftwnd_work_size>:
push   %rbx
mov    %ecx,%ebx
call   1030 <get_maxdim@plt>
add    $0x8,%eax
imul   %ebx,%eax
add    $0xfffffff8,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fftwnd_work_size(i32 %0, i32* %1, i32 %2, i32 %3) {
%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
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = call i32 @get_maxdim(i32 %10, i32* %11, i32 %12)
%14 = mul nsw i32 %9, %13
%15 = load i32, i32* %8
%16 = sub nsw i32 %15, 1
%17 = mul nsw i32 %16, 8
%18 = add nsw i32 %14, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @fftwnd_work_size(i32 %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @get_maxdim(i32 %0, i32* %1, i32 %2)
%6 = add i32 %5, 8
%7 = mul i32 %6, %3
%8 = add i32 %7, -8
ret i32 %8
}
int add(int x) { return x + x; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(int status) {
  fprintf(stderr, "usage: sort_cmp iterations num-items\n");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: sort_cmp iterations num-items\0A\00"
define i32 @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: sort_cmp iterations num-items\0A\00"
define i32 @usage(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xef() {
  Assert_real((isspace(239) == 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_isspace.c",
              1200, ("isspace should be 0 for 0xef"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xef>:
push   %rax
mov    $0xef,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b0,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xef\00"
define void @t_isspace_0xef() {
%1 = call i64 @isspace(i32 239)
%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 1200, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xef\00"
define void @t_isspace_0xef() {
%1 = tail call i64 @isspace(i32 239)
%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 1200, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int hash_plugin_is_raw(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @hash_plugin_is_raw() {
ret i32 1
}

LLVM IR (-O2):
define i32 @hash_plugin_is_raw() {
ret i32 1
}
int xround(float v, int r) {
  if (v < 0)
    return (-xround(-v, r));
  return (((int)((v + r / 2.0) / r)) * r);
}


x86 assembly (clang, -O0):
<xround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1155 <xround+0x45>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mov    -0xc(%rbp),%edi
call   1030 <xround@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1187 <xround+0x77>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe95(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xround>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    1129 <xround+0x19>
xorps  0xef0(%rip),%xmm0
call   1030 <xround@plt>
neg    %eax
pop    %rcx
ret
xorps  %xmm1,%xmm1
cvtsi2sd %edi,%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xec4(%rip),%xmm2
mulsd  %xmm1,%xmm2
addsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
cvttsd2si %xmm2,%eax
imul   %edi,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @xround(float %0, i32 %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
%6 = load float, float* %4
%7 = fcmp olt float %6, 0.000000e+00
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load float, float* %4
%10 = fneg float %9
%11 = load i32, i32* %5
%12 = call i32 @xround(float %10, i32 %11)
%13 = sub nsw i32 0, %12
store i32 %13, i32* %3
br label %27
14: ; preds = %2
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = load i32, i32* %5
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 2.000000e+00
%20 = fadd double %16, %19
%21 = load i32, i32* %5
%22 = sitofp i32 %21 to double
%23 = fdiv double %20, %22
%24 = fptosi double %23 to i32
%25 = load i32, i32* %5
%26 = mul nsw i32 %24, %25
store i32 %26, i32* %3
br label %27
27: ; preds = %14, %8
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @xround(float %0, i32 %1) {
%3 = fcmp olt float %0, 0.000000e+00
br i1 %3, label %6, label %10
4: ; preds = %10, %6
%5 = phi i32 [ %9, %6 ], [ %17, %10 ]
ret i32 %5
6: ; preds = %2
%7 = fneg float %0
%8 = tail call i32 @xround(float %7, i32 %1)
%9 = sub nsw i32 0, %8
br label %4
10: ; preds = %2
%11 = fpext float %0 to double
%12 = sitofp i32 %1 to double
%13 = fmul double %12, 5.000000e-01
%14 = fadd double %13, %11
%15 = fdiv double %14, %12
%16 = fptosi double %15 to i32
%17 = mul nsw i32 %16, %1
br label %4
}
int test_imm_6Buint8_reg(unsigned char val) {
  return ((val) & (0x6B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Buint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x6b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Buint8_reg>:
test   $0x6b,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_6Buint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 107
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void test_func10(int n, int m) { printf("%d", n); }


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

x86 assembly (clang, -O2):
<test_func10>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @test_func10(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 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @test_func10(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void sysfs_free(char *path) {
  free(path - sizeof("/tmp/plotnetcfg-sys-XXXXXX"));
}


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

x86 assembly (clang, -O2):
<sysfs_free>:
add    $0xffffffffffffffe5,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @sysfs_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -27
ret void
}

LLVM IR (-O2):
define void @sysfs_free(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -27
tail call void @free(i8* %2)
ret void
}
/* Variables and functions */
double dsfmt_gv_genrand_open_open();
double genrand_open_open(void) { return dsfmt_gv_genrand_open_open(); }


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

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

LLVM IR (-O0):
define double @genrand_open_open() {
%1 = call double (...) @dsfmt_gv_genrand_open_open()
ret double %1
}

LLVM IR (-O2):
define double @genrand_open_open() {
%1 = tail call double (...) @dsfmt_gv_genrand_open_open()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  printf("%lf\n", f(2));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}