xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ realloc(int *, int);
int *allocate_space_int(int *pointer, int existing_slots) {
  int new_total_slots = existing_slots + 1;
  int *new_pointer = (int *)realloc(pointer, new_total_slots * sizeof(int));
  return new_pointer;
}


x86 assembly (clang, -O0):
<allocate_space_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_space_int>:
lea    0x4(,%rsi,4),%esi
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i32* @allocate_space_int(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = trunc i64 %12 to i32
%14 = call i64 @realloc(i32* %9, i32 %13)
%15 = inttoptr i64 %14 to i32*
store i32* %15, i32** %6
%16 = load i32*, i32** %6
ret i32* %16
}

LLVM IR (-O2):
define i32* @allocate_space_int(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = add i32 %3, 4
%5 = tail call i64 @realloc(i32* %0, i32 %4)
%6 = inttoptr i64 %5 to i32*
ret i32* %6
}
long long int z(long long int x) {
  long double i = 5;
  long long int trailling = 0;
  for (i = 5; i <= x; i *= 5) {
    trailling = trailling + (x / i);
  }
  return trailling;
}


x86 assembly (clang, -O0):
<z>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
flds   0xef2(%rip)
fld    %st(0)
fstpt  -0x20(%rbp)
movq   $0x0,-0x28(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
fildll -0x30(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jb     118c <z+0x8c>
jmp    113b <z+0x3b>
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
fildll -0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
fildll -0x40(%rbp)
fldt   -0x20(%rbp)
fdivrp %st,%st(1)
faddp  %st,%st(1)
fnstcw -0x4a(%rbp)
movzwl -0x4a(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x4c(%rbp)
fldcw  -0x4c(%rbp)
fistpll -0x38(%rbp)
fldcw  -0x4a(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
fldt   -0x20(%rbp)
flds   0xe7e(%rip)
fmulp  %st,%st(1)
fstpt  -0x20(%rbp)
jmp    111e <z+0x1e>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<z>:
mov    %rdi,-0x8(%rsp)
fildll -0x8(%rsp)
cmp    $0x5,%rdi
jge    1119 <z+0x19>
fstp   %st(0)
xor    %eax,%eax
fldz
fldz
jmp    1171 <z+0x71>
flds   0xee1(%rip)
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,-0x18(%rsp)
fildll -0x18(%rsp)
fld    %st(2)
fdiv   %st(2),%st
faddp  %st,%st(1)
fnstcw -0x1c(%rsp)
movzwl -0x1c(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0x1a(%rsp)
fldcw  -0x1a(%rsp)
fistpll -0x10(%rsp)
fldcw  -0x1c(%rsp)
mov    -0x10(%rsp),%rax
fmuls  0xe97(%rip)
fxch   %st(1)
fucomi %st(1),%st
fxch   %st(1)
jae    1130 <z+0x30>
fstp   %st(1)
fstp   %st(0)
ret

LLVM IR (-O0):
define i64 @z(i64 %0) {
%2 = alloca i64
%3 = alloca x86_fp80
%4 = alloca i64
store i64 %0, i64* %2
store x86_fp80 0xK4001A000000000000000, x86_fp80* %3
store i64 0, i64* %4
store x86_fp80 0xK4001A000000000000000, x86_fp80* %3
br label %5
5: ; preds = %19, %1
%6 = load x86_fp80, x86_fp80* %3
%7 = load i64, i64* %2
%8 = sitofp i64 %7 to x86_fp80
%9 = fcmp ole x86_fp80 %6, %8
br i1 %9, label %10, label %22
10: ; preds = %5
%11 = load i64, i64* %4
%12 = sitofp i64 %11 to x86_fp80
%13 = load i64, i64* %2
%14 = sitofp i64 %13 to x86_fp80
%15 = load x86_fp80, x86_fp80* %3
%16 = fdiv x86_fp80 %14, %15
%17 = fadd x86_fp80 %12, %16
%18 = fptosi x86_fp80 %17 to i64
store i64 %18, i64* %4
br label %19
19: ; preds = %10
%20 = load x86_fp80, x86_fp80* %3
%21 = fmul x86_fp80 %20, 0xK4001A000000000000000
store x86_fp80 %21, x86_fp80* %3
br label %5
22: ; preds = %5
%23 = load i64, i64* %4
ret i64 %23
}

LLVM IR (-O2):
define i64 @z(i64 %0) {
%2 = sitofp i64 %0 to x86_fp80
%3 = icmp slt i64 %0, 5
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = phi x86_fp80 [ %11, %4 ], [ 0xK4001A000000000000000, %1 ]
%7 = sitofp i64 %5 to x86_fp80
%8 = fdiv x86_fp80 %2, %6
%9 = fadd x86_fp80 %8, %7
%10 = fptosi x86_fp80 %9 to i64
%11 = fmul x86_fp80 %6, 0xK4001A000000000000000
%12 = fcmp ugt x86_fp80 %11, %2
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
char *inet_ntoa_r(struct in_addr, char *);
char *inet_ntoa(struct in_addr in) {
  static char buf[20];
  return inet_ntoa_r(in, buf);
}


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

x86 assembly (clang, -O2):
<inet_ntoa>:
lea    0x2f29(%rip),%rsi
jmp    1030 <inet_ntoa_r@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@inet_ntoa.buf = internal global [20 x i8] zeroinitializer
define i8* @inet_ntoa(i32 %0) {
%2 = alloca %struct.in_addr
%3 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
store i32 %0, i32* %3
%4 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i8* @inet_ntoa_r(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @inet_ntoa.buf, i64 0, i64 0))
ret i8* %6
}

LLVM IR (-O2):
@inet_ntoa.buf = internal global [20 x i8] zeroinitializer
define i8* @inet_ntoa(i32 %0) {
%2 = tail call i8* @inet_ntoa_r(i32 %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @inet_ntoa.buf, i64 0, i64 0))
ret i8* %2
}
int mg_num_leap_years(int year) { return year / 4 - year / 100 + year / 400; }


x86 assembly (clang, -O0):
<mg_num_leap_years>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mg_num_leap_years>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
movslq %edi,%rcx
imul   $0xffffffffae147ae1,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
add    %eax,%edx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mg_num_leap_years(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = sdiv i32 %0, -100
%4 = add nsw i32 %3, %2
%5 = sdiv i32 %0, 400
%6 = add nsw i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dummy();
int main(void) {
  dummy();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dummy()
ret i32 0
}
int test_imm_D8int8_mem(signed char *val) {
  return ((*val) & (-0xD8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D8int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff28,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D8int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -216
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strndup(char *, int);
int strtol(char *, char **, int);
int hexchars2int(const char *chars, int size) {
  char *numberstr;
  char *endptr;
  int number;
  numberstr = strndup((char *)chars, size);
  number = strtol(numberstr, &endptr, 16);
  free(numberstr);
  return number;
}


x86 assembly (clang, -O0):
<hexchars2int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <strndup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1050 <strtol@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexchars2int>:
push   %rbp
push   %rbx
push   %rax
call   1040 <strndup@plt>
mov    %rax,%rbx
mov    %rsp,%rsi
mov    %rax,%rdi
mov    $0x10,%edx
call   1050 <strtol@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hexchars2int(i8* nocapture %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = tail call i8* @strndup(i8* %0, i32 %1)
%6 = call i32 @strtol(i8* %5, i8** %3, i32 16)
%7 = tail call i32 @free(i8* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ syscall0(int);
void resume(void) { syscall0(0x2002); }


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

x86 assembly (clang, -O2):
<resume>:
mov    $0x2002,%edi
jmp    1030 <syscall0@plt>

LLVM IR (-O0):
define void @resume() {
%1 = call i32 @syscall0(i32 8194)
ret void
}

LLVM IR (-O2):
define void @resume() {
%1 = tail call i32 @syscall0(i32 8194)
ret void
}
int foo27() { return 27; }


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

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

LLVM IR (-O0):
define i32 @foo27() {
ret i32 27
}

LLVM IR (-O2):
define i32 @foo27() {
ret i32 27
}
int devtmpfs_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @devtmpfs_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @devtmpfs_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ record_linux_param_description(char *, char *, char *);
void module_param_desc_beta(void) {
  record_linux_param_description("tcp_bic.c", "beta",
                                 "beta for multiplicative increase");
}


x86 assembly (clang, -O0):
<module_param_desc_beta>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xee6(%rip),%rdx
call   1030 <record_linux_param_description@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_param_desc_beta>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xeea(%rip),%rdx
jmp    1030 <record_linux_param_description@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [5 x i8] c"beta\00"
@.str.2 = [33 x i8] c"beta for multiplicative increase\00"
define void @module_param_desc_beta() {
%1 = call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"tcp_bic.c\00"
@.str.1 = [5 x i8] c"beta\00"
@.str.2 = [33 x i8] c"beta for multiplicative increase\00"
define void @module_param_desc_beta() {
%1 = tail call i32 @record_linux_param_description(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closeSocket(int sockfd) { close(sockfd); }


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

x86 assembly (clang, -O2):
<closeSocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closeSocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void manejaSigUsr1(int numSignal) {}


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

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

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

LLVM IR (-O2):
define void @manejaSigUsr1(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void CEC_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @CEC_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeCharVector(char *vector) { free(vector); }


x86 assembly (clang, -O0):
<freeCharVector>:
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):
<freeCharVector>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @freeCharVector(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 @freeCharVector(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long double f(long double x, long double y) { return (1.0 - x + (4.0 * y)); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fld1
fsubp  %st,%st(1)
fldt   -0x20(%rbp)
flds   0xee0(%rip)
fmulp  %st,%st(1)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fld1
fsubp  %st,%st(1)
fxch   %st(1)
fmuls  0xeec(%rip)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @f(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 = fsub x86_fp80 0xK3FFF8000000000000000, %5
%7 = load x86_fp80, x86_fp80* %4
%8 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 0xK40018000000000000000, x86_fp80 %7, x86_fp80 %6)
ret x86_fp80 %8
}

LLVM IR (-O2):
define x86_fp80 @f(x86_fp80 %0, x86_fp80 %1) {
%3 = fsub x86_fp80 0xK3FFF8000000000000000, %0
%4 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %1, x86_fp80 0xK40018000000000000000, x86_fp80 %3)
ret x86_fp80 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
int strlen(char const *);
int is_suf(const char *str, const char *suf) {
  int str_len = strlen(str);
  int str_suf = strlen(suf);
  return strcmp(str + str_len - str_suf, suf) == 0;
}


x86 assembly (clang, -O0):
<is_suf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
add    %rax,%rdi
movslq -0x18(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_suf>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %ebp,%rdi
add    %rbx,%rdi
cltq
sub    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_suf(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = sub i64 0, %16
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8*, i8** %4
%20 = call i64 @strcmp(i8* %18, i8* %19)
%21 = icmp eq i64 %20, 0
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_suf(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = sext i32 %4 to i64
%8 = sub nsw i64 0, %7
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = tail call i64 @strcmp(i8* %9, i8* %1)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
struct msg_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct msg_buff *);
void msgb_free(struct msg_buff *msgb) { free(msgb); }


x86 assembly (clang, -O0):
<msgb_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):
<msgb_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.msg_buff = type { i32 }
define void @msgb_free(%struct.msg_buff* %0) {
%2 = alloca %struct.msg_buff*
store %struct.msg_buff* %0, %struct.msg_buff** %2
%3 = load %struct.msg_buff*, %struct.msg_buff** %2
%4 = call i32 @free(%struct.msg_buff* %3)
ret void
}

LLVM IR (-O2):
%struct.msg_buff = type { i32 }
define void @msgb_free(%struct.msg_buff* nocapture %0) {
%2 = tail call i32 @free(%struct.msg_buff* %0)
ret void
}
void simple_object_set_little_32(unsigned char *buf, unsigned int val) {
  buf[3] = (val >> 24) & 0xff;
  buf[2] = (val >> 16) & 0xff;
  buf[1] = (val >> 8) & 0xff;
  buf[0] = val & 0xff;
}


x86 assembly (clang, -O0):
<simple_object_set_little_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_object_set_little_32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @simple_object_set_little_32(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 3
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 1
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @simple_object_set_little_32(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %4, i8* %5
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %7, i8* %8
%9 = lshr i32 %1, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %10, i8* %11
%12 = trunc i32 %1 to i8
store i8 %12, i8* %0
ret void
}
/* Variables and functions */
void *malloc(int volatile);
void *alloc5(volatile int one) { return malloc(one); }


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

x86 assembly (clang, -O2):
<alloc5>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%edi
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @alloc5(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = tail call i8* @malloc(i32 %3)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int pthread_detach(pthread_t __th) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_detach(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a(char *, char *);
__attribute__((no)) void b(char *ptr) { a(ptr + 1, &ptr[2]); }


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

x86 assembly (clang, -O2):
<b>:
lea    0x1(%rdi),%rax
lea    0x2(%rdi),%rsi
mov    %rax,%rdi
jmp    1030 <a@plt>

LLVM IR (-O0):
define void @b(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = call i32 @a(i8* %4, i8* %6)
ret void
}

LLVM IR (-O2):
define void @b(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i32 @a(i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gdt_init();
int /*<<< orphan*/ idt_init();
int /*<<< orphan*/ isr_init();
int /*<<< orphan*/ paging_init();
int /*<<< orphan*/ pic_init();
int /*<<< orphan*/ pit_init();
void arch_entry() {
  paging_init();
  gdt_init();
  idt_init();
  isr_init();
  pic_init();
  pit_init();
}


x86 assembly (clang, -O0):
<arch_entry>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1080 <paging_init@plt>
mov    $0x0,%al
call   1070 <gdt_init@plt>
mov    $0x0,%al
call   1050 <idt_init@plt>
mov    $0x0,%al
call   1060 <isr_init@plt>
mov    $0x0,%al
call   1030 <pic_init@plt>
mov    $0x0,%al
call   1040 <pit_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_entry>:
push   %rax
xor    %eax,%eax
call   1080 <paging_init@plt>
xor    %eax,%eax
call   1070 <gdt_init@plt>
xor    %eax,%eax
call   1050 <idt_init@plt>
xor    %eax,%eax
call   1060 <isr_init@plt>
xor    %eax,%eax
call   1030 <pic_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pit_init@plt>

LLVM IR (-O0):
define void @arch_entry() {
%1 = call i32 (...) @paging_init()
%2 = call i32 (...) @gdt_init()
%3 = call i32 (...) @idt_init()
%4 = call i32 (...) @isr_init()
%5 = call i32 (...) @pic_init()
%6 = call i32 (...) @pit_init()
ret void
}

LLVM IR (-O2):
define void @arch_entry() {
%1 = tail call i32 (...) @paging_init()
%2 = tail call i32 (...) @gdt_init()
%3 = tail call i32 (...) @idt_init()
%4 = tail call i32 (...) @isr_init()
%5 = tail call i32 (...) @pic_init()
%6 = tail call i32 (...) @pit_init()
ret void
}
void ConvertAddr(char *saddr, void **addr) { *addr = (void *)&saddr; }


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

x86 assembly (clang, -O2):
<ConvertAddr>:
lea    -0x8(%rsp),%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @ConvertAddr(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = bitcast i8** %3 to i8*
%6 = load i8**, i8*** %4
store i8* %5, i8** %6
ret void
}

LLVM IR (-O2):
define void @ConvertAddr(i8* %0, i8** nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %1 to i8***
store i8** %3, i8*** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ unlink(char *);
void clu_init(void) {
  mkdir("/tmp/clcache", 0777);
  unlink("/tmp/clcache/index.cli");
}


x86 assembly (clang, -O0):
<clu_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x1ff,%esi
call   1040 <mkdir@plt>
lea    0xed1(%rip),%rdi
call   1030 <unlink@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clu_init>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1ff,%esi
call   1040 <mkdir@plt>
lea    0xed4(%rip),%rdi
pop    %rax
jmp    1030 <unlink@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/tmp/clcache\00"
@.str.1 = [23 x i8] c"/tmp/clcache/index.cli\00"
define void @clu_init() {
%1 = call i32 @mkdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 511)
%2 = call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"/tmp/clcache\00"
@.str.1 = [23 x i8] c"/tmp/clcache/index.cli\00"
define void @clu_init() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 511)
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f278(int *);
int f279(int *p) { return f278(p); }


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

x86 assembly (clang, -O2):
<f279>:
jmp    1030 <f278@plt>

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

LLVM IR (-O2):
define i32 @f279(i32* %0) {
%2 = tail call i32 @f278(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
char *strstr(char const *, char *);
size_t u_char_to_u(int /*<<< orphan*/, char *);
size_t u_char_index(const char *str, uint32_t c) {
  char ch[7];
  ch[u_char_to_u(c, ch)] = '\0';
  char *p = strstr(str, ch);
  return (p != NULL) ? p - str : -1;
}


x86 assembly (clang, -O0):
<u_char_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x13(%rbp),%rsi
call   1030 <u_char_to_u@plt>
movb   $0x0,-0x13(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
lea    -0x13(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1170 <u_char_index+0x50>
mov    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    1180 <u_char_index+0x60>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x28(%rbp)
jmp    1180 <u_char_index+0x60>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_char_index>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x1(%rsp),%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <u_char_to_u@plt>
movb   $0x0,0x1(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
cmp    $0x1,%rax
sbb    %rax,%rax
or     %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @u_char_index(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [7 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%9 = call i64 @u_char_to_u(i32 %7, i8* %8)
%10 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%13 = call i8* @strstr(i8* %11, i8* %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %22
16: ; preds = %2
%17 = load i8*, i8** %6
%18 = load i8*, i8** %3
%19 = ptrtoint i8* %17 to i64
%20 = ptrtoint i8* %18 to i64
%21 = sub i64 %19, %20
br label %23
22: ; preds = %2
br label %23
23: ; preds = %22, %16
%24 = phi i64 [ %21, %16 ], [ -1, %22 ]
ret i64 %24
}

LLVM IR (-O2):
define i64 @u_char_index(i8* %0, i32 %1) {
%3 = alloca [7 x i8]
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%5 = call i64 @u_char_to_u(i32 %1, i8* %4)
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 %5
store i8 0, i8* %6
%7 = call i8* @strstr(i8* dereferenceable(1) %0, i8* %4)
%8 = icmp eq i8* %7, null
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = select i1 %8, i64 -1, i64 %11
ret i64 %12
}
/* Variables and functions */
int compute_square(int);
int main() {
  int x = 2;
  x = compute_square(x) + 2;
  x = compute_square(x) + 2;
  if (x != 12) {
    goto ERROR;
  }
  return 0;
ERROR:
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <compute_square@plt>
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <compute_square@plt>
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xc,-0x8(%rbp)
je     1151 <main+0x41>
jmp    115d <main+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1164 <main+0x54>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <compute_square@plt>
lea    0x2(%rax),%edi
call   1030 <compute_square@plt>
xor    %ecx,%ecx
cmp    $0xa,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @compute_square(i32 2)
%2 = add nsw i32 %1, 2
%3 = tail call i32 @compute_square(i32 %2)
%4 = icmp ne i32 %3, 10
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *parse_proc(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
char *get_user_ps_ctxt_switches(int pid) {
  char path[1024];
  snprintf(path, 1024, "/proc/%d/status", pid);
  return parse_proc(path, "nonvoluntary_ctxt_switches:\t");
}


x86 assembly (clang, -O0):
<get_user_ps_ctxt_switches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x400,%esi
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x410(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <parse_proc@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_user_ps_ctxt_switches>:
push   %rbx
sub    $0x400,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1030 <snprintf@plt>
lea    0xec8(%rip),%rsi
mov    %rbx,%rdi
call   1040 <parse_proc@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/proc/%d/status\00"
@.str.1 = [29 x i8] c"nonvoluntary_ctxt_switches:\09\00"
define i8* @get_user_ps_ctxt_switches(i32 %0) {
%2 = alloca i32
%3 = alloca [1024 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i8* @parse_proc(i8* %7, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i8* %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"/proc/%d/status\00"
@.str.1 = [29 x i8] c"nonvoluntary_ctxt_switches:\09\00"
define i8* @get_user_ps_ctxt_switches(i32 %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 1024, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i8* @parse_proc(i8* %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret i8* %5
}
char *usage(void) {
  return "--net=TAP (host tap device for guest network interface or @NN tap "
         "fd)\n"
         "    [ --net-mac=HWADDR ] (guest MAC address)";
}


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

x86 assembly (clang, -O2):
<usage>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [115 x i8] c"--net=TAP (host tap device for guest network interface or @NN tap fd)\0A [ --net-mac=HWADDR ] (guest MAC address)\00"
define i8* @usage() {
ret i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [115 x i8] c"--net=TAP (host tap device for guest network interface or @NN tap fd)\0A [ --net-mac=HWADDR ] (guest MAC address)\00"
define i8* @usage() {
ret i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ block_comm();
int /*<<< orphan*/ square_draw();
void c_rectangle() {
  block_comm();
  square_draw();
}


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

x86 assembly (clang, -O2):
<c_rectangle>:
push   %rax
xor    %eax,%eax
call   1040 <block_comm@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <square_draw@plt>

LLVM IR (-O0):
define void @c_rectangle() {
%1 = call i32 (...) @block_comm()
%2 = call i32 (...) @square_draw()
ret void
}

LLVM IR (-O2):
define void @c_rectangle() {
%1 = tail call i32 (...) @block_comm()
%2 = tail call i32 (...) @square_draw()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _panic(char *, int, char *);
void panic_buffer_overflow() {
  _panic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Yradex/RaspberryPi3_OS/refs/heads/master/"
         "os/lib/print.c",
         472, "Buffer overflow");
}


x86 assembly (clang, -O0):
<panic_buffer_overflow>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1d8,%esi
lea    0xf6b(%rip),%rdx
call   1030 <_panic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic_buffer_overflow>:
lea    0xee9(%rip),%rdi
lea    0xf74(%rip),%rdx
mov    $0x1d8,%esi
jmp    1030 <_panic@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Yradex/RaspberryPi3_OS/refs/heads/master/os/lib/print.c\00"
@.str.1 = [16 x i8] c"Buffer overflow\00"
define void @panic_buffer_overflow() {
%1 = call i32 @_panic(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 472, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Yradex/RaspberryPi3_OS/refs/heads/master/os/lib/print.c\00"
@.str.1 = [16 x i8] c"Buffer overflow\00"
define void @panic_buffer_overflow() {
%1 = tail call i32 @_panic(i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 472, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int INT_MAX;
void bm_increment(int iters) {
  int i, v = 0;
  for (i = 0; i < INT_MAX; ++i) {
    v += i;
  }
}


x86 assembly (clang, -O0):
<bm_increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ec9(%rip),%rcx
cmp    (%rcx),%eax
jge    113e <bm_increment+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <bm_increment+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @bm_increment(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
unsigned char *mem_copy_word2vect_big(unsigned char *,
                                      int /*<<< orphan*/ const);
unsigned char *arch_mem_copy_word2vect_big(unsigned char *v,
                                           const uint16_t word) {
  return mem_copy_word2vect_big(v, word);
}


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

x86 assembly (clang, -O2):
<arch_mem_copy_word2vect_big>:
jmp    1030 <mem_copy_word2vect_big@plt>

LLVM IR (-O0):
define i8* @arch_mem_copy_word2vect_big(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 i8* @mem_copy_word2vect_big(i8* %5, i32 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @arch_mem_copy_word2vect_big(i8* %0, i32 %1) {
%3 = tail call i8* @mem_copy_word2vect_big(i8* %0, i32 %1)
ret i8* %3
}
int FC(int row, int col) {
  if ((row % 2) == 0 && (col % 2) == 0)
    return 0;
  else if ((row % 2) == 1 && (col % 2) == 1)
    return 2;
  else
    return 1;
}


x86 assembly (clang, -O0):
<FC>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113e <FC+0x3e>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113e <FC+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1179 <FC+0x79>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1172 <FC+0x72>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    1172 <FC+0x72>
movl   $0x2,-0x4(%rbp)
jmp    1179 <FC+0x79>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FC>:
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
mov    %esi,%eax
and    $0x1,%eax
or     %edi,%eax
je     1132 <FC+0x32>
xor    $0x1,%edi
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
and    $0xfffffffe,%eax
sub    %eax,%esi
xor    $0x1,%esi
xor    %eax,%eax
or     %edi,%esi
sete   %al
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @FC(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 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %5
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 0, i32* %3
br label %24
14: ; preds = %9, %2
%15 = load i32, i32* %4
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i32, i32* %5
%20 = srem i32 %19, 2
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 2, i32* %3
br label %24
23: ; preds = %18, %14
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %13
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @FC(i32 %0, i32 %1) {
%3 = srem i32 %0, 2
%4 = and i32 %1, 1
%5 = or i32 %4, %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = icmp eq i32 %3, 1
%9 = srem i32 %1, 2
%10 = icmp eq i32 %9, 1
%11 = and i1 %8, %10
%12 = select i1 %11, i32 2, i32 1
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %14
}
const char *code(const char *msg) { return msg; }


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

x86 assembly (clang, -O2):
<code>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @code(i8* readnone returned %0) {
ret i8* %0
}
int test_imm_DFint32_reg(int val) { return ((val) & (0xDF << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_DFint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xdf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_DFint32_reg(i32 %0) {
%2 = and i32 %0, 223
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __ctest_ctest_dummy_nop2_run(void) {}


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

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

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

LLVM IR (-O2):
define void @__ctest_ctest_dummy_nop2_run() {
ret void
}
int dup(d) { return __xdup(d, 0); }


x86 assembly (clang, -O0):
<dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <__xdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <__xdup@plt>

LLVM IR (-O0):
define i32 @dup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @dup(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @__xdup to i32 (i32, i32, ...)*)(i32 %0, i32 0)
ret i32 %2
}
int strlen(s)
char *s;
{
  register char *b = s;
  while (*b++)
    ;
  return b - s - 1;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
je     112d <strlen+0x2d>
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

LLVM IR (-O0):
define i32 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %5
br label %5
11: ; preds = %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = ptrtoint i8* %12 to i64
%15 = ptrtoint i8* %13 to i64
%16 = sub i64 %14, %15
%17 = sub nsw i64 %16, 1
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}
int cairo_code_draw_toggleSwitch_get_height() { return 36; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_toggleSwitch_get_height() {
ret i32 36
}

LLVM IR (-O2):
define i32 @cairo_code_draw_toggleSwitch_get_height() {
ret i32 36
}