xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
ssize_t sparsetable_num_groups(ssize_t n) {
  return n == 0 ? 0 : ((n - 1) / 48) + 1;
}


x86 assembly (clang, -O0):
<sparsetable_num_groups>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <sparsetable_num_groups+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <sparsetable_num_groups+0x2f>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x30,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sparsetable_num_groups>:
test   %edi,%edi
je     1122 <sparsetable_num_groups+0x22>
add    $0xffffffff,%edi
movslq %edi,%rax
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
sar    $0x23,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @sparsetable_num_groups(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 48
%10 = add nsw i32 %9, 1
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 0, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @sparsetable_num_groups(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = sdiv i32 %4, 48
%6 = add nsw i32 %5, 1
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_indent_statement(int indent, FILE *debugfile) {
  int i;
  for (i = 0; i < indent * 3; i++)
    fprintf(debugfile, " ");
}


x86 assembly (clang, -O0):
<print_indent_statement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   $0x3,-0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1153 <print_indent_statement+0x43>
mov    -0x10(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_indent_statement+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent_statement>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1142 <print_indent_statement+0x32>
mov    %rsi,%rbx
lea    (%rdi,%rdi,2),%eax
cmp    $0x2,%eax
mov    $0x1,%ebp
cmovge %eax,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1130 <print_indent_statement+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @print_indent_statement(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 3
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %17
11: ; preds = %6
%12 = load i32*, i32** %4
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11
%15 = load i32, i32* %5
%16 = add nsw i32 %15, 1
store i32 %16, i32* %5
br label %6
17: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @print_indent_statement(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = mul i32 %0, 3
%6 = call i32 @llvm.smax.i32(i32 %5, i32 1)
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ 0, %4 ]
%9 = tail call i32 @fputc(i32 32, i32* %1)
%10 = add nuw nsw i32 %8, 1
%11 = icmp eq i32 %10, %6
br i1 %11, label %12, label %7
12: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double a, p;
  p = 3.14159;
  scanf("%lf", &a);
  printf("VOLUME = %.3lf\n", a * a * a * p * 4.0 / 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    0xed5(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xeb7(%rip),%xmm0
mulsd  0xeb7(%rip),%xmm0
divsd  0xeb7(%rip),%xmm0
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [16 x i8] c"VOLUME = %.3lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fmul double %4, %4
%6 = fmul double %4, %5
%7 = fmul double %6, 3.141590e+00
%8 = fmul double %7, 4.000000e+00
%9 = fdiv double %8, 3.000000e+00
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}
/* Variables and functions */
int fail(long double *a, long int *b) { return a == b; }


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

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

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

LLVM IR (-O2):
define i32 @fail(x86_fp80* readnone %0, i64* readnone %1) {
%3 = bitcast i64* %1 to x86_fp80*
%4 = icmp eq x86_fp80* %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int neighbourscoordinates(int xc, int yc, int retX[], int retY[]) {
  retX = NULL;
  retY = NULL;
  return 0;
}


x86 assembly (clang, -O0):
<neighbourscoordinates>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @neighbourscoordinates(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
store i32* null, i32** %7
store i32* null, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @neighbourscoordinates(i32 %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char *, int);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void mrdump_elf_setup_eident(unsigned char e_ident[16],
                             unsigned char elfclasz) {
  memcpy(e_ident, "\177ELF", 4);
  e_ident[4] = elfclasz;
  e_ident[5] = 1;
  e_ident[6] = 1;
  e_ident[7] = 0;
  memset(e_ident + 8, 0, 16 - 8);
}


x86 assembly (clang, -O0):
<mrdump_elf_setup_eident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x4(%rax)
mov    -0x8(%rbp),%rax
movb   $0x1,0x5(%rax)
mov    -0x8(%rbp),%rax
movb   $0x1,0x6(%rax)
mov    -0x8(%rbp),%rax
movb   $0x0,0x7(%rax)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrdump_elf_setup_eident>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    %bpl,0x4(%rbx)
movw   $0x101,0x5(%rbx)
movb   $0x0,0x7(%rbx)
add    $0x8,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x8,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <memset@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\7FELF\00"
define void @mrdump_elf_setup_eident(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8*, i8** %3
%6 = call i32 @memcpy(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = load i8, i8* %4
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 4
store i8 %7, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 5
store i8 1, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 6
store i8 1, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 7
store i8 0, i8* %15
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 8
%18 = call i32 @memset(i8* %17, i32 0, i32 8)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\7FELF\00"
define void @mrdump_elf_setup_eident(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %1, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 5
store i8 1, i8* %5
%6 = getelementptr inbounds i8, i8* %0, i64 6
store i8 1, i8* %6
%7 = getelementptr inbounds i8, i8* %0, i64 7
store i8 0, i8* %7
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = tail call i32 @memset(i8* %8, i32 0, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simuKimm2(int, double, int *, int *);
void simuKimm2_R_wrapper(int *nGgen, double *mutRate, int *mutants0,
                         int *mutants) {
  simuKimm2(*nGgen, *mutRate, mutants0, mutants);
}


x86 assembly (clang, -O0):
<simuKimm2_R_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <simuKimm2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simuKimm2_R_wrapper>:
mov    (%rdi),%edi
movsd  (%rsi),%xmm0
mov    %rdx,%rsi
mov    %rcx,%rdx
jmp    1030 <simuKimm2@plt>

LLVM IR (-O0):
define void @simuKimm2_R_wrapper(i32* %0, double* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store double* %1, double** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load double*, double** %6
%12 = load double, double* %11
%13 = load i32*, i32** %7
%14 = load i32*, i32** %8
%15 = call i32 @simuKimm2(i32 %10, double %12, i32* %13, i32* %14)
ret void
}

LLVM IR (-O2):
define void @simuKimm2_R_wrapper(i32* nocapture %0, double* nocapture %1, i32* %2, i32* %3) {
%5 = load i32, i32* %0
%6 = load double, double* %1
%7 = tail call i32 @simuKimm2(i32 %5, double %6, i32* %2, i32* %3)
ret void
}
char *putlogmsg(int kind) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @putlogmsg(i32 %0) {
ret i8* undef
}
int x86_cleanup(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @x86_cleanup() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t op_shr(uint32_t a, uint32_t b) { return a >> b; }


x86 assembly (clang, -O0):
<op_shr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_shr>:
mov    %esi,%ecx
mov    %edi,%eax
sar    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @op_shr(i32 %0, i32 %1) {
%3 = ashr i32 %0, %1
ret i32 %3
}
void Print_banner(char *name, char *pgm, struct job *job) {}


x86 assembly (clang, -O0):
<Print_banner>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.job = type opaque
define void @Print_banner(i8* %0, i8* %1, %struct.job* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.job*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.job* %2, %struct.job** %6
ret void
}

LLVM IR (-O2):
%struct.job = type opaque
define void @Print_banner(i8* nocapture %0, i8* nocapture %1, %struct.job* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *tmpalloc(int);
void *tmpcalloc(int size) {
  void *rv;
  rv = tmpalloc(size);
  memset(rv, 0, size);
  return rv;
}


x86 assembly (clang, -O0):
<tmpcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <tmpalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmpcalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <tmpalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @tmpcalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @tmpalloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = call i32 @memset(i8* %6, i32 0, i32 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @tmpcalloc(i32 %0) {
%2 = tail call i8* @tmpalloc(i32 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

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

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


x86 assembly (clang, -O0):
<set_XSelectionEvent_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_XSelectionEvent_display>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XSelectionEvent_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_XSelectionEvent_display(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
regx0reg1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (p0[x0]) = r1; }


x86 assembly (clang, -O0):
<regx0reg1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x8(%rbp),%dx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dx,(%rax,%rcx,2)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0reg1_set>:
movslq %edx,%rax
mov    %si,(%r8,%rax,2)
ret

LLVM IR (-O0):
define i32 @regx0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16, i16* %9
%17 = load i16*, i16** %12
%18 = load i32, i32* %10
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i16, i16* %17, i64 %19
store i16 %16, i16* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @regx0reg1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = trunc i32 %1 to i16
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i16, i16* %4, i64 %8
store i16 %7, i16* %9
ret i32 undef
}
/* Variables and functions */
int bprime(long long);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  long long int n = 600851475143;
  int prime = bprime(n);
  printf("%d\n", prime);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movabs $0x8be589eac7,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <bprime@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x8be589eac7,%rdi
call   1040 <bprime@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @bprime(i64 600851475143)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ display;
};
typedef TYPE_1__ XVisibilityEvent;

/* Variables and functions */
void *get_XVisibilityEvent_display(void *_p) {
  return (void *)((XVisibilityEvent *)_p)->display;
}


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

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

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

LLVM IR (-O2):
define i8* @get_XVisibilityEvent_display(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
double mult(double v1, double v2) { return v1 * v2; }


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

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

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

LLVM IR (-O2):
define double @mult(double %0, double %1) {
%3 = fmul double %0, %1
ret double %3
}
/* Variables and functions */
unsigned long MT_RdReg(unsigned long, unsigned long);
int /*<<< orphan*/ MT_WrReg(unsigned long, unsigned long, unsigned long);
void MT_WrRegMask(unsigned long unit, unsigned long reg, unsigned long mask,
                  unsigned long data) {
  unsigned long readVal, setData;
  readVal = MT_RdReg(unit, reg);
  setData = (readVal & (~mask)) | data;
  MT_WrReg(unit, reg, setData);
}


x86 assembly (clang, -O0):
<MT_WrRegMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <MT_RdReg@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
call   1040 <MT_WrReg@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MT_WrRegMask>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
call   1030 <MT_RdReg@plt>
not    %rbx
and    %rax,%rbx
or     %r14,%rbx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <MT_WrReg@plt>

LLVM IR (-O0):
define void @MT_WrRegMask(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = call i64 @MT_RdReg(i64 %11, i64 %12)
store i64 %13, i64* %9
%14 = load i64, i64* %9
%15 = load i64, i64* %7
%16 = xor i64 %15, -1
%17 = and i64 %14, %16
%18 = load i64, i64* %8
%19 = or i64 %17, %18
store i64 %19, i64* %10
%20 = load i64, i64* %5
%21 = load i64, i64* %6
%22 = load i64, i64* %10
%23 = call i32 @MT_WrReg(i64 %20, i64 %21, i64 %22)
ret void
}

LLVM IR (-O2):
define void @MT_WrRegMask(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 @MT_RdReg(i64 %0, i64 %1)
%6 = xor i64 %2, -1
%7 = and i64 %5, %6
%8 = or i64 %7, %3
%9 = tail call i32 @MT_WrReg(i64 %0, i64 %1, i64 %8)
ret void
}
/* Variables and functions */
int sourceB();
int /*<<< orphan*/ two_arg_sink_caller(int, int);
int caller1() {
  int a = 0;
  int b = sourceB();
  two_arg_sink_caller(a, b);
}


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

x86 assembly (clang, -O2):
<caller1>:
push   %rax
xor    %eax,%eax
call   1040 <sourceB@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <two_arg_sink_caller@plt>

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

LLVM IR (-O2):
define i32 @caller1() {
%1 = tail call i32 (...) @sourceB()
%2 = tail call i32 @two_arg_sink_caller(i32 0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ w32api_mem_free(void *);
void msvcrt_free(void *p) {
  ;
  w32api_mem_free(p);
  ;
}


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

x86 assembly (clang, -O2):
<msvcrt_free>:
jmp    1030 <w32api_mem_free@plt>

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

LLVM IR (-O2):
define void @msvcrt_free(i8* %0) {
%2 = tail call i32 @w32api_mem_free(i8* %0)
ret void
}
/* Type definitions */
struct zip_dirent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _zip_dirent_finalize(struct zip_dirent *);
int /*<<< orphan*/ free(struct zip_dirent *);
void _zip_dirent_free(struct zip_dirent *zde) {
  if (zde == NULL)
    return;
  _zip_dirent_finalize(zde);
  free(zde);
}


x86 assembly (clang, -O0):
<_zip_dirent_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <_zip_dirent_free+0x1c>
jmp    114e <_zip_dirent_free+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <_zip_dirent_finalize@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zip_dirent_free>:
test   %rdi,%rdi
je     1137 <_zip_dirent_free+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <_zip_dirent_finalize@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.zip_dirent = type { i32 }
define void @_zip_dirent_free(%struct.zip_dirent* %0) {
%2 = alloca %struct.zip_dirent*
store %struct.zip_dirent* %0, %struct.zip_dirent** %2
%3 = load %struct.zip_dirent*, %struct.zip_dirent** %2
%4 = icmp eq %struct.zip_dirent* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load %struct.zip_dirent*, %struct.zip_dirent** %2
%8 = call i32 @_zip_dirent_finalize(%struct.zip_dirent* %7)
%9 = load %struct.zip_dirent*, %struct.zip_dirent** %2
%10 = call i32 @free(%struct.zip_dirent* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.zip_dirent = type { i32 }
define void @_zip_dirent_free(%struct.zip_dirent* %0) {
%2 = icmp eq %struct.zip_dirent* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @_zip_dirent_finalize(%struct.zip_dirent* %0)
%5 = tail call i32 @free(%struct.zip_dirent* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
char read_byte();
int /*<<< orphan*/ vid_writef(char *, char);
void writestr_handler(void) {
  while (1) {
    char c = read_byte();
    if (c)
      vid_writef("%c", c);
    else
      break;
  }
}


x86 assembly (clang, -O0):
<writestr_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <read_byte@plt>
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1151 <writestr_handler+0x31>
lea    0xebd(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <vid_writef@plt>
jmp    1156 <writestr_handler+0x36>
jmp    115b <writestr_handler+0x3b>
jmp    1128 <writestr_handler+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writestr_handler>:
push   %rbx
xor    %eax,%eax
call   1030 <read_byte@plt>
test   %al,%al
je     1156 <writestr_handler+0x36>
lea    0xecd(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%esi
mov    %rbx,%rdi
call   1040 <vid_writef@plt>
xor    %eax,%eax
call   1030 <read_byte@plt>
test   %al,%al
jne    1140 <writestr_handler+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @writestr_handler() {
%1 = tail call signext i8 (...) @read_byte()
%2 = icmp eq i8 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i8 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @vid_writef(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
%6 = tail call signext i8 (...) @read_byte()
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetMotor(int /*<<< orphan*/, int);
int on_off(int seq) {
  if (seq % 20)
    SetMotor(0, 200);
  else
    SetMotor(0, 0);
  return 1;
}


x86 assembly (clang, -O0):
<on_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x14,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1140 <on_off+0x30>
xor    %edi,%edi
mov    $0xc8,%esi
call   1030 <SetMotor@plt>
jmp    1149 <on_off+0x39>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <SetMotor@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_off>:
push   %rax
imul   $0xcccccccd,%edi,%eax
add    $0x19999998,%eax
ror    $0x2,%eax
xor    %ecx,%ecx
cmp    $0xccccccd,%eax
mov    $0xc8,%esi
cmovb  %ecx,%esi
xor    %edi,%edi
call   1030 <SetMotor@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @on_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 20
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @SetMotor(i32 0, i32 200)
br label %10
8: ; preds = %1
%9 = call i32 @SetMotor(i32 0, i32 0)
br label %10
10: ; preds = %8, %6
ret i32 1
}

LLVM IR (-O2):
define i32 @on_off(i32 %0) {
%2 = srem i32 %0, 20
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 200
%5 = tail call i32 @SetMotor(i32 0, i32 %4)
ret i32 1
}
int test_imm_A2int16_reg(short val) {
  return ((val) & (0xA2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A2int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 162
%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_A2int16_reg(i16 signext %0) {
%2 = and i16 %0, 162
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *xmalloc(size_t sz) {
  void *p;
  if (!sz)
    return NULL;
  p = malloc(sz);
  if (!p)
    die("out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xmalloc+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1170 <xmalloc+0x50>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <xmalloc+0x48>
lea    0xe9d(%rip),%rdi
call   1040 <die@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
test   %rdi,%rdi
je     113e <xmalloc+0x1e>
call   1030 <malloc@plt>
test   %rax,%rax
je     1132 <xmalloc+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1040 <die@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %15, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @die(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ null, %1 ], [ null, %6 ], [ %4, %3 ]
ret i8* %9
}
/* Variables and functions */
unsigned int g2_phy_read(unsigned int, unsigned int);
void MDC_MDIO_READ(unsigned int len, unsigned int devid, unsigned int reg,
                   unsigned int *pdata) {
  *pdata = g2_phy_read(devid, reg);
}


x86 assembly (clang, -O0):
<MDC_MDIO_READ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <g2_phy_read@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MDC_MDIO_READ>:
push   %rbx
mov    %rcx,%rbx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <g2_phy_read@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @MDC_MDIO_READ(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* %6
%10 = load i32, i32* %7
%11 = call i32 @g2_phy_read(i32 %9, i32 %10)
%12 = load i32*, i32** %8
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @MDC_MDIO_READ(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @g2_phy_read(i32 %1, i32 %2)
store i32 %5, i32* %3
ret void
}
int EuclidGcd(int M, int N) {
  if (M < N) {
    int tmp = M;
    M = N;
    N = tmp;
  }
  int rem = 0;
  while (N > 0) {
    rem = M % N;
    M = N;
    N = rem;
  }
  return M;
}


x86 assembly (clang, -O0):
<EuclidGcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <EuclidGcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1154 <EuclidGcd+0x54>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112f <EuclidGcd+0x2f>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EuclidGcd>:
mov    %edi,%eax
cmp    %esi,%edi
mov    %esi,%edx
cmovl  %edi,%edx
cmovl  %esi,%eax
test   %edx,%edx
jle    111d <EuclidGcd+0x1d>
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <EuclidGcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @EuclidGcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i32 [ %9, %7 ], [ %5, %2 ]
%9 = phi i32 [ %10, %7 ], [ %4, %2 ]
%10 = srem i32 %8, %9
%11 = icmp sgt i32 %10, 0
br i1 %11, label %7, label %12
12: ; preds = %7, %2
%13 = phi i32 [ %5, %2 ], [ %9, %7 ]
ret i32 %13
}
/* Variables and functions */
int input_integer(int *);
bool input_unsigned_integer(unsigned int *n) { return input_integer((int *)n); }


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

x86 assembly (clang, -O2):
<input_unsigned_integer>:
jmp    1030 <input_integer@plt>

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

LLVM IR (-O2):
define i32 @input_unsigned_integer(i32* %0) {
%2 = tail call i32 @input_integer(i32* %0)
ret i32 %2
}
/* Variables and functions */
double sqrt(double);
double makenan(void) { return sqrt(-1.0); }


x86 assembly (clang, -O0):
<makenan>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
call   1030 <sqrt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makenan>:
movsd  0xee8(%rip),%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @makenan() {
%1 = call double @sqrt(double -1.000000e+00)
ret double %1
}

LLVM IR (-O2):
define double @makenan() {
%1 = tail call double @sqrt(double -1.000000e+00)
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *progn) {
  printf("Usage: %s [-p port] [-v] <root>\n", progn);
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Usage: %s [-p port] [-v] <root>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Usage: %s [-p port] [-v] <root>\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int one(const struct dirent *unused) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.dirent = type opaque
define i32 @one(%struct.dirent* nocapture readnone %0) {
ret i32 1
}
unsigned char nand_get_data(void) {
  return (*((volatile unsigned char *)0x70200010));
}


x86 assembly (clang, -O0):
<nand_get_data>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70200010,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_get_data>:
mov    0x70200010,%al
ret

LLVM IR (-O0):
define zeroext i8 @nand_get_data() {
%1 = load volatile i8, i8* inttoptr (i64 1881145360 to i8*)
ret i8 %1
}

LLVM IR (-O2):
define zeroext i8 @nand_get_data() {
%1 = load volatile i8, i8* inttoptr (i64 1881145360 to i8*)
ret i8 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rand();
uint8_t random_chance(uint8_t v) {
  v = v + v + (v >> 1);
  if (((rand() >> 3) & 0xFF) <= v)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<random_chance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
sar    $0x3,%eax
and    $0xff,%eax
cmp    -0x8(%rbp),%eax
jg     1150 <random_chance+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1157 <random_chance+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_chance>:
push   %rbx
mov    %edi,%eax
sar    %eax
lea    (%rax,%rdi,2),%ebx
xor    %eax,%eax
call   1030 <rand@plt>
shr    $0x3,%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
setle  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @random_chance(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = load i32, i32* %3
%8 = ashr i32 %7, 1
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = call i32 (...) @rand()
%11 = ashr i32 %10, 3
%12 = and i32 %11, 255
%13 = load i32, i32* %3
%14 = icmp sle i32 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @random_chance(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = ashr i32 %0, 1
%4 = add nsw i32 %2, %3
%5 = tail call i32 (...) @rand()
%6 = lshr i32 %5, 3
%7 = and i32 %6, 255
%8 = icmp sle i32 %7, %4
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
double str_to_num(char *);
int cmp_num(char *a, char *b) {
  double an = str_to_num(a);
  double bn = str_to_num(b);
  return an - bn;
}


x86 assembly (clang, -O0):
<cmp_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str_to_num@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <str_to_num@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_num>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <str_to_num@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <str_to_num@plt>
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @cmp_num(i8* %0, i8* %1) {
%3 = tail call double @str_to_num(i8* %0)
%4 = tail call double @str_to_num(i8* %1)
%5 = fsub double %3, %4
%6 = fptosi double %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int GLint;
typedef int GLenum;

/* Variables and functions */
#define GL_COLOR_TABLE_BIAS 129
#define GL_COLOR_TABLE_SCALE 128
__attribute__((visibility("internal"))) __attribute__((pure)) GLint
__glColorTableParameterfv_size(GLenum e) {
  switch (e) {
  case GL_COLOR_TABLE_SCALE:
  case GL_COLOR_TABLE_BIAS:
    return 4;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<__glColorTableParameterfv_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     1127 <__glColorTableParameterfv_size+0x27>
jmp    111b <__glColorTableParameterfv_size+0x1b>
movl   $0x4,-0x4(%rbp)
jmp    112e <__glColorTableParameterfv_size+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__glColorTableParameterfv_size>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x80,%edi
sete   %al
shl    $0x2,%eax
ret

LLVM IR (-O0):
define hidden i32 @__glColorTableParameterfv_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 128, label %5
i32 129, label %5
]
5: ; preds = %1, %1
store i32 4, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define hidden i32 @__glColorTableParameterfv_size(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp eq i32 %2, 128
%4 = select i1 %3, i32 4, i32 0
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void UARTRxErrorClear(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000004))) = 0;
}


x86 assembly (clang, -O0):
<UARTRxErrorClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movq   $0x0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTRxErrorClear>:
movq   $0x0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @UARTRxErrorClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
%5 = inttoptr i64 %4 to i64*
store volatile i64 0, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTRxErrorClear(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = inttoptr i64 %2 to i64*
store volatile i64 0, i64* %3
ret void
}
void wMemRemove(void *ptr) {}


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

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

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

LLVM IR (-O2):
define void @wMemRemove(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void err(char *a, ...) { fprintf(stderr, a); }


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

x86 assembly (clang, -O2):
<err>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @err(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* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @err(i8* %0, ...) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* %0)
ret void
}