xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_bit_check();
int /*<<< orphan*/ test_bit_clear();
int /*<<< orphan*/ test_bit_set();
int /*<<< orphan*/ test_bit_set_multiple();
int /*<<< orphan*/ test_bit_toggle();
int main(void) {
  test_bit_set();
  test_bit_clear();
  test_bit_toggle();
  test_bit_check();
  test_bit_set_multiple();
  printf("\nNB: bit positions mentioned are 0-based from LSB\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <test_bit_set@plt>
mov    $0x0,%al
call   1060 <test_bit_clear@plt>
mov    $0x0,%al
call   1080 <test_bit_toggle@plt>
mov    $0x0,%al
call   1040 <test_bit_check@plt>
mov    $0x0,%al
call   1050 <test_bit_set_multiple@plt>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_bit_set@plt>
xor    %eax,%eax
call   1060 <test_bit_clear@plt>
xor    %eax,%eax
call   1080 <test_bit_toggle@plt>
xor    %eax,%eax
call   1040 <test_bit_check@plt>
xor    %eax,%eax
call   1050 <test_bit_set_multiple@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"\0ANB: bit positions mentioned are 0-based from LSB\0A\00"
define i32 @main() {
%1 = call i32 (...) @test_bit_set()
%2 = call i32 (...) @test_bit_clear()
%3 = call i32 (...) @test_bit_toggle()
%4 = call i32 (...) @test_bit_check()
%5 = call i32 (...) @test_bit_set_multiple()
%6 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [50 x i8] c"\0ANB: bit positions mentioned are 0-based from LSB\00"
define i32 @main() {
%1 = tail call i32 (...) @test_bit_set()
%2 = tail call i32 (...) @test_bit_clear()
%3 = tail call i32 (...) @test_bit_toggle()
%4 = tail call i32 (...) @test_bit_check()
%5 = tail call i32 (...) @test_bit_set_multiple()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_letters(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void print_arguments(int argc, char *argv[]) {
  int i;
  for (i = 0; i < argc; i++) {
    print_letters(argv[i], strlen(argv[i]));
  }
}


x86 assembly (clang, -O0):
<print_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117c <print_arguments+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <print_letters@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <print_arguments+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arguments>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    115f <print_arguments+0x3f>
mov    %rsi,%r14
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,8),%r12
mov    %r12,%rdi
call   1030 <strlen@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1040 <print_letters@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <print_arguments+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_arguments(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @strlen(i8* %9)
%11 = tail call i32 @print_letters(i8* %9, i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_trace();
void dump_function() { print_trace(); }


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

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

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

LLVM IR (-O2):
define void @dump_function() {
%1 = tail call i32 (...) @print_trace()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_foo();
int /*<<< orphan*/ print(int /*<<< orphan*/);
int main() {
  print(get_foo());
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @get_foo()
%2 = tail call i32 @print(i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void displayDistance(unsigned int raw_distance) {
  float distin = ((float)raw_distance / (100 * 148));
  float distcm = ((float)raw_distance / (100 * 58));
  printf("Distance is %f inches (%f cm)             \r", distin, distcm);
}


x86 assembly (clang, -O0):
<displayDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xed9(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xebc(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayDistance>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm1
movaps %xmm1,%xmm0
divss  0xede(%rip),%xmm0
divss  0xeda(%rip),%xmm1
lea    0xed7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Distance is %f inches (%f cm) \0D\00"
define void @displayDistance(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = uitofp i32 %5 to float
%7 = fdiv float %6, 1.480000e+04
store float %7, float* %3
%8 = load i32, i32* %2
%9 = uitofp i32 %8 to float
%10 = fdiv float %9, 5.800000e+03
store float %10, float* %4
%11 = load float, float* %3
%12 = load float, float* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), float %11, float %12)
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Distance is %f inches (%f cm) \0D\00"
define void @displayDistance(i32 %0) {
%2 = uitofp i32 %0 to float
%3 = fdiv float %2, 1.480000e+04
%4 = fdiv float %2, 5.800000e+03
%5 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), float %3, float %4)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ fts_name;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int strcoll(int /*<<< orphan*/, int /*<<< orphan*/);
int revnamecmp(const FTSENT *a, const FTSENT *b) {
  return (strcoll(b->fts_name, a->fts_name));
}


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

x86 assembly (clang, -O2):
<revnamecmp>:
mov    (%rsi),%eax
mov    (%rdi),%esi
mov    %eax,%edi
jmp    1030 <strcoll@plt>

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @revnamecmp(%struct.TYPE_4__* %0, %struct.TYPE_4__* %1) {
%3 = alloca %struct.TYPE_4__*
%4 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %3
store %struct.TYPE_4__* %1, %struct.TYPE_4__** %4
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @strcoll(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @revnamecmp(%struct.TYPE_4__* nocapture %0, %struct.TYPE_4__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @strcoll(i32 %4, i32 %6)
ret i32 %7
}
unsigned short unsignedshort_ignoring_signedshortint(unsigned short x,
                                                     signed short int y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshort_ignoring_signedshortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshort_ignoring_signedshortint(i16 zeroext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshort_ignoring_signedshortint(i16 returned zeroext %0, i16 signext %1) {
ret i16 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ cores;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ change_cores(int /*<<< orphan*/, int, int *);
int main(int argc, char **argv) {
  int cores[] = {3, 5, 7};
  change_cores(atoi(argv[1]), sizeof(cores) / sizeof(*cores), cores);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
lea    -0x1c(%rbp),%rdx
mov    $0x3,%esi
call   1030 <change_cores@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
lea    0x8(%rsp),%rdx
mov    %eax,%edi
mov    $0x3,%esi
call   1030 <change_cores@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.cores = [3 x i32] [i32 3, i32 5, i32 7]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i32]* %6 to i8*
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%13 = call i32 @change_cores(i32 %11, i32 3, i32* %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.cores = [3 x i32] [i32 3, i32 5, i32 7]
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %3 to i8*
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%9 = call i32 @change_cores(i32 %7, i32 3, i32* %8)
ret i32 0
}
void delayacct_tsk_init(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @delayacct_tsk_init(%struct.task_struct* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m137common_setParams4101(int /*<<< orphan*/,
                                            int /*<<< orphan*/);
int /*<<< orphan*/ m137setChrBankPtr();
void m137setParams4101(uint16_t addr, uint8_t val) {
  m137common_setParams4101(addr, val);
  m137setChrBankPtr();
}


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

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

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

LLVM IR (-O2):
define void @m137setParams4101(i32 %0, i32 %1) {
%3 = tail call i32 @m137common_setParams4101(i32 %0, i32 %1)
%4 = tail call i32 (...) @m137setChrBankPtr()
ret void
}
double pathconN_nm5_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<pathconN_nm5_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm5_sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @pathconN_nm5_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ scalar_to_ymd(int, unsigned int *, unsigned int *,
                                 unsigned int *);
void wg_date_to_ymd(void *db, int date, int *yr, int *mo, int *day) {
  unsigned int y, m, d;
  scalar_to_ymd(date, &y, &m, &d);
  *yr = y;
  *mo = m;
  *day = d;
}


x86 assembly (clang, -O0):
<wg_date_to_ymd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x2c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    -0x34(%rbp),%rcx
call   1030 <scalar_to_ymd@plt>
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wg_date_to_ymd>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %esi,%edi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1030 <scalar_to_ymd@plt>
mov    0xc(%rsp),%eax
mov    %eax,(%rbx)
mov    0x8(%rsp),%eax
mov    %eax,(%r15)
mov    0x4(%rsp),%eax
mov    %eax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @wg_date_to_ymd(i8* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%14 = load i32, i32* %7
%15 = call i32 @scalar_to_ymd(i32 %14, i32* %11, i32* %12, i32* %13)
%16 = load i32, i32* %11
%17 = load i32*, i32** %8
store i32 %16, i32* %17
%18 = load i32, i32* %12
%19 = load i32*, i32** %9
store i32 %18, i32* %19
%20 = load i32, i32* %13
%21 = load i32*, i32** %10
store i32 %20, i32* %21
ret void
}

LLVM IR (-O2):
define void @wg_date_to_ymd(i8* nocapture readnone %0, i32 %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %6 to i8*
%10 = bitcast i32* %7 to i8*
%11 = bitcast i32* %8 to i8*
%12 = call i32 @scalar_to_ymd(i32 %1, i32* %6, i32* %7, i32* %8)
%13 = load i32, i32* %6
store i32 %13, i32* %2
%14 = load i32, i32* %7
store i32 %14, i32* %3
%15 = load i32, i32* %8
store i32 %15, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, unsigned int, int,
                           int);
char *get_readout(int x, int y, unsigned int w, unsigned int h) {
  static char readout[64];
  sprintf(readout, "%dX%d+%d+%d", w, h, x, y);
  return readout;
}


x86 assembly (clang, -O0):
<get_readout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x4(%rbp),%r8d
mov    -0x8(%rbp),%r9d
lea    0x2f07(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2ef4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_readout>:
push   %rbx
mov    %esi,%r9d
mov    %edi,%r8d
lea    0x2f22(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_readout.readout = internal global [64 x i8] zeroinitializer
@.str = [12 x i8] c"%dX%d+%d+%d\00"
define i8* @get_readout(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @sprintf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @get_readout.readout, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11, i32 %12)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @get_readout.readout, i64 0, i64 0)
}

LLVM IR (-O2):
@get_readout.readout = internal global [64 x i8] zeroinitializer
@.str = [12 x i8] c"%dX%d+%d+%d\00"
define i8* @get_readout(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @get_readout.readout, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %0, i32 %1)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @get_readout.readout, i64 0, i64 0)
}
void finish_perf_record(struct uftrace_perf_writer *perf) {}


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

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

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

LLVM IR (-O2):
%struct.uftrace_perf_writer = type opaque
define void @finish_perf_record(%struct.uftrace_perf_writer* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int json_parser_on_int64(void *ctx, int64_t i) { return -1; }


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

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

LLVM IR (-O0):
define i32 @json_parser_on_int64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @json_parser_on_int64(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
int F(int X) {
  if (X == 0)
    return 0;
  else
    return 2 * F(X - 1) + X * X;
}


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <F+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114b <F+0x3b>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <F@plt>
shl    $0x1,%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
test   %edi,%edi
je     1127 <F+0x17>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1030 <F@plt>
imul   %ebx,%ebx
lea    (%rbx,%rax,2),%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @F(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @F(i32 %6)
%8 = shl nsw i32 %7, 1
%9 = mul nsw i32 %0, %0
%10 = add nsw i32 %8, %9
br label %3
}
int test_imm_6Aint8_reg(signed char val) {
  return ((val) & (0x6A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Aint8_reg(i8 signext %0) {
%2 = and i8 %0, 106
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int load(int i, char x) {
  int acii;
  acii = x;
  acii = acii - 64;
  return (i * acii);
}


x86 assembly (clang, -O0):
<load>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<load>:
lea    -0x40(%rsi),%eax
imul   %edi,%eax
ret

LLVM IR (-O0):
define i32 @load(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 64
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = mul nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @load(i32 %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = add nsw i32 %3, -64
%5 = mul nsw i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void main() { printf("%s ravindra", "%s ravindra"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s ravindra\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
void const_cast_i(const int *dest, const int src) { *(int *)dest = src; }


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

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

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

LLVM IR (-O2):
define void @const_cast_i(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

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

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


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

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

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

LLVM IR (-O2):
define void @set_XPointerMovedEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
void v_scal(double *A, double *B, double *C) {
  register int i;
  for (i = 0; i < 3; i++) {
    C[i] = *A * B[i];
  }
}


x86 assembly (clang, -O0):
<v_scal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1151 <v_scal+0x51>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <v_scal+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_scal>:
movsd  (%rdi),%xmm0
mulsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  (%rdi),%xmm0
mulsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  (%rdi),%xmm0
mulsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

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

LLVM IR (-O2):
define void @v_scal(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fmul double %4, %5
store double %6, double* %2
%7 = load double, double* %0
%8 = getelementptr inbounds double, double* %1, i64 1
%9 = load double, double* %8
%10 = fmul double %7, %9
%11 = getelementptr inbounds double, double* %2, i64 1
store double %10, double* %11
%12 = load double, double* %0
%13 = getelementptr inbounds double, double* %1, i64 2
%14 = load double, double* %13
%15 = fmul double %12, %14
%16 = getelementptr inbounds double, double* %2, i64 2
store double %15, double* %16
ret void
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_w39_common(struct flashrom_flashctx *, int);
int printlock_w39v040b(struct flashrom_flashctx *flash) {
  return printlock_w39_common(flash, 0x7fff2);
}


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

x86 assembly (clang, -O2):
<printlock_w39v040b>:
mov    $0x7fff2,%esi
jmp    1030 <printlock_w39_common@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040b(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @printlock_w39_common(%struct.flashrom_flashctx* %3, i32 524274)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040b(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @printlock_w39_common(%struct.flashrom_flashctx* %0, i32 524274)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int rc() {
  FILE *fd = popen("ps -e | grep deluged", "r");
  return pclose(fd);
}


x86 assembly (clang, -O0):
<rc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee6(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <pclose@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"ps -e | grep deluged\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @rc() {
%1 = alloca i32*
%2 = call i32* @popen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @pclose(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"ps -e | grep deluged\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @rc() {
%1 = tail call i32* @popen(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @pclose(i32* %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ my_daemon();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("my_daemon start...\n");
  my_daemon();
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <my_daemon@plt>
jmp    1142 <main+0x22>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <my_daemon@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1140 <main+0x20>

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

LLVM IR (-O2):
@str = [19 x i8] c"my_daemon start...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @my_daemon()
br label %3
3: ; preds = %0, %3
br label %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int note_XY_present_P(uint8_t flags) { return !(flags & 0x80); }


x86 assembly (clang, -O0):
<note_XY_present_P>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<note_XY_present_P>:
xor    %eax,%eax
test   $0x80,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @note_XY_present_P(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @note_XY_present_P(i32 %0) {
%2 = lshr i32 %0, 7
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct reiserfs_key {
  int dummy;
};

/* Variables and functions */
int le_key_k_offset(int, struct reiserfs_key *);
int le_key_version(struct reiserfs_key *);
int indirect_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize) {
  int version = le_key_version(key);
  return (le_key_k_offset(version, key) != 1);
}


x86 assembly (clang, -O0):
<indirect_is_left_mergeable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <le_key_version@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <le_key_k_offset@plt>
cmp    $0x1,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indirect_is_left_mergeable>:
push   %rbx
mov    %rdi,%rbx
call   1040 <le_key_version@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1030 <le_key_k_offset@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.reiserfs_key = type { i32 }
define i32 @indirect_is_left_mergeable(%struct.reiserfs_key* %0, i64 %1) {
%3 = alloca %struct.reiserfs_key*
%4 = alloca i64
%5 = alloca i32
store %struct.reiserfs_key* %0, %struct.reiserfs_key** %3
store i64 %1, i64* %4
%6 = load %struct.reiserfs_key*, %struct.reiserfs_key** %3
%7 = call i32 @le_key_version(%struct.reiserfs_key* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load %struct.reiserfs_key*, %struct.reiserfs_key** %3
%10 = call i32 @le_key_k_offset(i32 %8, %struct.reiserfs_key* %9)
%11 = icmp ne i32 %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.reiserfs_key = type { i32 }
define i32 @indirect_is_left_mergeable(%struct.reiserfs_key* %0, i64 %1) {
%3 = tail call i32 @le_key_version(%struct.reiserfs_key* %0)
%4 = tail call i32 @le_key_k_offset(i32 %3, %struct.reiserfs_key* %0)
%5 = icmp ne i32 %4, 1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void write_format(FILE *fd) { fprintf(fd, "BINARY\n"); }


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

x86 assembly (clang, -O2):
<write_format>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"BINARY\0A\00"
define void @write_format(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gmx_multipoles(int, char **);
int main(int argc, char *argv[]) {
  gmx_multipoles(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_multipoles(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, int, int);
void t4() {
  int a[] = {55, 67};
  int *b = a + 1;
  fexpect("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c",
          26, 67, *b);
  ;
}


x86 assembly (clang, -O0):
<t4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
lea    0xecc(%rip),%rdi
mov    $0x1a,%esi
mov    $0x43,%edx
call   1030 <fexpect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t4>:
lea    0xee9(%rip),%rdi
mov    $0x1a,%esi
mov    $0x43,%edx
mov    $0x43,%ecx
jmp    1030 <fexpect@plt>

LLVM IR (-O0):
@__const.t4.a = [2 x i32] [i32 55, i32 67]
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t4() {
%1 = alloca [2 x i32]
%2 = alloca i32*
%3 = bitcast [2 x i32]* %1 to i8*
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 26, i32 67, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [127 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/decl.c\00"
define void @t4() {
%1 = tail call i32 @fexpect(i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0), i32 26, i32 67, i32 67)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  char *s = "%d %d\n";
  int x = 3;
  int y = 9;
  printf(s, x, y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x9,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 3, i32 9)
ret i32 0
}
int fun797() { return 797; }


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

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

LLVM IR (-O0):
define i32 @fun797() {
ret i32 797
}

LLVM IR (-O2):
define i32 @fun797() {
ret i32 797
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pthread_cancel(int /*<<< orphan*/);
extern void thread_cancel(pthread_t thread) {
  int err = pthread_cancel(thread);
  if (err != 0) {
    perror("pthread_cancel");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<thread_cancel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <pthread_cancel@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116a <thread_cancel+0x3a>
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_cancel>:
push   %rax
call   1050 <pthread_cancel@plt>
test   %eax,%eax
jne    113c <thread_cancel+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"pthread_cancel\00"
@EXIT_FAILURE = global i32 0
define void @thread_cancel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @pthread_cancel(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"pthread_cancel\00"
@EXIT_FAILURE = global i32 0
define void @thread_cancel(i32 %0) {
%2 = tail call i32 @pthread_cancel(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
void foo_1_2_2_1_2_1_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_2_1_2_1_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World!!!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [15 x i8] c"Hello World!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void fh_test_cmd_helpmsg(const char *process_name) {
  fprintf(stderr,
          "Usage: %s [OPTION]...\n"
          "  -h, -?       Display this message\n"
          "  -c           Print results in a more compact format\n"
          "\n",
          process_name);
  exit(1);
}


x86 assembly (clang, -O0):
<fh_test_cmd_helpmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fh_test_cmd_helpmsg>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [114 x i8] c"Usage: %s [OPTION]...\0A -h, -? Display this message\0A -c Print results in a more compact format\0A\0A\00"
define void @fh_test_cmd_helpmsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [114 x i8] c"Usage: %s [OPTION]...\0A -h, -? Display this message\0A -c Print results in a more compact format\0A\0A\00"
define void @fh_test_cmd_helpmsg(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}