xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isnan(double);
unsigned int fpu_fcom_c0(double a, double b) {
  if (isnan(a) || isnan(b))
    return 1;
  if (a >= b)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<fpu_fcom_c0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
jne    114a <fpu_fcom_c0+0x3a>
movsd  -0x18(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     1156 <fpu_fcom_c0+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1179 <fpu_fcom_c0+0x69>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1172 <fpu_fcom_c0+0x62>
movl   $0x0,-0x4(%rbp)
jmp    1179 <fpu_fcom_c0+0x69>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpu_fcom_c0>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <isnan@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    114e <fpu_fcom_c0+0x3e>
movsd  (%rsp),%xmm0
call   1030 <isnan@plt>
test   %rax,%rax
jne    114e <fpu_fcom_c0+0x3e>
xor    %ebx,%ebx
movsd  0x8(%rsp),%xmm0
ucomisd (%rsp),%xmm0
setb   %bl
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @fpu_fcom_c0(double %0, double %1) {
%3 = tail call i64 @isnan(double %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = tail call i64 @isnan(double %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = fcmp ult double %0, %1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %8, %2, %5
%12 = phi i32 [ 1, %5 ], [ 1, %2 ], [ %10, %8 ]
ret i32 %12
}
int test_imm_AFint32_mem(int *val) {
  return ((*val) & (0xAF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AFint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 175
%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_AFint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 175
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
scalar_t__ strstr(char const *, char const *);
wchar_t *wcswcs(const wchar_t *ws1, const wchar_t *ws2) {
  return (wchar_t *)strstr((const char *)ws1, (const char *)ws2);
}


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

x86 assembly (clang, -O2):
<wcswcs>:
jmp    1030 <strstr@plt>

LLVM IR (-O0):
define i32* @wcswcs(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 = bitcast i32* %5 to i8*
%7 = load i32*, i32** %4
%8 = bitcast i32* %7 to i8*
%9 = call i64 @strstr(i8* %6, i8* %8)
%10 = inttoptr i64 %9 to i32*
ret i32* %10
}

LLVM IR (-O2):
define i32* @wcswcs(i32* %0, i32* %1) {
%3 = bitcast i32* %0 to i8*
%4 = bitcast i32* %1 to i8*
%5 = tail call i64 @strstr(i8* %3, i8* %4)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
void __attribute__((weak)) usb_fs_wkup_isr() { debug_handler(__FUNCTION__); }


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

x86 assembly (clang, -O2):
<usb_fs_wkup_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.usb_fs_wkup_isr = [16 x i8] c"usb_fs_wkup_isr\00"
define weak void @usb_fs_wkup_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.usb_fs_wkup_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.usb_fs_wkup_isr = [16 x i8] c"usb_fs_wkup_isr\00"
define weak void @usb_fs_wkup_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__FUNCTION__.usb_fs_wkup_isr, i64 0, i64 0))
ret void
}
void adjustOpenFilesLimit(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               31, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<adjustOpenFilesLimit>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1f,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustOpenFilesLimit>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x1f,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.adjustOpenFilesLimit = [21 x i8] c"adjustOpenFilesLimit\00"
define void @adjustOpenFilesLimit() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 31, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.adjustOpenFilesLimit, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.adjustOpenFilesLimit = [21 x i8] c"adjustOpenFilesLimit\00"
define void @adjustOpenFilesLimit() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 31, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @__func__.adjustOpenFilesLimit, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old. \n", age);
  printf("I am %d inches tall. \n", height);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x48,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x48,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"I am %d years old. \0A\00"
@.str.1 = [23 x i8] c"I am %d inches tall. \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
store i32 72, i32* %3
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"I am %d years old. \0A\00"
@.str.1 = [23 x i8] c"I am %d inches tall. \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 72)
ret i32 0
}
/* Variables and functions */
double log(double);
int /*<<< orphan*/ printf(char *, double, double);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double a = 0, b = 1.25506;
  scanf("%lf", &a);
  a = a / (log(a));
  printf("%.1lf %.1lf\n", a, a * b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xead(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x8(%rsp)
lea    0xec4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
call   1050 <log@plt>
movsd  0x10(%rsp),%xmm2
divsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xe89(%rip),%xmm1
mulsd  %xmm2,%xmm1
movapd %xmm2,%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [13 x i8] c"%.1lf %.1lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 1.255060e+00, double* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call double @log(double %6)
%8 = fdiv double %5, %7
store double %8, double* %2
%9 = load double, double* %2
%10 = load double, double* %2
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %9, double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [13 x i8] c"%.1lf %.1lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = call double @log(double %4)
%6 = fdiv double %4, %5
store double %6, double* %1
%7 = fmul double %6, 1.255060e+00
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %6, double %7)
ret i32 0
}
/* Variables and functions */
int _dowrite(unsigned int, unsigned char, unsigned char, unsigned char *, int);
int do_smbus_write_word(unsigned smbus_io_base, unsigned char device,
                        unsigned char address, unsigned short data) {
  return _dowrite(smbus_io_base, device, address, (unsigned char *)&data, 2);
}


x86 assembly (clang, -O0):
<do_smbus_write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dl,%cl
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x5(%rbp),%dl
mov    -0x6(%rbp),%al
lea    -0x8(%rbp),%rcx
mov    $0x2,%r8d
movzbl %dl,%esi
movzbl %al,%edx
call   1030 <_dowrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_smbus_write_word>:
push   %rax
mov    %cx,0x6(%rsp)
lea    0x6(%rsp),%rcx
mov    $0x2,%r8d
call   1030 <_dowrite@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @do_smbus_write_word(i32 %0, i8 zeroext %1, i8 zeroext %2, i16 zeroext %3) {
%5 = alloca i16
store i16 %3, i16* %5
%6 = bitcast i16* %5 to i8*
%7 = call i32 @_dowrite(i32 %0, i8 zeroext %1, i8 zeroext %2, i8* %6, i32 2)
ret i32 %7
}
int asus_bat_report_phone_present(int phone_bat_present) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @asus_bat_report_phone_present(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_SETFL;
long O_NONBLOCK;
long O_RDONLY;
int /*<<< orphan*/ fcntl(int, int /*<<< orphan*/, long);
void set_non_blocking(int fd) {
  long arg;
  arg = O_RDONLY | O_NONBLOCK;
  fcntl(fd, F_SETFL, arg);
}


x86 assembly (clang, -O0):
<set_non_blocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%rax
mov    0x2ebc(%rip),%rcx
or     (%rcx),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_non_blocking>:
mov    0x2ec9(%rip),%rax
mov    0x2eca(%rip),%rcx
mov    (%rcx),%rdx
or     (%rax),%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@O_RDONLY = global i64 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define void @set_non_blocking(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i64, i64* @O_RDONLY
%5 = load i64, i64* @O_NONBLOCK
%6 = or i64 %4, %5
store i64 %6, i64* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i64, i64* %3
%10 = call i32 @fcntl(i32 %7, i32 %8, i64 %9)
ret void
}

LLVM IR (-O2):
@O_RDONLY = global i64 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define void @set_non_blocking(i32 %0) {
%2 = load i64, i64* @O_RDONLY
%3 = load i64, i64* @O_NONBLOCK
%4 = or i64 %3, %2
%5 = load i32, i32* @F_SETFL
%6 = tail call i32 @fcntl(i32 %0, i32 %5, i64 %4)
ret void
}
int mstring_split_len(char *in, char splt) {
  int occ_num = 0;
  int curr;
  for (; in[curr]; curr++) {
    if (in[curr] == splt) {
      occ_num++;
    }
  }
  return occ_num;
}


x86 assembly (clang, -O0):
<mstring_split_len>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115b <mstring_split_len+0x5b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <mstring_split_len+0x48>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <mstring_split_len+0x4d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1115 <mstring_split_len+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstring_split_len>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <mstring_split_len+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <mstring_split_len+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @mstring_split_len(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
store i32 0, i32* %5
br label %7
7: ; preds = %28, %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %31
14: ; preds = %7
%15 = load i8*, i8** %3
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %20, %22
br i1 %23, label %24, label %27
24: ; preds = %14
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %27
27: ; preds = %24, %14
br label %28
28: ; preds = %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %7
31: ; preds = %7
%32 = load i32, i32* %5
ret i32 %32
}

LLVM IR (-O2):
define i32 @mstring_split_len(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ 0, %2 ]
%9 = icmp eq i8 %7, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %8, %10
%12 = add i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %17
}
int fun456() { return 456; }


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

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

LLVM IR (-O0):
define i32 @fun456() {
ret i32 456
}

LLVM IR (-O2):
define i32 @fun456() {
ret i32 456
}
void ceilr() {}


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

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

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

LLVM IR (-O2):
define void @ceilr() {
ret void
}
/* Variables and functions */
int FE_TONEAREST;
int fesetround(int round) { return (round != FE_TONEAREST); }


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
setne  %al
ret

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @FE_TONEAREST
%5 = icmp ne i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = load i32, i32* @FE_TONEAREST
%3 = icmp ne i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
long long foo(long long v) { return v / -0x080000000LL; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xffffffff80000000,%rcx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x7fffffff(%rdi),%rax
test   %rdi,%rdi
cmovns %rdi,%rax
sar    $0x1f,%rax
neg    %rax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sdiv i64 %3, -2147483648
ret i64 %4
}

LLVM IR (-O2):
define i64 @foo(i64 %0) {
%2 = sdiv i64 %0, -2147483648
ret i64 %2
}
void pl_get_error_(char *buf) {}


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

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

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

LLVM IR (-O2):
define void @pl_get_error_(i8* nocapture %0) {
ret void
}
void backend_thread_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @backend_thread_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_redirect(int, char *, char const *);
void display_message(const char *msg) { log_redirect((1 << 3), "%s", msg); }


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

x86 assembly (clang, -O2):
<display_message>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x8,%edi
jmp    1030 <log_redirect@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @display_message(i8* %0) {
%2 = tail call i32 @log_redirect(i32 8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCT2_CALLPROC_EBPSAFE(int);
void editor_convert_save_to_scenario() { RCT2_CALLPROC_EBPSAFE(0x00672781); }


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

x86 assembly (clang, -O2):
<editor_convert_save_to_scenario>:
mov    $0x672781,%edi
jmp    1030 <RCT2_CALLPROC_EBPSAFE@plt>

LLVM IR (-O0):
define void @editor_convert_save_to_scenario() {
%1 = call i32 @RCT2_CALLPROC_EBPSAFE(i32 6760321)
ret void
}

LLVM IR (-O2):
define void @editor_convert_save_to_scenario() {
%1 = tail call i32 @RCT2_CALLPROC_EBPSAFE(i32 6760321)
ret void
}
/* Variables and functions */
double pow(double, unsigned int);
double sqrt(double);
double fibonacci(unsigned n) {
  double w5 = sqrt(5.0);
  double l1 = 0.5 * (1 + w5);
  double l2 = 0.5 * (1 - w5);
  return (pow(l1, n) - pow(l2, n)) / w5;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  0xedd(%rip),%xmm0
call   1040 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xec3(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xeae(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea5(%rip),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xe90(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x4(%rbp),%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x4(%rbp),%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
divsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  0xee1(%rip),%xmm0
call   1030 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xed6(%rip),%xmm0
mov    %ebx,%edi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
divsd  0xec5(%rip),%xmm1
movapd %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @fibonacci(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 %0, i32* %2
%6 = call double @sqrt(double 5.000000e+00)
store double %6, double* %3
%7 = load double, double* %3
%8 = fadd double 1.000000e+00, %7
%9 = fmul double 5.000000e-01, %8
store double %9, double* %4
%10 = load double, double* %3
%11 = fsub double 1.000000e+00, %10
%12 = fmul double 5.000000e-01, %11
store double %12, double* %5
%13 = load double, double* %4
%14 = load i32, i32* %2
%15 = call double @pow(double %13, i32 %14)
%16 = load double, double* %5
%17 = load i32, i32* %2
%18 = call double @pow(double %16, i32 %17)
%19 = fsub double %15, %18
%20 = load double, double* %3
%21 = fdiv double %19, %20
ret double %21
}

LLVM IR (-O2):
define double @fibonacci(i32 %0) {
%2 = tail call double @pow(double 0x3FF9E3779B97F4A8, i32 %0)
%3 = tail call double @pow(double 0xBFE3C6EF372FE950, i32 %0)
%4 = fsub double %2, %3
%5 = fdiv double %4, 0x4001E3779B97F4A8
ret double %5
}
void push_item(struct item **head_ref, int new_value) { ; }


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

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

LLVM IR (-O0):
%struct.item = type opaque
define void @push_item(%struct.item** %0, i32 %1) {
%3 = alloca %struct.item**
%4 = alloca i32
store %struct.item** %0, %struct.item*** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.item = type opaque
define void @push_item(%struct.item** nocapture %0, i32 %1) {
ret void
}
char setBit_fun_char(char x, unsigned i) { return x | 1 << i; }


x86 assembly (clang, -O0):
<setBit_fun_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @setBit_fun_char(i8 signext %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 = sext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @setBit_fun_char(i8 signext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i8
%5 = or i8 %4, %0
ret i8 %5
}
int iscntrl(int c) {
  if (c >= 0 && c <= 31)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1127 <iscntrl+0x27>
cmpl   $0x1f,-0x8(%rbp)
jg     1127 <iscntrl+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <iscntrl+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
xor    %eax,%eax
cmp    $0x20,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 31
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int cubeByValue(int);
int /*<<< orphan*/ printf(char *, int);
void fig07_06() {
  int number = 5;
  printf("The original value of number is %d", number);
  number = cubeByValue(number);
  printf("\nThe new value of number is %d\n", number);
}


x86 assembly (clang, -O0):
<fig07_06>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <cubeByValue@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fig07_06>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <cubeByValue@plt>
lea    0xee0(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"The original value of number is %d\00"
@.str.1 = [32 x i8] c"\0AThe new value of number is %d\0A\00"
define void @fig07_06() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* %1
%5 = call i32 @cubeByValue(i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"The original value of number is %d\00"
@.str.1 = [32 x i8] c"\0AThe new value of number is %d\0A\00"
define void @fig07_06() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @cubeByValue(i32 5)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_stdout_buf_size();
int main(int argc, char *argv[]) {
  test_stdout_buf_size();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_stdout_buf_size()
ret i32 0
}
int XmbTextEscapement() {}


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

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

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

LLVM IR (-O2):
define i32 @XmbTextEscapement() {
ret i32 undef
}
int main() {
  int a = a;
  int b = b + b;
  char c = c++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x9(%rbp),%al
mov    %al,%cl
add    $0x1,%cl
mov    %cl,-0x9(%rbp)
mov    %al,-0x9(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
unsigned minsz(unsigned nelem) { return 1U + nelem + nelem / 8U; }


x86 assembly (clang, -O0):
<minsz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    -0x4(%rbp),%ecx
shr    $0x3,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minsz>:
mov    %edi,%eax
shr    $0x3,%eax
add    %edi,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @minsz(i32 %0) {
%2 = add i32 %0, 1
%3 = lshr i32 %0, 3
%4 = add i32 %2, %3
ret i32 %4
}
/* Variables and functions */
__attribute__((weak)) void rgblight_step(void) {}


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

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

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

LLVM IR (-O2):
define weak void @rgblight_step() {
ret void
}
void noise_note_free(void *data) {}


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

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

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

LLVM IR (-O2):
define void @noise_note_free(i8* nocapture %0) {
ret void
}
int subr(int parm) {
  int keeping, busy;
  keeping = parm + parm;
  busy = keeping * keeping;
  return busy;
}


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

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

LLVM IR (-O0):
define i32 @subr(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = add nsw i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
ret i32 %11
}

LLVM IR (-O2):
define i32 @subr(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = mul nsw i32 %2, %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct SHA1_CTX {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sha1_writebyte(struct SHA1_CTX *, int /*<<< orphan*/);
void SHA1_Update(struct SHA1_CTX *s, const void *data, size_t len) {
  const uint8_t *bytes = data;
  for (; len--;)
    sha1_writebyte(s, *bytes++);
}


x86 assembly (clang, -O0):
<SHA1_Update>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
je     1164 <SHA1_Update+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%esi
call   1030 <sha1_writebyte@plt>
jmp    112c <SHA1_Update+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHA1_Update>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1145 <SHA1_Update+0x35>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <sha1_writebyte@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <SHA1_Update+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.SHA1_CTX = type { i32 }
define void @SHA1_Update(%struct.SHA1_CTX* %0, i8* %1, i64 %2) {
%4 = alloca %struct.SHA1_CTX*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store %struct.SHA1_CTX* %0, %struct.SHA1_CTX** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
br label %10
10: ; preds = %14, %3
%11 = load i64, i64* %6
%12 = add i64 %11, -1
store i64 %12, i64* %6
%13 = icmp ne i64 %11, 0
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = load %struct.SHA1_CTX*, %struct.SHA1_CTX** %4
%16 = load i32*, i32** %7
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %7
%18 = load i32, i32* %16
%19 = call i32 @sha1_writebyte(%struct.SHA1_CTX* %15, i32 %18)
br label %10
20: ; preds = %10
ret void
}

LLVM IR (-O2):
%struct.SHA1_CTX = type { i32 }
define void @SHA1_Update(%struct.SHA1_CTX* %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i32*
br label %7
7: ; preds = %5, %7
%8 = phi i32* [ %11, %7 ], [ %6, %5 ]
%9 = phi i64 [ %10, %7 ], [ %2, %5 ]
%10 = add i64 %9, -1
%11 = getelementptr inbounds i32, i32* %8, i64 1
%12 = load i32, i32* %8
%13 = tail call i32 @sha1_writebyte(%struct.SHA1_CTX* %0, i32 %12)
%14 = icmp eq i64 %10, 0
br i1 %14, label %15, label %7
15: ; preds = %7, %3
ret void
}
int GRCTER(fd, w_fd)
int *fd;
int w_fd;
{ close(*fd); }


x86 assembly (clang, -O0):
<GRCTER>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GRCTER>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <close@plt>

LLVM IR (-O0):
define i32 @GRCTER(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @GRCTER(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ retesave_one_byte(char);
void retesave_string(char *s) {
  while (*s) {
    retesave_one_byte(*s);
    s++;
  }
  retesave_one_byte(0);
}


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

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

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

LLVM IR (-O2):
define void @retesave_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @retesave_one_byte(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @retesave_one_byte(i8 signext 0)
ret void
}
int main(argc, argv)
int argc;
char **argv;
{
  test2(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @test2 to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cgmul();
int /*<<< orphan*/ cgpop2();
int /*<<< orphan*/ gentext();
void genmul(void) {
  gentext();
  cgpop2();
  cgmul();
}


x86 assembly (clang, -O0):
<genmul>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gentext@plt>
mov    $0x0,%al
call   1030 <cgpop2@plt>
mov    $0x0,%al
call   1050 <cgmul@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genmul>:
push   %rax
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
call   1030 <cgpop2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cgmul@plt>

LLVM IR (-O0):
define void @genmul() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgpop2()
%3 = call i32 (...) @cgmul()
ret void
}

LLVM IR (-O2):
define void @genmul() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgpop2()
%3 = tail call i32 (...) @cgmul()
ret void
}
unsigned int calc_failsleep(unsigned int oldvalue) {
  unsigned int newvalue;
  if (!oldvalue)
    newvalue = 60;
  else
    newvalue = oldvalue * 2;
  if (newvalue < oldvalue)
    return (oldvalue);
  return (newvalue);
}


x86 assembly (clang, -O0):
<calc_failsleep>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <calc_failsleep+0x1d>
movl   $0x3c,-0xc(%rbp)
jmp    1126 <calc_failsleep+0x26>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    113d <calc_failsleep+0x3d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1143 <calc_failsleep+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_failsleep>:
lea    (%rdi,%rdi,1),%ecx
test   %edi,%edi
mov    $0x3c,%eax
cmovne %ecx,%eax
cmp    %edi,%eax
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_failsleep(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = shl i32 %0, 1
%4 = select i1 %2, i32 60, i32 %3
%5 = icmp ult i32 %4, %0
%6 = select i1 %5, i32 %0, i32 %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
int /*<<< orphan*/ Label_Printf(char *);
void Dico_Long_Start(int nb_longs) {
  Label_Printf(".data");
  Inst_Printf(".align", "16");
}


x86 assembly (clang, -O0):
<Dico_Long_Start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <Label_Printf@plt>
lea    0xec8(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dico_Long_Start>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Label_Printf@plt>
lea    0xed2(%rip),%rdi
lea    0xed2(%rip),%rsi
pop    %rax
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c".data\00"
@.str.1 = [7 x i8] c".align\00"
@.str.2 = [3 x i8] c"16\00"
define void @Dico_Long_Start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c".data\00"
@.str.1 = [7 x i8] c".align\00"
@.str.2 = [3 x i8] c"16\00"
define void @Dico_Long_Start(i32 %0) {
%2 = tail call i32 @Label_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int d37(int);
int d38(int a) { return d37(d37(a)); }


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

x86 assembly (clang, -O2):
<d38>:
push   %rax
call   1030 <d37@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d37@plt>

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

LLVM IR (-O2):
define i32 @d38(i32 %0) {
%2 = tail call i32 @d37(i32 %0)
%3 = tail call i32 @d37(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ printf(char *);
void main() {
  f();
  printf("not called because exit\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [24 x i8] c"not called because exit\00"
define void @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
int ld_bgt_rr2(long double a1, long double a2) {
  return !(__builtin_isgreater(a1, a2));
}


x86 assembly (clang, -O0):
<ld_bgt_rr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_bgt_rr2>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_bgt_rr2(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 = fcmp ogt x86_fp80 %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @ld_bgt_rr2(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp ule x86_fp80 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t correct_bytes(uint64_t x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @correct_bytes(i32 returned %0) {
ret i32 %0
}
int divide(int a, int b) { return (a / b); }


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

x86 assembly (clang, -O2):
<divide>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @divide(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}