xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ print_string(char **, int);
int /*<<< orphan*/ split(char const *, char, char **, int *);
void main() {
  const char *text = "adffasdf,afasdf,fasdfaf,tewr,ffdasf,ar, -----";
  char delim = ',';
  char arr[10][30];
  int count;
  split(text, delim, arr, &count);
  print_string(arr, count);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
movb   $0x2c,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
lea    -0x140(%rbp),%rdx
lea    -0x144(%rbp),%rcx
movsbl %al,%esi
call   1040 <split@plt>
lea    -0x140(%rbp),%rdi
mov    -0x144(%rbp),%esi
call   1030 <print_string@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x140,%rsp
lea    0xed1(%rip),%rdi
lea    0x10(%rsp),%rbx
lea    0xc(%rsp),%rcx
mov    $0x2c,%esi
mov    %rbx,%rdx
call   1040 <split@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <print_string@plt>
add    $0x140,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"adffasdf,afasdf,fasdfaf,tewr,ffdasf,ar, -----\00"
define void @main() {
%1 = alloca i8*
%2 = alloca i8
%3 = alloca [10 x [30 x i8]]
%4 = alloca i32
store i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8** %1
store i8 44, i8* %2
%5 = load i8*, i8** %1
%6 = load i8, i8* %2
%7 = getelementptr inbounds [10 x [30 x i8]], [10 x [30 x i8]]* %3, i64 0, i64 0
%8 = bitcast [30 x i8]* %7 to i8**
%9 = call i32 @split(i8* %5, i8 signext %6, i8** %8, i32* %4)
%10 = getelementptr inbounds [10 x [30 x i8]], [10 x [30 x i8]]* %3, i64 0, i64 0
%11 = bitcast [30 x i8]* %10 to i8**
%12 = load i32, i32* %4
%13 = call i32 @print_string(i8** %11, i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"adffasdf,afasdf,fasdfaf,tewr,ffdasf,ar, -----\00"
define void @main() {
%1 = alloca [10 x [30 x i8]]
%2 = alloca i32
%3 = getelementptr inbounds [10 x [30 x i8]], [10 x [30 x i8]]* %1, i64 0, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = bitcast [10 x [30 x i8]]* %1 to i8**
%6 = call i32 @split(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8 signext 44, i8** %5, i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @print_string(i8** %5, i32 %7)
ret void
}
void foo224(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo224(i32 %0) {
ret void
}
/* Type definitions */
struct Person {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Person_read(void *, struct Person *, int, unsigned long);
int read_raw_varint32(unsigned long *, void *, int);
int Person_read_delimited_from(void *_buffer, struct Person *_Person,
                               int offset) {
  unsigned long size;
  offset = read_raw_varint32(&size, _buffer, offset);
  Person_read(_buffer, _Person, offset, size + offset);
  return offset + size;
}


x86 assembly (clang, -O0):
<Person_read_delimited_from>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rdi
call   1030 <read_raw_varint32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
movslq -0x14(%rbp),%rax
add    %rax,%rcx
call   1040 <Person_read@plt>
movslq -0x14(%rbp),%rax
add    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Person_read_delimited_from>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1030 <read_raw_varint32@plt>
movslq %eax,%rbx
mov    0x8(%rsp),%rcx
add    %rbx,%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <Person_read@plt>
add    0x8(%rsp),%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Person = type { i32 }
define i32 @Person_read_delimited_from(i8* %0, %struct.Person* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.Person*
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store %struct.Person* %1, %struct.Person** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = call i32 @read_raw_varint32(i64* %7, i8* %8, i32 %9)
store i32 %10, i32* %6
%11 = load i8*, i8** %4
%12 = load %struct.Person*, %struct.Person** %5
%13 = load i32, i32* %6
%14 = load i64, i64* %7
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = add i64 %14, %16
%18 = call i32 @Person_read(i8* %11, %struct.Person* %12, i32 %13, i64 %17)
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = load i64, i64* %7
%22 = add i64 %20, %21
%23 = trunc i64 %22 to i32
ret i32 %23
}

LLVM IR (-O2):
%struct.Person = type { i32 }
define i32 @Person_read_delimited_from(i8* %0, %struct.Person* %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @read_raw_varint32(i64* %4, i8* %0, i32 %2)
%7 = load i64, i64* %4
%8 = sext i32 %6 to i64
%9 = add i64 %7, %8
%10 = call i32 @Person_read(i8* %0, %struct.Person* %1, i32 %6, i64 %9)
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = add i32 %6, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void allow_ctrl_c() { signal(SIGINT, SIG_DFL); }


x86 assembly (clang, -O0):
<allow_ctrl_c>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<allow_ctrl_c>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @allow_ctrl_c() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @allow_ctrl_c() {
%1 = load i32, i32* @SIGINT
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ conquer(int *, int, int, int);
void divide(int *input, int low, int high) {
  int mid;
  if (low < high) {
    mid = (low + high) / 2;
    divide(input, low, mid);
    divide(input, mid + 1, high);
    conquer(input, low, mid, high);
  }
  return;
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <divide+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <divide@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <divide@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <conquer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
cmp    %edx,%esi
jge    1172 <divide+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <divide@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <divide@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <conquer@plt>
ret

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

LLVM IR (-O2):
define void @divide(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @divide(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @divide(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @conquer(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
double sequence_sum_arithmethic(long n, double nfirst, double nlast) {
  double sum_results = n * (nfirst + nlast) / 2;
  return sum_results;
}


x86 assembly (clang, -O0):
<sequence_sum_arithmethic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
addsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sequence_sum_arithmethic>:
cvtsi2sd %rdi,%xmm2
addsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
mulsd  0xeeb(%rip),%xmm0
ret

LLVM IR (-O0):
define double @sequence_sum_arithmethic(i64 %0, double %1, double %2) {
%4 = alloca i64
%5 = alloca double
%6 = alloca double
%7 = alloca double
store i64 %0, i64* %4
store double %1, double* %5
store double %2, double* %6
%8 = load i64, i64* %4
%9 = sitofp i64 %8 to double
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fadd double %10, %11
%13 = fmul double %9, %12
%14 = fdiv double %13, 2.000000e+00
store double %14, double* %7
%15 = load double, double* %7
ret double %15
}

LLVM IR (-O2):
define double @sequence_sum_arithmethic(i64 %0, double %1, double %2) {
%4 = sitofp i64 %0 to double
%5 = fadd double %1, %2
%6 = fmul double %5, %4
%7 = fmul double %6, 5.000000e-01
ret double %7
}
/* Variables and functions */
void template_patch(unsigned char *template, size_t offset, void *replace) {
  unsigned char *where = template + offset;
  union {
    void *ptr;
    unsigned char u8[sizeof(void *)];
  } patch = {replace};
  for (size_t i = 0; i < sizeof(void *); i++)
    where[i] = patch.u8[i];
}


x86 assembly (clang, -O0):
<template_patch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
cmpq   $0x8,-0x30(%rbp)
jae    115b <template_patch+0x5b>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp,%rax,1),%dl
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    112c <template_patch+0x2c>
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i8* }
define void @template_patch(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca %union.anon
%9 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%10 = load i8*, i8** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds i8, i8* %10, i64 %11
store i8* %12, i8** %7
%13 = bitcast %union.anon* %8 to i8**
%14 = load i8*, i8** %6
store i8* %14, i8** %13
store i64 0, i64* %9
br label %15
15: ; preds = %26, %3
%16 = load i64, i64* %9
%17 = icmp ult i64 %16, 8
br i1 %17, label %18, label %29
18: ; preds = %15
%19 = bitcast %union.anon* %8 to [8 x i8]*
%20 = load i64, i64* %9
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %19, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = load i8*, i8** %7
%24 = load i64, i64* %9
%25 = getelementptr inbounds i8, i8* %23, i64 %24
store i8 %22, i8* %25
br label %26
26: ; preds = %18
%27 = load i64, i64* %9
%28 = add i64 %27, 1
store i64 %28, i64* %9
br label %15
29: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @template_patch(i8* nocapture writeonly %0, i64 %1, i8* %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = bitcast i8* %4 to i8**
store i8* %2, i8** %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xa9() {
  Assert_real((isalnum(169) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              850, ("isalnum should be 0 for 0xa9"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0xa9>:
push   %rax
mov    $0xa9,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x352,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa9\00"
define void @t_isalnum_0xa9() {
%1 = call i64 @isalnum(i32 169)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xa9\00"
define void @t_isalnum_0xa9() {
%1 = tail call i64 @isalnum(i32 169)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 850, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int test_imm_D1uint8_mem(unsigned char *val) {
  return ((*val) & (-0xD1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D1uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -209
%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_D1uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 47
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ f_q(int, int, int);
scalar_t__ pow(int /*<<< orphan*/, int);
double sqrt(scalar_t__);
float f_w(int i, int j, int tam) {
  float resp = 2.0 / (1.0 + sqrt(i - pow(f_q(i, j, tam), 2)));
  return resp;
}


x86 assembly (clang, -O0):
<f_w>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <f_q@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
mov    -0x18(%rbp),%rdi
sub    %rax,%rdi
call   1050 <sqrt@plt>
movsd  0xe91(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe7d(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_w>:
push   %rbx
movslq %edi,%rbx
mov    %ebx,%edi
call   1030 <f_q@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <pow@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
call   1050 <sqrt@plt>
addsd  0xea6(%rip),%xmm0
movsd  0xea6(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @f_w(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @f_q(i32 %10, i32 %11, i32 %12)
%14 = call i64 @pow(i32 %13, i32 2)
%15 = sub nsw i64 %9, %14
%16 = call double @sqrt(i64 %15)
%17 = fadd double 1.000000e+00, %16
%18 = fdiv double 2.000000e+00, %17
%19 = fptrunc double %18 to float
store float %19, float* %7
%20 = load float, float* %7
ret float %20
}

LLVM IR (-O2):
define float @f_w(i32 %0, i32 %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = tail call i32 @f_q(i32 %0, i32 %1, i32 %2)
%6 = tail call i64 @pow(i32 %5, i32 2)
%7 = sub nsw i64 %4, %6
%8 = tail call double @sqrt(i64 %7)
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 2.000000e+00, %9
%11 = fptrunc double %10 to float
ret float %11
}
int test_imm_9Dint8_mem(signed char *val) {
  return ((*val) & (0x9D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Dint8_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, 157
%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_9Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -99
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main() {
  int a = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%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
store i32 0, i32* %1
store i32 1, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void foo_1_1_1_2_2_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_2_2_2_1_1() {
ret void
}
/* Type definitions */
struct sockaddr_un {
  char const *sun_path;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
const char *un_sock_name(const struct sockaddr *sockaddr) {
  return ((const struct sockaddr_un *)sockaddr)->sun_path + 1;
}


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

x86 assembly (clang, -O2):
<un_sock_name>:
mov    (%rdi),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
%struct.sockaddr_un = type { i8* }
define i8* @un_sock_name(%struct.sockaddr* %0) {
%2 = alloca %struct.sockaddr*
store %struct.sockaddr* %0, %struct.sockaddr** %2
%3 = load %struct.sockaddr*, %struct.sockaddr** %2
%4 = bitcast %struct.sockaddr* %3 to %struct.sockaddr_un*
%5 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 1
ret i8* %7
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i8* @un_sock_name(%struct.sockaddr* nocapture %0) {
%2 = bitcast %struct.sockaddr* %0 to i8**
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %4
}
double f4_sum_two_float(float v1, float v2) {
  return ((double)(v1)) + ((double)(v2));
}


x86 assembly (clang, -O0):
<f4_sum_two_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_two_float>:
cvtss2sd %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_two_float(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fpext float %5 to double
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fadd double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @f4_sum_two_float(float %0, float %1) {
%3 = fpext float %0 to double
%4 = fpext float %1 to double
%5 = fadd double %3, %4
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *opendir(char const *);
int /*<<< orphan*/ perror(char const *);
DIR *do_opendir(const char *path) {
  DIR *dp = opendir(path);
  if (!(dp)) {
    perror(path);
    exit(EXIT_FAILURE);
  }
  return dp;
}


x86 assembly (clang, -O0):
<do_opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <opendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <do_opendir+0x3b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_opendir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <opendir@plt>
test   %rax,%rax
je     1140 <do_opendir+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define i32* @do_opendir(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @opendir(i8* %4)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %13, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @perror(i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define noalias i32* @do_opendir(i8* nocapture %0) {
%2 = tail call i32* @opendir(i8* %0)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i32* %2
}
int clickplc_int32_dec(unsigned char *stream4bytes, unsigned int *pnumber) {
  int retval = 4;
  *pnumber = ((unsigned int)stream4bytes[0] << 24) |
             ((unsigned int)stream4bytes[1] << 16) |
             ((unsigned int)stream4bytes[2] << 8) |
             (unsigned int)stream4bytes[3];
  return (retval);
}


x86 assembly (clang, -O0):
<clickplc_int32_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
shl    $0x18,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clickplc_int32_dec>:
mov    (%rdi),%eax
bswap  %eax
mov    %eax,(%rsi)
mov    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @clickplc_int32_dec(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 2
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
store i32 %19, i32* %1
ret i32 4
}
/* Variables and functions */
int KEY_DOWN;
int KEY_LEFT;
int KEY_RIGHT;
int KEY_UP;
int inp_isnav(int c) {
  if (c == KEY_DOWN || c == KEY_UP || c == KEY_LEFT || c == KEY_RIGHT)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<inp_isnav>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
je     114f <inp_isnav+0x4f>
mov    -0x8(%rbp),%eax
mov    0x2ebd(%rip),%rcx
cmp    (%rcx),%eax
je     114f <inp_isnav+0x4f>
mov    -0x8(%rbp),%eax
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%eax
je     114f <inp_isnav+0x4f>
mov    -0x8(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115b <inp_isnav+0x5b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <inp_isnav+0x62>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inp_isnav>:
mov    0x2ee1(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ecd(%rip),%rcx
cmp    %edi,(%rcx)
sete   %cl
or     %al,%cl
mov    0x2ea7(%rip),%rax
cmp    %edi,(%rax)
sete   %al
mov    0x2ea3(%rip),%rdx
cmp    %edi,(%rdx)
sete   %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
@KEY_DOWN = global i32 0
@KEY_UP = global i32 0
@KEY_LEFT = global i32 0
@KEY_RIGHT = global i32 0
define i32 @inp_isnav(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @KEY_DOWN
%6 = icmp eq i32 %4, %5
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* @KEY_UP
%10 = icmp eq i32 %8, %9
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* @KEY_LEFT
%14 = icmp eq i32 %12, %13
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i32, i32* %3
%17 = load i32, i32* @KEY_RIGHT
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
@KEY_DOWN = global i32 0
@KEY_UP = global i32 0
@KEY_LEFT = global i32 0
@KEY_RIGHT = global i32 0
define i32 @inp_isnav(i32 %0) {
%2 = load i32, i32* @KEY_DOWN
%3 = icmp eq i32 %2, %0
%4 = load i32, i32* @KEY_UP
%5 = icmp eq i32 %4, %0
%6 = select i1 %3, i1 true, i1 %5
%7 = load i32, i32* @KEY_LEFT
%8 = icmp eq i32 %7, %0
%9 = select i1 %6, i1 true, i1 %8
%10 = load i32, i32* @KEY_RIGHT
%11 = icmp eq i32 %10, %0
%12 = select i1 %9, i1 true, i1 %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(void) {
  int ch;
  while ((ch = getchar()) != EOF)
    putchar(ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea8(%rip),%rcx
cmp    (%rcx),%eax
je     1155 <main+0x35>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* %2
%9 = call i32 @putchar(i32 %8)
br label %3
10: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %10, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %7, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 (...) @getchar()
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %4
10: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int __dup2(int, int);
int /*<<< orphan*/ close(int);
int smbw_dup2(int, int);
scalar_t__ smbw_fd(int);
int dup2(int oldfd, int newfd) {
  if (smbw_fd(newfd)) {
    close(newfd);
  }
  if (smbw_fd(oldfd)) {
    return smbw_dup2(oldfd, newfd);
  }
  return (__dup2(oldfd, newfd));
}


x86 assembly (clang, -O0):
<dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <smbw_fd@plt>
cmp    $0x0,%rax
je     1168 <dup2+0x28>
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%edi
call   1050 <smbw_fd@plt>
cmp    $0x0,%rax
je     118d <dup2+0x4d>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <smbw_dup2@plt>
mov    %eax,-0x4(%rbp)
jmp    119b <dup2+0x5b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <__dup2@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1050 <smbw_fd@plt>
test   %rax,%rax
je     115a <dup2+0x1a>
mov    %ebx,%edi
call   1040 <close@plt>
mov    %ebp,%edi
call   1050 <smbw_fd@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
test   %rax,%rax
je     1175 <dup2+0x35>
pop    %rbx
pop    %rbp
jmp    1060 <smbw_dup2@plt>
pop    %rbx
pop    %rbp
jmp    1030 <__dup2@plt>

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

LLVM IR (-O2):
define i32 @dup2(i32 %0, i32 %1) {
%3 = tail call i64 @smbw_fd(i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @close(i32 %1)
br label %7
7: ; preds = %5, %2
%8 = tail call i64 @smbw_fd(i32 %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 @smbw_dup2(i32 %0, i32 %1)
br label %14
12: ; preds = %7
%13 = tail call i32 @__dup2(i32 %0, i32 %1)
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
ret i32 %15
}
int main() {
  int *p;
  int a = 1;
  p = &((((a))));
  return *p;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
int mem_lock(pthread_mutex_t *lock, const char *info) {
  printf("lock    : [%s]\n", info);
  return pthread_mutex_lock(lock);
}


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

x86 assembly (clang, -O2):
<mem_lock>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"lock : [%s]\0A\00"
define i32 @mem_lock(i32* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @pthread_mutex_lock(i32* %0)
ret i32 %4
}
unsigned long long int power(unsigned int a, unsigned int b) {
  unsigned long long int results = 1;
  for (unsigned int i = 0; i < b; i++) {
    results *= a;
  }
  return results;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jae    113f <power+0x3f>
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1119 <power+0x19>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
je     111a <power+0x1a>
mov    %edi,%ecx
lea    -0x1(%rsi),%eax
mov    %esi,%edx
and    $0x7,%edx
cmp    $0x7,%eax
jae    1120 <power+0x20>
mov    $0x1,%eax
jmp    1155 <power+0x55>
mov    $0x1,%eax
ret
and    $0xfffffff8,%esi
mov    $0x1,%eax
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
imul   %rcx,%rax
add    $0xfffffff8,%esi
jne    1130 <power+0x30>
test   %edx,%edx
je     1169 <power+0x69>
nopl   0x0(%rax)
imul   %rcx,%rax
add    $0xffffffff,%edx
jne    1160 <power+0x60>
ret

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

LLVM IR (-O2):
define i64 @power(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %21, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
%6 = add i32 %1, -1
%7 = and i32 %1, 7
%8 = icmp ult i32 %6, 7
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = and i32 %1, -8
br label %23
11: ; preds = %23, %4
%12 = phi i64 [ undef, %4 ], [ %33, %23 ]
%13 = phi i64 [ 1, %4 ], [ %33, %23 ]
%14 = icmp eq i32 %7, 0
br i1 %14, label %21, label %15
15: ; preds = %11, %15
%16 = phi i64 [ %18, %15 ], [ %13, %11 ]
%17 = phi i32 [ %19, %15 ], [ 0, %11 ]
%18 = mul i64 %16, %5
%19 = add i32 %17, 1
%20 = icmp eq i32 %19, %7
br i1 %20, label %21, label %15
21: ; preds = %11, %15, %2
%22 = phi i64 [ 1, %2 ], [ %12, %11 ], [ %18, %15 ]
ret i64 %22
23: ; preds = %23, %9
%24 = phi i64 [ 1, %9 ], [ %33, %23 ]
%25 = phi i32 [ 0, %9 ], [ %34, %23 ]
%26 = mul i64 %24, %5
%27 = mul i64 %26, %5
%28 = mul i64 %27, %5
%29 = mul i64 %28, %5
%30 = mul i64 %29, %5
%31 = mul i64 %30, %5
%32 = mul i64 %31, %5
%33 = mul i64 %32, %5
%34 = add i32 %25, 8
%35 = icmp eq i32 %34, %10
br i1 %35, label %11, label %23
}
/* Variables and functions */
double RAND_MAX;
double rand();
int event(double prob) {
  int i = rand() < prob * RAND_MAX;
  return (i);
}


x86 assembly (clang, -O0):
<event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
mov    0x2eb5(%rip),%rax
mulsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<event>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec4(%rip),%rax
movsd  (%rsp),%xmm1
mulsd  (%rax),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @event(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = call double (...) @rand()
%5 = load double, double* %2
%6 = load double, double* @RAND_MAX
%7 = fmul double %5, %6
%8 = fcmp olt double %4, %7
%9 = zext i1 %8 to i32
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @event(double %0) {
%2 = tail call double (...) @rand()
%3 = load double, double* @RAND_MAX
%4 = fmul double %3, %0
%5 = fcmp olt double %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint_fast8_t;

/* Variables and functions */
bool SHAREMIND_SET_KEY_EQUALS_uint_fast8_t(uint_fast8_t const k1,
                                           uint_fast8_t const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_SET_KEY_EQUALS_uint_fast8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_SET_KEY_EQUALS_uint_fast8_t>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @SHAREMIND_SET_KEY_EQUALS_uint_fast8_t(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x02() {
  Assert_real((isprint(2) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              15, ("isprint should be 0 for 0x02"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x02>:
push   %rax
mov    $0x2,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x02\00"
define void @t_isprint_0x02() {
%1 = call i64 @isprint(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x02\00"
define void @t_isprint_0x02() {
%1 = tail call i64 @isprint(i32 2)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 15, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pnc_read_int_from_console_optional(char const *, int *, int);
void pnc_read_int_from_console(char const *message, int *val) {
  pnc_read_int_from_console_optional(message, val, false);
}


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

x86 assembly (clang, -O2):
<pnc_read_int_from_console>:
xor    %edx,%edx
jmp    1030 <pnc_read_int_from_console_optional@plt>

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

LLVM IR (-O2):
define void @pnc_read_int_from_console(i8* %0, i32* %1) {
%3 = tail call i32 @pnc_read_int_from_console_optional(i8* %0, i32* %1, i32 0)
ret void
}
OP(ed, ff) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
unsigned char get_flags(unsigned char *fragment) {
  unsigned char ret;
  memcpy(&ret, fragment, 1);
  return ret;
}


x86 assembly (clang, -O0):
<get_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x9(%rbp),%rdi
mov    $0x1,%edx
call   1030 <memcpy@plt>
movzbl -0x9(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_flags>:
push   %rax
mov    %rdi,%rsi
lea    0x7(%rsp),%rdi
mov    $0x1,%edx
call   1030 <memcpy@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @get_flags(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i8* %3, i8* %4, i32 1)
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @get_flags(i8* %0) {
%2 = alloca i8
%3 = call i32 @memcpy(i8* %2, i8* %0, i32 1)
%4 = load i8, i8* %2
ret i8 %4
}
int isleapyear(int y) { return ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0); }


x86 assembly (clang, -O0):
<isleapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <isleapyear+0x34>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1148 <isleapyear+0x48>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isleapyear>:
test   $0x3,%dil
jne    112c <isleapyear+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
imul   $0x64,%eax,%ecx
mov    %edi,%edx
mov    $0x1,%eax
sub    %ecx,%edx
je     112c <isleapyear+0x2c>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isleapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp ne i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %7
%12 = phi i32 [ %10, %7 ], [ 1, %1 ]
ret i32 %12
}