xunge/DecIR huggingface dataset:
void mycalc(float a, float b, float *c) { *c = a - b; }


x86 assembly (clang, -O0):
<mycalc>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mycalc>:
subss  %xmm1,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @mycalc(float %0, float %1, float* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float*
store float %0, float* %4
store float %1, float* %5
store float* %2, float** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @mycalc(float %0, float %1, float* nocapture writeonly %2) {
%4 = fsub float %0, %1
store float %4, float* %2
ret void
}
void banner(void) {}


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

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

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

LLVM IR (-O2):
define void @banner() {
ret void
}
unsigned int strhash(void *key) {
  char *str = key;
  unsigned int hashvalue = 0;
  while (*str != 0) {
    hashvalue ^= *(unsigned int *)str;
    hashvalue <<= 1;
    str++;
  }
  return hashvalue;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <strhash+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1117 <strhash+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
cmpb   $0x0,(%rdi)
je     1123 <strhash+0x23>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    (%rdi),%ecx
xor    %ecx,%eax
add    %eax,%eax
add    $0x1,%rdi
test   $0xff00,%ecx
jne    1110 <strhash+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strhash(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
store i32 0, i32* %4
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = load i32, i32* %4
%16 = xor i32 %15, %14
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = shl i32 %17, 1
store i32 %18, i32* %4
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %6
21: ; preds = %6
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = xor i32 %8, %5
%10 = shl i32 %9, 1
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = and i32 %8, 65280
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ isfinite(double);
int main(int argc, char **argv) { isfinite(0.0); }


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @isfinite(double 0.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isfinite(double 0.000000e+00)
ret i32 0
}
void gtk_bin_get_type() {}


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

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

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

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

/* Variables and functions */
uint32_t __hsail_bitselect_u32(uint32_t src0, uint32_t src1, uint32_t src2) {
  return (src1 & src0) | (src2 & ~src0);
}


x86 assembly (clang, -O0):
<__hsail_bitselect_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hsail_bitselect_u32>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @__hsail_bitselect_u32(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
%14 = or i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @__hsail_bitselect_u32(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char *);
void usage(void) { errx(1, "Usage: %s repository", "reporead"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
lea    0xeee(%rip),%rdx
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
lea    0xef7(%rip),%rdx
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Usage: %s repository\00"
@.str.1 = [9 x i8] c"reporead\00"
define void @usage() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Usage: %s repository\00"
@.str.1 = [9 x i8] c"reporead\00"
define void @usage() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void intToByteArray(int integer, char *byteArray) {
  int i;
  for (i = 0; i < 4; ++i) {
    byteArray[i] = (char)((integer % 0xff) & 0xff);
    integer /= 0xff;
  }
}


x86 assembly (clang, -O0):
<intToByteArray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1154 <intToByteArray+0x54>
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
and    $0xff,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <intToByteArray+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToByteArray>:
movslq %edi,%rax
imul   $0xffffffff80808081,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x7,%ecx
add    %edx,%ecx
lea    (%rax,%rcx,1),%edx
mov    %dl,(%rsi)
movslq %ecx,%rcx
imul   $0xffffffff80808081,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%edi
shr    $0x1f,%edi
shr    $0x7,%edx
add    %edi,%edx
add    %ecx,%edx
mov    %dl,0x1(%rsi)
imul   $0xffffffff81018203,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0xf,%ecx
add    %edx,%ecx
movslq %ecx,%rcx
imul   $0xffffffff80808081,%rcx,%rdx
shr    $0x20,%rdx
add    %ecx,%edx
mov    %edx,%edi
shr    $0x1f,%edi
shr    $0x7,%edx
add    %edi,%edx
add    %ecx,%edx
mov    %dl,0x2(%rsi)
imul   $0x103060a1,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x34,%rax
add    %ecx,%eax
mov    %al,0x3(%rsi)
ret

LLVM IR (-O0):
define void @intToByteArray(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 = %20, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %23
9: ; preds = %6
%10 = load i32, i32* %3
%11 = srem i32 %10, 255
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 255
store i32 %19, i32* %3
br label %20
20: ; preds = %9
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %6
23: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @intToByteArray(i32 %0, i8* nocapture writeonly %1) {
%3 = srem i32 %0, 255
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = sdiv i32 %0, 255
%6 = srem i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %7, i8* %8
%9 = sdiv i32 %0, 65025
%10 = srem i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %11, i8* %12
%13 = sdiv i32 %0, 16581375
%14 = trunc i32 %13 to i8
%15 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %14, i8* %15
ret void
}
int test_imm_63int64_midword_reg(long long val) {
  return ((val >> 16) & (0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63int64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x63,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63int64_midword_reg>:
test   $0x630000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 99
%6 = icmp ne i64 %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_63int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6488064
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
void funcFB(void) { lua_error("call expression not a function"); }


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

x86 assembly (clang, -O2):
<funcFB>:
lea    0xee9(%rip),%rdi
jmp    1030 <lua_error@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"call expression not a function\00"
define void @funcFB() {
%1 = call i32 @lua_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"call expression not a function\00"
define void @funcFB() {
%1 = tail call i32 @lua_error(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_free__(void *);
void cn_cbor_free(void *cb) { __coverity_free__(cb); }


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

x86 assembly (clang, -O2):
<cn_cbor_free>:
jmp    1030 <__coverity_free__@plt>

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

LLVM IR (-O2):
define void @cn_cbor_free(i8* %0) {
%2 = tail call i32 @__coverity_free__(i8* %0)
ret void
}
int stars_cap(int rank) {
  return rank > 20 ? 2 : rank > 15 ? 3 : rank > 10 ? 4 : 5;
}


x86 assembly (clang, -O0):
<stars_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x14,-0x4(%rbp)
jle    111e <stars_cap+0x1e>
mov    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1151 <stars_cap+0x51>
cmpl   $0xf,-0x4(%rbp)
jle    1135 <stars_cap+0x35>
mov    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <stars_cap+0x4b>
mov    -0x4(%rbp),%edx
mov    $0x5,%eax
mov    $0x4,%ecx
cmp    $0xa,%edx
cmovg  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stars_cap>:
mov    $0x2,%eax
cmp    $0x14,%edi
jg     111f <stars_cap+0x1f>
mov    $0x3,%eax
cmp    $0xf,%edi
jg     111f <stars_cap+0x1f>
xor    %eax,%eax
cmp    $0xb,%edi
setge  %al
xor    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @stars_cap(i32 %0) {
%2 = icmp sgt i32 %0, 20
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 15
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 10
%7 = select i1 %6, i32 4, i32 5
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 2, %1 ], [ %7, %5 ], [ 3, %3 ]
ret i32 %9
}
__int128 fun_int128(void) { return 10; }


x86 assembly (clang, -O0):
<fun_int128>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
movq   $0xa,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_int128>:
mov    $0xa,%eax
xor    %edx,%edx
ret

LLVM IR (-O0):
define { i64, i64 } @fun_int128() {
%1 = alloca i128
store i128 10, i128* %1
%2 = bitcast i128* %1 to { i64, i64 }*
%3 = load { i64, i64 }, { i64, i64 }* %2
ret { i64, i64 } %3
}

LLVM IR (-O2):
define { i64, i64 } @fun_int128() {
ret { i64, i64 } { i64 10, i64 0 }
}
int CalculateNumberOfSpaces(int Offset, int TabSize) {
  return TabSize - (Offset % TabSize);
}


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

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

LLVM IR (-O0):
define i32 @CalculateNumberOfSpaces(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
%7 = load i32, i32* %4
%8 = srem i32 %6, %7
%9 = sub nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @CalculateNumberOfSpaces(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = sub nsw i32 %1, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void ud_dtor(void *ptr) { assert(ptr == NULL); }


x86 assembly (clang, -O0):
<ud_dtor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ud_dtor>:
xor    %eax,%eax
test   %rdi,%rdi
sete   %al
mov    %eax,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @ud_dtor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
ret void
}

LLVM IR (-O2):
define void @ud_dtor(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret void
}
void picopal_mpr_free(void **p) { *p = 0; }


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

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

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

LLVM IR (-O2):
define void @picopal_mpr_free(i8** nocapture writeonly %0) {
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ KeccakP200_OverwriteBytes(void *, unsigned char const *,
                                             unsigned int, unsigned int);
void Ket_StateOverwrite(void *state, unsigned int offset,
                        const unsigned char *data, unsigned int length) {
  KeccakP200_OverwriteBytes(state, data, offset, length);
}


x86 assembly (clang, -O0):
<Ket_StateOverwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x1c(%rbp),%ecx
call   1030 <KeccakP200_OverwriteBytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ket_StateOverwrite>:
mov    %esi,%eax
mov    %rdx,%rsi
mov    %eax,%edx
jmp    1030 <KeccakP200_OverwriteBytes@plt>

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

LLVM IR (-O2):
define void @Ket_StateOverwrite(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @KeccakP200_OverwriteBytes(i8* %0, i8* %2, i32 %1, i32 %3)
ret void
}
int is_Multiple_of(int n) {
  if (n % 3 == 0 || n % 5 == 0)
    return n;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_Multiple_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     112f <is_Multiple_of+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113a <is_Multiple_of+0x3a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <is_Multiple_of+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_Multiple_of>:
imul   $0xaaaaaaab,%edi,%ecx
add    $0x2aaaaaaa,%ecx
imul   $0xcccccccd,%edi,%edx
add    $0x19999999,%edx
xor    %eax,%eax
cmp    $0x33333333,%edx
cmovb  %edi,%eax
cmp    $0x55555555,%ecx
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @is_Multiple_of(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 5
%5 = icmp eq i32 %4, 0
%6 = or i1 %3, %5
%7 = select i1 %6, i32 %0, i32 0
ret i32 %7
}
void ff_hevc_put_hevc_qpel_v32_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_v32_10_avx2() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeEPI(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000066, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeEPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x66,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeEPI>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x66,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeEPI(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 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 102, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeEPI(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 102, i32 8)
ret void
}
void XtGetDisplays() {}


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

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

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

LLVM IR (-O2):
define void @XtGetDisplays() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void SetFree(char *s) { free(s); }


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

x86 assembly (clang, -O2):
<SetFree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @SetFree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void _tr_stored_block(void) {}


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

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

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

LLVM IR (-O2):
define void @_tr_stored_block() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void form_output_prelookup_skip_button(int form_number) {
  printf("<td><input type=\"button\" value=\"Skip\" title=\"Skip this form if "
         "you don't know exactly what you're looking for.\" "
         "onClick=\"form_reset(document.forms[%d], '%c'); "
         "document.forms[%d].submit()",
         form_number, '|', form_number);
  printf("\">\n");
}


x86 assembly (clang, -O0):
<form_output_prelookup_skip_button>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xed8(%rip),%rdi
mov    $0x7c,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_output_prelookup_skip_button>:
push   %rax
mov    %edi,%ecx
lea    0xed6(%rip),%rdi
mov    %ecx,%esi
mov    $0x7c,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf7c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [187 x i8] c"<td><input type=\22button\22 value=\22Skip\22 title=\22Skip this form if you don't know exactly what you're looking for.\22 onClick=\22form_reset(document.forms[%d], '%c'); document.forms[%d].submit()\00"
@.str.1 = [4 x i8] c"\22>\0A\00"
define void @form_output_prelookup_skip_button(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 %3, i32 124, i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [187 x i8] c"<td><input type=\22button\22 value=\22Skip\22 title=\22Skip this form if you don't know exactly what you're looking for.\22 onClick=\22form_reset(document.forms[%d], '%c'); document.forms[%d].submit()\00"
@str = [3 x i8] c"\22>\00"
define void @form_output_prelookup_skip_button(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([187 x i8], [187 x i8]* @.str, i64 0, i64 0), i32 %0, i32 124, i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ fill_style;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
int get_XGCValues_fill_style(void *_p) {
  return (int)((XGCValues *)_p)->fill_style;
}


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

x86 assembly (clang, -O2):
<get_XGCValues_fill_style>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XGCValues_fill_style(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 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XGCValues_fill_style(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_imm_F9int16_reg(short val) {
  return ((val) & (-0xF9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F9int16_reg>:
test   $0xff07,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F9int16_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, -249
%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_F9int16_reg(i16 signext %0) {
%2 = and i16 %0, -249
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void vdiff(double v1[3], double v2[3], double p[3]) {
  p[0] = v1[0] - v2[0];
  p[1] = v1[1] - v2[1];
  p[2] = v1[2] - v2[2];
}


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

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

LLVM IR (-O0):
define void @vdiff(double* %0, double* %1, double* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fsub double %9, %12
%14 = load double*, double** %6
%15 = getelementptr inbounds double, double* %14, i64 0
store double %13, double* %15
%16 = load double*, double** %4
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load double*, double** %5
%20 = getelementptr inbounds double, double* %19, i64 1
%21 = load double, double* %20
%22 = fsub double %18, %21
%23 = load double*, double** %6
%24 = getelementptr inbounds double, double* %23, i64 1
store double %22, double* %24
%25 = load double*, double** %4
%26 = getelementptr inbounds double, double* %25, i64 2
%27 = load double, double* %26
%28 = load double*, double** %5
%29 = getelementptr inbounds double, double* %28, i64 2
%30 = load double, double* %29
%31 = fsub double %27, %30
%32 = load double*, double** %6
%33 = getelementptr inbounds double, double* %32, i64 2
store double %31, double* %33
ret void
}

LLVM IR (-O2):
define void @vdiff(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fsub double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}
/* Variables and functions */
int usleep(int);
int msleep(int msec) { return usleep(1000 * msec); }


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

x86 assembly (clang, -O2):
<msleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define i32 @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 1000, %3
%5 = call i32 @usleep(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @msleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret i32 %3
}
int test_imm_20int16_mem(short *val) {
  return ((*val) & (-0x20 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_20int16_mem>:
cmpw   $0x20,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_20int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 32
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ g(int *);
int /*<<< orphan*/ link_error();
void __attribute__((no)) f(int *a) {
  int b;
  b = 1;
  g(&b);
  b = 2;
  *a = 1;
  if (b != 2)
    link_error();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <g@plt>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
cmpl   $0x2,-0xc(%rbp)
je     115e <f+0x3e>
mov    $0x0,%al
call   1040 <link_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x1,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <g@plt>
movl   $0x1,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @f(i32* nocapture writeonly %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 @g(i32* %2)
store i32 1, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *me) {
  fprintf(stderr, "Usage: %s PID_PROCESS FILE_DESCRIPTOR NEW_FILE\n", me);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: %s PID_PROCESS FILE_DESCRIPTOR NEW_FILE\0A\00"
define void @usage(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 ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: %s PID_PROCESS FILE_DESCRIPTOR NEW_FILE\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int leap_year(long year) {
  int lyear;
  if (((!(year % 4)) && (year % 100)) || (!(year % 400)))
    lyear = 1;
  else
    lyear = 0;
  return (lyear);
}


x86 assembly (clang, -O0):
<leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1138 <leap_year+0x38>
mov    -0x8(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1150 <leap_year+0x50>
mov    -0x8(%rbp),%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    115c <leap_year+0x5c>
movl   $0x1,-0xc(%rbp)
jmp    1163 <leap_year+0x63>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leap_year>:
test   $0x3,%dil
sete   %al
movabs $0x8f5c28f5c28f5c29,%rcx
28 5c 8f
imul   %rdi,%rcx
movabs $0x51eb851eb851eb8,%rdx
b8 1e 05
add    %rcx,%rdx
ror    $0x2,%rdx
movabs $0x28f5c28f5c28f5c,%rsi
5c 8f 02
cmp    %rsi,%rdx
seta   %dl
and    %al,%dl
movabs $0x51eb851eb851eb0,%rax
b8 1e 05
add    %rcx,%rax
ror    $0x4,%rax
movabs $0xa3d70a3d70a3d7,%rcx
cmp    %rcx,%rax
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @leap_year(i64 %0) {
%2 = and i64 %0, 3
%3 = icmp eq i64 %2, 0
%4 = srem i64 %0, 100
%5 = icmp ne i64 %4, 0
%6 = and i1 %3, %5
%7 = srem i64 %0, 400
%8 = icmp eq i64 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
int execute_mkdirat() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_mkdirat() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t fake_shift_needed(uint16_t scan) {
  switch (scan) {
  case 0x147:
  case 0x148:
  case 0x149:
  case 0x14a:
  case 0x14b:
  case 0x14d:
  case 0x14f:
  case 0x150:
  case 0x151:
  case 0x152:
  case 0x153:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<fake_shift_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffeb9,%eax
sub    $0x5,%eax
jb     1149 <fake_shift_needed+0x49>
jmp    1120 <fake_shift_needed+0x20>
mov    -0xc(%rbp),%eax
sub    $0x14d,%eax
je     1149 <fake_shift_needed+0x49>
jmp    1133 <fake_shift_needed+0x33>
mov    -0xc(%rbp),%eax
add    $0xfffffeb1,%eax
sub    $0x4,%eax
ja     1155 <fake_shift_needed+0x55>
jmp    1149 <fake_shift_needed+0x49>
movl   $0x1,-0x4(%rbp)
jmp    115c <fake_shift_needed+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fake_shift_needed>:
add    $0xfffffeb9,%edi
xor    %eax,%eax
cmp    $0xc,%edi
ja     111a <fake_shift_needed+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @fake_shift_needed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 327, label %5
i32 328, label %5
i32 329, label %5
i32 330, label %5
i32 331, label %5
i32 333, label %5
i32 335, label %5
i32 336, label %5
i32 337, label %5
i32 338, label %5
i32 339, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, 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):
@switch.table.fake_shift_needed = [13 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 1, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @fake_shift_needed(i32 %0) {
%2 = add i32 %0, -327
%3 = icmp ult i32 %2, 13
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [13 x i32], [13 x i32]* @switch.table.fake_shift_needed, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_remove_autoload_by_name() {
  printf("NOT IMPLEMENTED:"
         "pa_context_remove_autoload_by_name"
         "\n");
}


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

x86 assembly (clang, -O2):
<pa_context_remove_autoload_by_name>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"NOT IMPLEMENTED:pa_context_remove_autoload_by_name\0A\00"
define i32 @pa_context_remove_autoload_by_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [51 x i8] c"NOT IMPLEMENTED:pa_context_remove_autoload_by_name\00"
define i32 @pa_context_remove_autoload_by_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ trb16(int /*<<< orphan*/);
int /*<<< orphan*/ zeropage();
void trbZp16(void) { trb16(zeropage()); }


x86 assembly (clang, -O0):
<trbZp16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <zeropage@plt>
mov    %eax,%edi
call   1040 <trb16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trbZp16>:
push   %rax
xor    %eax,%eax
call   1030 <zeropage@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <trb16@plt>

LLVM IR (-O0):
define void @trbZp16() {
%1 = call i32 (...) @zeropage()
%2 = call i32 @trb16(i32 %1)
ret void
}

LLVM IR (-O2):
define void @trbZp16() {
%1 = tail call i32 (...) @zeropage()
%2 = tail call i32 @trb16(i32 %1)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void pp_timeval(struct timeval *tv) {
  double epoch = tv->tv_sec + tv->tv_usec * 1E-6;
  printf("%f", epoch);
}


x86 assembly (clang, -O0):
<pp_timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm0
movsd  0xecb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pp_timeval>:
cvtsi2sdl (%rdi),%xmm1
cvtsi2sdl 0x4(%rdi),%xmm0
mulsd  0xedf(%rip),%xmm0
addsd  %xmm1,%xmm0
lea    0xedc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
@.str = [3 x i8] c"%f\00"
define void @pp_timeval(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
%3 = alloca double
store %struct.timeval* %0, %struct.timeval** %2
%4 = load %struct.timeval*, %struct.timeval** %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = load %struct.timeval*, %struct.timeval** %2
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double %11, double 0x3EB0C6F7A0B5ED8D, double %7)
store double %12, double* %3
%13 = load double, double* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %13)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
@.str = [3 x i8] c"%f\00"
define void @pp_timeval(%struct.timeval* nocapture %0) {
%2 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %4)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
void proc(char msg[]) {
  msg = realloc(msg, 11);
  strcpy(msg, "xxxxxxxxxx");
  printf("\nin proc ======\n%s\n", msg);
}


x86 assembly (clang, -O0):
<proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xb,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc>:
push   %rbx
mov    $0xb,%esi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"xxxxxxxxxx\00"
@.str.1 = [20 x i8] c"\0Ain proc ======\0A%s\0A\00"
define void @proc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @realloc(i8* %3, i32 11)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"xxxxxxxxxx\00"
@.str.1 = [20 x i8] c"\0Ain proc ======\0A%s\0A\00"
define void @proc(i8* %0) {
%2 = tail call i8* @realloc(i8* %0, i32 11)
%3 = tail call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
void caller_1_1_1_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_2_2_2_1() {
ret void
}
int main(argc, argv)
int argc;
char **argv;
{
  int ret = process_all(argc, argv);
  close_all();
  return ret;
}


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <process_all@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <close_all@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <process_all@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <close_all@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @process_all to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
%4 = tail call i32 (...) @close_all()
ret i32 %3
}
int sum(int x) {
  if (x <= 0)
    return 0;
  return x + sum(x - 1);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <sum+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <sum+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
test   %edi,%edi
jle    1119 <sum+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}