xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ handle_aux_carry_flag_sub(int const, int const);
int /*<<< orphan*/ handle_carry_flag_cmp(int const, int const);
int /*<<< orphan*/ handle_parity_flag(int const);
int /*<<< orphan*/ handle_sign_flag(int const);
int /*<<< orphan*/ handle_zero_flag(int const);
void handle_flags_cmp(const int final_value, const int value1,
                      const int value2) {
  handle_zero_flag(final_value);
  handle_sign_flag(final_value);
  handle_carry_flag_cmp(value1, value2);
  handle_aux_carry_flag_sub(value1, value2);
  handle_parity_flag(final_value);
}


x86 assembly (clang, -O0):
<handle_flags_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <handle_zero_flag@plt>
mov    -0x4(%rbp),%edi
call   1060 <handle_sign_flag@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <handle_carry_flag_cmp@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <handle_aux_carry_flag_sub@plt>
mov    -0x4(%rbp),%edi
call   1050 <handle_parity_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_flags_cmp>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <handle_zero_flag@plt>
mov    %ebx,%edi
call   1060 <handle_sign_flag@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1070 <handle_carry_flag_cmp@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <handle_aux_carry_flag_sub@plt>
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <handle_parity_flag@plt>

LLVM IR (-O0):
define void @handle_flags_cmp(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 = call i32 @handle_zero_flag(i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @handle_sign_flag(i32 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @handle_carry_flag_cmp(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @handle_aux_carry_flag_sub(i32 %14, i32 %15)
%17 = load i32, i32* %4
%18 = call i32 @handle_parity_flag(i32 %17)
ret void
}

LLVM IR (-O2):
define void @handle_flags_cmp(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @handle_zero_flag(i32 %0)
%5 = tail call i32 @handle_sign_flag(i32 %0)
%6 = tail call i32 @handle_carry_flag_cmp(i32 %1, i32 %2)
%7 = tail call i32 @handle_aux_carry_flag_sub(i32 %1, i32 %2)
%8 = tail call i32 @handle_parity_flag(i32 %0)
ret void
}
void nop(void) { asm("rep; nop;"); }


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

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

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

LLVM IR (-O2):
define void @nop() {
tail call void asm sideeffect "rep; nop;", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Sleep(int);
void sleep_forever(void) {
  for (;;)
    Sleep(1);
}


x86 assembly (clang, -O0):
<sleep_forever>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <sleep_forever+0x9>
mov    $0x1,%edi
call   1030 <Sleep@plt>
jmp    1119 <sleep_forever+0x9>

x86 assembly (clang, -O2):
<sleep_forever>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <Sleep@plt>
jmp    1120 <sleep_forever+0x10>

LLVM IR (-O0):
define void @sleep_forever() {
br label %1
1: ; preds = %1, %0
%2 = call i32 @Sleep(i32 1)
br label %1
}

LLVM IR (-O2):
define void @sleep_forever() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @Sleep(i32 1)
br label %1
}
int cmp(const void *x, const void *y) { return *(char *)x - *(char *)y; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp(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* %5
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
double get_d();
int /*<<< orphan*/ put_d(double);
int /*<<< orphan*/ put_s(char *);
void main() {
  double r, pi;
  pi = 3.14;
  put_s("r=");
  r = get_d();
  put_s("perimetrul=");
  put_d(2e0 * pi * r);
  put_s("aria=");
  put_d(pi * r * r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  0xec8(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    0xec4(%rip),%rdi
call   1050 <put_s@plt>
mov    $0x0,%al
call   1040 <get_d@plt>
movsd  %xmm0,-0x8(%rbp)
lea    0xeaf(%rip),%rdi
call   1050 <put_s@plt>
movsd  0xe8f(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <put_d@plt>
lea    0xe98(%rip),%rdi
call   1050 <put_s@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <put_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1050 <put_s@plt>
xor    %eax,%eax
call   1040 <get_d@plt>
movsd  %xmm0,(%rsp)
lea    0xec3(%rip),%rdi
call   1050 <put_s@plt>
movsd  0xea3(%rip),%xmm0
mulsd  (%rsp),%xmm0
call   1030 <put_d@plt>
lea    0xeb1(%rip),%rdi
call   1050 <put_s@plt>
movsd  0xe8d(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
jmp    1030 <put_d@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"r=\00"
@.str.1 = [12 x i8] c"perimetrul=\00"
@.str.2 = [6 x i8] c"aria=\00"
define void @main() {
%1 = alloca double
%2 = alloca double
store double 3.140000e+00, double* %2
%3 = call i32 @put_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call double (...) @get_d()
store double %4, double* %1
%5 = call i32 @put_s(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = load double, double* %2
%7 = fmul double 2.000000e+00, %6
%8 = load double, double* %1
%9 = fmul double %7, %8
%10 = call i32 @put_d(double %9)
%11 = call i32 @put_s(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%12 = load double, double* %2
%13 = load double, double* %1
%14 = fmul double %12, %13
%15 = load double, double* %1
%16 = fmul double %14, %15
%17 = call i32 @put_d(double %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"r=\00"
@.str.1 = [12 x i8] c"perimetrul=\00"
@.str.2 = [6 x i8] c"aria=\00"
define void @main() {
%1 = tail call i32 @put_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call double (...) @get_d()
%3 = tail call i32 @put_s(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = fmul double %2, 6.280000e+00
%5 = tail call i32 @put_d(double %4)
%6 = tail call i32 @put_s(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%7 = fmul double %2, 3.140000e+00
%8 = fmul double %2, %7
%9 = tail call i32 @put_d(double %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int saturating_add(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int x, y;
  scanf("%x %x", &x, &y);
  printf("%x\n", saturating_add(x, y));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%x %x\00"
@.str.1 = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @saturating_add(i32 %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int func1b() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @func1b() {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ *display;
};
typedef TYPE_1__ XEnterWindowEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
void set_XEnterWindowEvent_display(void *_p, void *_v) {
  ((XEnterWindowEvent *)_p)->display = (Display *)_v;
}


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

x86 assembly (clang, -O2):
<set_XEnterWindowEvent_display>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XEnterWindowEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
long double fmod(long double, long double);
long double fmodl(long double a1, long double a2) { return fmod(a1, a2); }


x86 assembly (clang, -O0):
<fmodl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <fmod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodl>:
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @fmod(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @fmod(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int /*<<< orphan*/);
void set_default_env(void) {
  setenv("IP2CC_TXTDB",
         "."
         "/"
         "ip2cc.txt",
         0);
  setenv("IP2CC_BINDB",
         "."
         "/"
         "ip2cc.bin",
         0);
}


x86 assembly (clang, -O0):
<set_default_env>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeea(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
lea    0xee8(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_default_env>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %edx,%edx
call   1030 <setenv@plt>
lea    0xeeb(%rip),%rdi
lea    0xef0(%rip),%rsi
xor    %edx,%edx
pop    %rax
jmp    1030 <setenv@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"IP2CC_TXTDB\00"
@.str.1 = [12 x i8] c"./ip2cc.txt\00"
@.str.2 = [12 x i8] c"IP2CC_BINDB\00"
@.str.3 = [12 x i8] c"./ip2cc.bin\00"
define void @set_default_env() {
%1 = call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"IP2CC_TXTDB\00"
@.str.1 = [12 x i8] c"./ip2cc.txt\00"
@.str.2 = [12 x i8] c"IP2CC_BINDB\00"
@.str.3 = [12 x i8] c"./ip2cc.bin\00"
define void @set_default_env() {
%1 = tail call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 0)
%2 = tail call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_97() {
  Assert_real((isqrt(97) == 9),
              "/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",
              490, ("Integer square root of 97 should be 9"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_97>:
push   %rax
mov    $0x61,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1ea,%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 = [38 x i8] c"Integer square root of 97 should be 9\00"
define void @t_sqrt_97() {
%1 = call i32 @isqrt(i32 97)
%2 = icmp eq i32 %1, 9
%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 490, i8* getelementptr inbounds ([38 x i8], [38 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 = [38 x i8] c"Integer square root of 97 should be 9\00"
define void @t_sqrt_97() {
%1 = tail call i32 @isqrt(i32 97)
%2 = icmp eq i32 %1, 9
%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 490, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *fptr_capi20ext_get_tty_devname(unsigned int, unsigned int, char *,
                                     size_t);
scalar_t__ loadlib();
char *capi20ext_get_tty_devname(unsigned applid, unsigned ncci, char *buf,
                                size_t size) {
  if (loadlib() < 0)
    return 0;
  return fptr_capi20ext_get_tty_devname(applid, ncci, buf, size);
}


x86 assembly (clang, -O0):
<capi20ext_get_tty_devname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <loadlib@plt>
cmp    $0x0,%rax
jge    1154 <capi20ext_get_tty_devname+0x34>
movq   $0x0,-0x8(%rbp)
jmp    116b <capi20ext_get_tty_devname+0x4b>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <fptr_capi20ext_get_tty_devname@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20ext_get_tty_devname>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <loadlib@plt>
test   %rax,%rax
js     1156 <capi20ext_get_tty_devname+0x36>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fptr_capi20ext_get_tty_devname@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @capi20ext_get_tty_devname(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 %0, i32* %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i64 %3, i64* %9
%10 = call i64 (...) @loadlib()
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %4
store i8* null, i8** %5
br label %19
13: ; preds = %4
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = load i64, i64* %9
%18 = call i8* @fptr_capi20ext_get_tty_devname(i32 %14, i32 %15, i8* %16, i64 %17)
store i8* %18, i8** %5
br label %19
19: ; preds = %13, %12
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
define i8* @capi20ext_get_tty_devname(i32 %0, i32 %1, i8* %2, i64 %3) {
%5 = tail call i64 (...) @loadlib()
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i8* @fptr_capi20ext_get_tty_devname(i32 %0, i32 %1, i8* %2, i64 %3)
br label %9
9: ; preds = %4, %7
%10 = phi i8* [ %8, %7 ], [ null, %4 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TIM5_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TIM5_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TIM5_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_ror_epi32(int /*<<< orphan*/, int);
__attribute__((always_)) __m128i rot8_128(__m128i x) {
  return _mm_ror_epi32(x, 8);
}


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

x86 assembly (clang, -O2):
<rot8_128>:
mov    $0x8,%esi
jmp    1030 <_mm_ror_epi32@plt>

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

LLVM IR (-O2):
define i32 @rot8_128(i32 %0) {
%2 = tail call i32 @_mm_ror_epi32(i32 %0, i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_position_to_pretty_string() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_position_to_pretty_string"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"NOT IMPLEMENTED:pa_channel_position_to_pretty_string\0A\00"
define i32 @pa_channel_position_to_pretty_string() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [53 x i8] c"NOT IMPLEMENTED:pa_channel_position_to_pretty_string\00"
define i32 @pa_channel_position_to_pretty_string() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
scalar_t__ canonical_reorder(char *, char *);
void canonical_order(char *begin, size_t n) {
  char *end = begin + n;
  while (canonical_reorder(begin, end))
    ;
}


x86 assembly (clang, -O0):
<canonical_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <canonical_reorder@plt>
cmp    $0x0,%rax
je     1148 <canonical_order+0x38>
jmp    112c <canonical_order+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonical_order>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    %rdi,%rbx
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <canonical_reorder@plt>
test   %rax,%rax
jne    1120 <canonical_order+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @canonical_order(i8* %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 %1
br label %4
4: ; preds = %4, %2
%5 = tail call i64 @canonical_reorder(i8* %0, i8* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %4
7: ; preds = %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtree_procfs_close();
void dtree_close(void) { dtree_procfs_close(); }


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

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

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

LLVM IR (-O2):
define void @dtree_close() {
%1 = tail call i32 (...) @dtree_procfs_close()
ret void
}
/* Variables and functions */
int strcmp(char const *const, char const *const);
int string_cmp(const void *va, const void *vb) {
  const char *const *pa = va;
  const char *const *pb = vb;
  return strcmp(*pa, *pb);
}


x86 assembly (clang, -O0):
<string_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_cmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @string_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
void board_gpio_deinit(const struct ts_platform_data *pdata) {}


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

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

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

LLVM IR (-O2):
%struct.ts_platform_data = type opaque
define void @board_gpio_deinit(%struct.ts_platform_data* nocapture %0) {
ret void
}
void mn_sys_ignore_pipe(void) {}


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

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

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

LLVM IR (-O2):
define void @mn_sys_ignore_pipe() {
ret void
}
int test_imm_A9int16_reg(short val) {
  return ((val) & (0xA9 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A9int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xa9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_A9int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 169
%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_A9int16_reg(i16 signext %0) {
%2 = and i16 %0, 169
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int ffs(int v) {
  int ret;
  unsigned x = v;
  if (!x)
    return 0;
  for (ret = 1; !(x & 1); ++ret)
    x >>= 1;
  return ret;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1123 <ffs+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1162 <ffs+0x62>
movl   $0x1,-0xc(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1145 <ffs+0x45>
jmp    115c <ffs+0x5c>
mov    -0x10(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <ffs+0x2a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ %0, %3 ]
%8 = phi i32 [ %10, %6 ], [ 1, %3 ]
%9 = lshr i32 %7, 1
%10 = add nuw nsw i32 %8, 1
%11 = and i32 %7, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ insert_str(char *, char *, char *);
void known2(char *object_str) { insert_str(object_str, "^", ""); }


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

x86 assembly (clang, -O2):
<known2>:
lea    0xee9(%rip),%rsi
lea    0xee3(%rip),%rdx
jmp    1030 <insert_str@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"^\00"
@.str.1 = [1 x i8] zeroinitializer
define void @known2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @insert_str(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"^\00"
@.str.1 = [1 x i8] zeroinitializer
define void @known2(i8* %0) {
%2 = tail call i32 @insert_str(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_something_during_a_test() { printf("\tI am a test\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"\09I am a test\0A\00"
define void @print_something_during_a_test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"\09I am a test\00"
define void @print_something_during_a_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
double Neumann_k(double x, double y) { return 2.0; }


x86 assembly (clang, -O0):
<Neumann_k>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xeea(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Neumann_k>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @Neumann_k(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
ret double 2.000000e+00
}

LLVM IR (-O2):
define double @Neumann_k(double %0, double %1) {
ret double 2.000000e+00
}
int main(int argc, char *argv[]) {
  int x;
  if (argc == 0)
    x = argc + 4;
  else
    x = argc + 10;
  return x;
}


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    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xa(%rdi),%ecx
test   %edi,%edi
mov    $0x4,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 0
%4 = add nsw i32 %0, 10
%5 = select i1 %3, i32 4, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *return_str();
void do_asm(void) {
  char *asmcode = return_str();
  printf("\t%s\n", asmcode);
}


x86 assembly (clang, -O0):
<do_asm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <return_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_asm>:
push   %rax
xor    %eax,%eax
call   1040 <return_str@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\09%s\0A\00"
define void @do_asm() {
%1 = tail call i8* (...) @return_str()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void b(void) { printf("b"); }


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

x86 assembly (clang, -O2):
<b>:
mov    $0x62,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 @putchar(i32 98)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core10_swap(char *, int);
void U_EMRPOLYPOLYGON16_swap(char *record, int torev) {
  core10_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYPOLYGON16_swap>:
jmp    1030 <core10_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRPOLYPOLYGON16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core10_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void fsl_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<fsl_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @fsl_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int /*<<< orphan*/);
void t_ispunct_0x00() {
  Assert_real((ispunct(0) == 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_ispunct.c",
              5, ("ispunct should be 0 for 0x00"));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec2(%rip),%rsi
mov    $0x5,%edx
lea    0xf5e(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
xor    %edi,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec8(%rip),%rsi
lea    0xf69(%rip),%rcx
mov    $0x5,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x00\00"
define void @t_ispunct_0x00() {
%1 = call i64 @ispunct(i32 0)
%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 5, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x00\00"
define void @t_ispunct_0x00() {
%1 = tail call i64 @ispunct(i32 0)
%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 5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct drm_device {
  int dummy;
};

/* Variables and functions */
int r128_driver_irq_postinstall(struct drm_device *dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.drm_device = type { i32 }
define i32 @r128_driver_irq_postinstall(%struct.drm_device* %0) {
%2 = alloca %struct.drm_device*
store %struct.drm_device* %0, %struct.drm_device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
define i32 @r128_driver_irq_postinstall(%struct.drm_device* nocapture readnone %0) {
ret i32 0
}
int nn_xrespondent_ispeer(int socktype) {
  return socktype == (6 * 16 + 2) ? 1 : 0;
}


x86 assembly (clang, -O0):
<nn_xrespondent_ispeer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x62,%edx
cmove  %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nn_xrespondent_ispeer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 98
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @nn_xrespondent_ispeer(i32 %0) {
%2 = icmp eq i32 %0, 98
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned int);
void KeccakF200_StateExtractBytes(const void *state, unsigned char *data,
                                  unsigned int offset, unsigned int length) {
  memcpy(data, (unsigned char *)state + offset, length);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%eax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %rsi,%rax
mov    %edx,%esi
add    %rdi,%rsi
mov    %rax,%rdi
mov    %ecx,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @KeccakF200_StateExtractBytes(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = tail call i32 @memcpy(i8* %1, i8* %6, i32 %3)
ret void
}
/* Variables and functions */
char *Xkb_Switch_getXkbLayout(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
int main() {
  while (1) {
    printf("Result: %s\n", Xkb_Switch_getXkbLayout(""));
    sleep(1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <Xkb_Switch_getXkbLayout@plt>
mov    %rax,%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed0(%rip),%r14
lea    0xebe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <Xkb_Switch_getXkbLayout@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [12 x i8] c"Result: %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i8* @Xkb_Switch_getXkbLayout(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @sleep(i32 1)
br label %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"Result: %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i8* @Xkb_Switch_getXkbLayout(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @sleep(i32 1)
br label %1
}
int ext0level2pct(unsigned int level) { return 100 * (int)level / 25; }


x86 assembly (clang, -O0):
<ext0level2pct>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x64,-0x4(%rbp),%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext0level2pct>:
lea    0x0(,%rdi,4),%eax
ret

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

LLVM IR (-O2):
define i32 @ext0level2pct(i32 %0) {
%2 = shl nsw i32 %0, 2
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int int32_t;

/* Variables and functions */
bool isLFilled16_2(uint16_t i0) {
  int32_t i = (int32_t)i0;
  int32_t j = 2;
  for (; j < ((int32_t) ~(uint16_t)0) + 1; j <<= 1)
    if (i == j - 1)
      return true;
  return false;
}


x86 assembly (clang, -O0):
<isLFilled16_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1150 <isLFilled16_2+0x50>
mov    -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    113d <isLFilled16_2+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1157 <isLFilled16_2+0x57>
jmp    1142 <isLFilled16_2+0x42>
mov    -0x18(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <isLFilled16_2+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isLFilled16_2(i64 %0) {
ret i32 0
}
unsigned int absdiff(unsigned int a, unsigned int b) {
  return a < b ? (b - a) : (a - b);
}


x86 assembly (clang, -O0):
<absdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    1124 <absdiff+0x24>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <absdiff+0x2d>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absdiff>:
mov    %edi,%eax
sub    %esi,%eax
neg    %eax
sub    %esi,%edi
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absdiff(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = sub i32 %1, %0
%5 = sub i32 %0, %1
%6 = select i1 %3, i32 %4, i32 %5
ret i32 %6
}
unsigned char encode_char(unsigned char c) {
  static unsigned char base32[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
  return base32[c & 0x1F];
}


x86 assembly (clang, -O0):
<encode_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0x2f15(%rip),%rax
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_char>:
and    $0x1f,%edi
lea    0xef6(%rip),%rax
mov    (%rdi,%rax,1),%al
ret

LLVM IR (-O0):
@encode_char.base32 = internal global [33 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\00"
define zeroext i8 @encode_char(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, 31
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [33 x i8], [33 x i8]* @encode_char.base32, i64 0, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@encode_char.base32 = internal unnamed_addr constant [33 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567\00"
define zeroext i8 @encode_char(i8 zeroext %0) {
%2 = and i8 %0, 31
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [33 x i8], [33 x i8]* @encode_char.base32, i64 0, i64 %3
%5 = load i8, i8* %4
ret i8 %5
}