xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ callee(int);
int main(void) {
  int x = 3;
  int y = 2;
  int z = x + y;
  callee(1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <callee@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @callee(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *myfopen(char *f) { return fopen(f, "a"); }


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

x86 assembly (clang, -O2):
<myfopen>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
define noalias i32* @myfopen(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ tommy_hash_u32(int /*<<< orphan*/, void *, int);
void *tommy_hashlin_search(void *, void *, void *, int /*<<< orphan*/);
void *find_hash_table(void *ht, void *key, int key_len, void *compare) {
  return tommy_hashlin_search(ht, compare, key,
                              tommy_hash_u32(0, key, key_len));
}


x86 assembly (clang, -O0):
<find_hash_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %edi,%edi
call   1040 <tommy_hash_u32@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
call   1030 <tommy_hashlin_search@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_hash_table>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
xor    %edi,%edi
call   1040 <tommy_hash_u32@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <tommy_hashlin_search@plt>

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

LLVM IR (-O2):
define i8* @find_hash_table(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @tommy_hash_u32(i32 0, i8* %1, i32 %2)
%6 = tail call i8* @tommy_hashlin_search(i8* %0, i8* %3, i8* %1, i32 %5)
ret i8* %6
}
/* Variables and functions */
float pow(float const, float const);
float pprz_isa_ref_pressure_of_height_full(float pressure, float height) {
  const float Trel = 1.0 - 0.0065 * height / 288.15;
  const float expo = 9.80665 * 0.0289644 / 8.31447 / 0.0065;
  return pressure / pow(Trel, expo);
}


x86 assembly (clang, -O0):
<pprz_isa_ref_pressure_of_height_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xed1(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xea0(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xe84(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pprz_isa_ref_pressure_of_height_full>:
push   %rax
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mulsd  0xeda(%rip),%xmm0
divsd  0xeda(%rip),%xmm0
addsd  0xeda(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  0xed6(%rip),%xmm1
call   1030 <pow@plt>
movss  0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @pprz_isa_ref_pressure_of_height_full(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fmul double 0x3F7A9FBE76C8B439, %8
%10 = fdiv double %9, 2.881500e+02
%11 = fsub double 1.000000e+00, %10
%12 = fptrunc double %11 to float
store float %12, float* %5
store float 0x401505EB80000000, float* %6
%13 = load float, float* %3
%14 = load float, float* %5
%15 = call float @pow(float %14, float 0x401505EB80000000)
%16 = fdiv float %13, %15
ret float %16
}

LLVM IR (-O2):
define float @pprz_isa_ref_pressure_of_height_full(float %0, float %1) {
%3 = fpext float %1 to double
%4 = fmul double %3, 0x3F7A9FBE76C8B439
%5 = fdiv double %4, 2.881500e+02
%6 = fsub double 1.000000e+00, %5
%7 = fptrunc double %6 to float
%8 = tail call float @pow(float %7, float 0x401505EB80000000)
%9 = fdiv float %0, %8
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ some_function();
int main(int argc, char **argv) {
  some_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @some_function()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t __raw_readl(void *ptr) {
  ;
  return *((uint32_t *)ptr);
}


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

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

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

LLVM IR (-O2):
define i32 @__raw_readl(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "XMAsh "
          "0.8"
          " - decrypt, demux, and rebuild FSB, Wwise .bnk, RIFF XMA2\n");
  fprintf(stderr, "usage:\n"
                  "  "
                  "xmash"
                  " input.fsb.xen [-o dir]\n"
                  "  "
                  "xmash"
                  " input.fsb [-o dir]\n"
                  "  "
                  "xmash"
                  " input.xma [-o dir]\n"
                  "  "
                  "xmash"
                  " input.bnk [-o dir]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xefb(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf05(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [68 x i8] c"XMAsh 0.8 - decrypt, demux, and rebuild FSB, Wwise .bnk, RIFF XMA2\0A\00"
@.str.1 = [120 x i8] c"usage:\0A xmash input.fsb.xen [-o dir]\0A xmash input.fsb [-o dir]\0A xmash input.xma [-o dir]\0A xmash input.bnk [-o dir]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [68 x i8] c"XMAsh 0.8 - decrypt, demux, and rebuild FSB, Wwise .bnk, RIFF XMA2\0A\00"
@.str.1 = [120 x i8] c"usage:\0A xmash input.fsb.xen [-o dir]\0A xmash input.fsb [-o dir]\0A xmash input.xma [-o dir]\0A xmash input.bnk [-o dir]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([120 x i8], [120 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ GLshort;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord3s(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void TexCoord3s(GLshort s, GLshort t, GLshort r) { glTexCoord3s(s, t, r); }


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

x86 assembly (clang, -O2):
<TexCoord3s>:
jmp    1030 <glTexCoord3s@plt>

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

LLVM IR (-O2):
define void @TexCoord3s(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glTexCoord3s(i32 %0, i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t max(uint64_t a, uint64_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @max(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int foo2(int);
int foo1(int a1) {
  int b1 = 2;
  return foo2(a1 + b1);
}


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

x86 assembly (clang, -O2):
<foo1>:
add    $0x2,%edi
jmp    1030 <foo2@plt>

LLVM IR (-O0):
define i32 @foo1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %4, %5
%7 = call i32 @foo2(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo1(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = tail call i32 @foo2(i32 %2)
ret i32 %3
}
int strcmp(const char *str1, const char *str2) {
  while (*str1 && *str1 == *str2) {
    str1++;
    str2++;
  }
  return *str1 - *str2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movsbl %al,%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %13, %16
br label %18
18: ; preds = %10, %5
%19 = phi i1 [ false, %5 ], [ %17, %10 ]
br i1 %19, label %20, label %25
20: ; preds = %18
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %3
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %5
25: ; preds = %18
%26 = load i8*, i8** %3
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i8*, i8** %4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %28, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = sext i8 %18 to i32
%20 = load i8, i8* %17
%21 = sext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ vowelcounter(char *, int *);
int main() {
  char s1[20];
  int syll;
  printf("Please enter a string > ");
  fgets(s1, 20 - 1, stdin);
  vowelcounter(s1, &syll);
  printf("The number of syllables is %d.\n", syll);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
mov    $0x13,%esi
call   1050 <fgets@plt>
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1040 <vowelcounter@plt>
mov    -0x24(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x13,%esi
call   1050 <fgets@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <vowelcounter@plt>
mov    0xc(%rsp),%esi
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Please enter a string > \00"
@stdin = global i32 0
@.str.1 = [32 x i8] c"The number of syllables is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 19, i32 %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%9 = call i32 @vowelcounter(i8* %8, i32* %3)
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Please enter a string > \00"
@stdin = global i32 0
@.str.1 = [32 x i8] c"The number of syllables is %d.\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %3, i32 19, i32 %6)
%8 = call i32 @vowelcounter(i8* %3, i32* %2)
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
int chr2deg(int character) {
  if (character >= 0x4B && character <= 0xFF)
    return (character - 90 - 0x4B);
  else
    return -91;
}


x86 assembly (clang, -O0):
<chr2deg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x4b,-0x8(%rbp)
jl     112f <chr2deg+0x2f>
cmpl   $0xff,-0x8(%rbp)
jg     112f <chr2deg+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x5a,%eax
sub    $0x4b,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <chr2deg+0x36>
movl   $0xffffffa5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chr2deg>:
lea    -0x4b(%rdi),%eax
lea    -0xa5(%rdi),%ecx
cmp    $0xb5,%eax
mov    $0xffffffa5,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @chr2deg(i32 %0) {
%2 = add i32 %0, -75
%3 = icmp ult i32 %2, 181
%4 = add nsw i32 %0, -165
%5 = select i1 %3, i32 %4, i32 -91
ret i32 %5
}
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "Campos Verdes";
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <corta_string@plt>
lea    0xeda(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Campos Verdes\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @corta_string(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
char editorReadKey();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void editorProcessKeypress() {
  char c = editorReadKey();
  switch (c) {
  case (('q') & 0x1f):
    write(STDOUT_FILENO, "\x1b[2J", 4);
    write(STDOUT_FILENO, "\x1bH", 3);
    exit(0);
    break;
  }
}


x86 assembly (clang, -O0):
<editorProcessKeypress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <editorReadKey@plt>
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
sub    $0x11,%al
jne    118d <editorProcessKeypress+0x5d>
jmp    1152 <editorProcessKeypress+0x22>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<editorProcessKeypress>:
push   %rbx
xor    %eax,%eax
call   1040 <editorReadKey@plt>
cmp    $0x11,%al
je     113e <editorProcessKeypress+0xe>
pop    %rbx
ret
mov    0x2eab(%rip),%rbx
mov    (%rbx),%edi
lea    0xeb2(%rip),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    (%rbx),%edi
lea    0xea4(%rip),%rsi
mov    $0x3,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [3 x i8] c"\1BH\00"
define void @editorProcessKeypress() {
%1 = alloca i8
%2 = call signext i8 (...) @editorReadKey()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
switch i32 %4, label %11 [
i32 17, label %5
]
5: ; preds = %0
%6 = load i32, i32* @STDOUT_FILENO
%7 = call i32 @write(i32 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%8 = load i32, i32* @STDOUT_FILENO
%9 = call i32 @write(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 3)
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %0
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [3 x i8] c"\1BH\00"
define void @editorProcessKeypress() {
%1 = tail call signext i8 (...) @editorReadKey()
%2 = icmp eq i8 %1, 17
br i1 %2, label %3, label %9
3: ; preds = %0
%4 = load i32, i32* @STDOUT_FILENO
%5 = tail call i32 @write(i32 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = load i32, i32* @STDOUT_FILENO
%7 = tail call i32 @write(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 3)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ go_south_east(int *, int *);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int lat = 32;
  int lng = -64;
  go_south_east(&lat, &lng);
  printf("Стоп! Теперь наши координаты: [%i, %i]\n", lat, lng);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
movl   $0xffffffc0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <go_south_east@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x20,0x4(%rsp)
movl   $0xffffffc0,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <go_south_east@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [64 x i8] c"\D0\A1\D1\82\D0\BE\D0\BF! \D0\A2\D0\B5\D0\BF\D0\B5\D1\80\D1\8C \D0\BD\D0\B0\D1\88\D0\B8 \D0\BA\D0\BE\D0\BE\D1\80\D0\B4\D0\B8\D0\BD\D0\B0\D1\82\D1\8B: [%i, %i]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 32, i32* %2
store i32 -64, i32* %3
%4 = call i32 @go_south_east(i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [64 x i8] c"\D0\A1\D1\82\D0\BE\D0\BF! \D0\A2\D0\B5\D0\BF\D0\B5\D1\80\D1\8C \D0\BD\D0\B0\D1\88\D0\B8 \D0\BA\D0\BE\D0\BE\D1\80\D0\B4\D0\B8\D0\BD\D0\B0\D1\82\D1\8B: [%i, %i]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 32, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 -64, i32* %2
%5 = call i32 @go_south_east(i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
ret i32 0
}
/* Variables and functions */
bool update_values(int *width, int *height) {
  *width = 10;
  *height = 19;
  return true;
}


x86 assembly (clang, -O0):
<update_values>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xa,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x13,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_values>:
movl   $0xa,(%rdi)
movl   $0x13,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @update_values(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
store i32 10, i32* %5
%6 = load i32*, i32** %4
store i32 19, i32* %6
ret i32 1
}

LLVM IR (-O2):
define i32 @update_values(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
store i32 10, i32* %0
store i32 19, i32* %1
ret i32 1
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_network_link_get_wildcard_domain(int ifindex) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_link_get_wildcard_domain>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_link_get_wildcard_domain>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_link_get_wildcard_domain(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_link_get_wildcard_domain(i32 %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
int with_runpath(int par) { return par / 4; }


x86 assembly (clang, -O0):
<with_runpath>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<with_runpath>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @with_runpath(i32 %0) {
%2 = sdiv i32 %0, 4
ret i32 %2
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int EINVAL;
int pthread_attr_getschedparam(const pthread_attr_t *attr,
                               struct sched_param *param) {
  (void)attr;
  (void)param;
  return EINVAL;
}


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

x86 assembly (clang, -O2):
<pthread_attr_getschedparam>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@EINVAL = global i32 0
define i32 @pthread_attr_getschedparam(i32* %0, %struct.sched_param* %1) {
%3 = alloca i32*
%4 = alloca %struct.sched_param*
store i32* %0, i32** %3
store %struct.sched_param* %1, %struct.sched_param** %4
%5 = load i32*, i32** %3
%6 = load %struct.sched_param*, %struct.sched_param** %4
%7 = load i32, i32* @EINVAL
ret i32 %7
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@EINVAL = global i32 0
define i32 @pthread_attr_getschedparam(i32* nocapture readnone %0, %struct.sched_param* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
ret i32 %3
}
void vdp_disable_line_window(void) {}


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

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

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

LLVM IR (-O2):
define void @vdp_disable_line_window() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LBA_REG_WRITE(void *, int, int);
int gemini_util_stop(void *phys_addr) {
  LBA_REG_WRITE(phys_addr, 0x0500, 0x0);
  return 0;
}


x86 assembly (clang, -O0):
<gemini_util_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x500,%esi
xor    %edx,%edx
call   1030 <LBA_REG_WRITE@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gemini_util_stop>:
push   %rax
mov    $0x500,%esi
xor    %edx,%edx
call   1030 <LBA_REG_WRITE@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ border_pixel;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
unsigned long get_XSetWindowAttributes_border_pixel(void *_p) {
  return (unsigned long)((XSetWindowAttributes *)_p)->border_pixel;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XSetWindowAttributes_border_pixel(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
void testClosureLLDLLrV(void (*closure)(long long, double, long long),
                        long long a1, double a2, long long a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureLLDLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rsi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLDLLrV>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureLLDLLrV(void (i64, double, i64)* %0, i64 %1, double %2, i64 %3) {
%5 = alloca void (i64, double, i64)*
%6 = alloca i64
%7 = alloca double
%8 = alloca i64
store void (i64, double, i64)* %0, void (i64, double, i64)** %5
store i64 %1, i64* %6
store double %2, double* %7
store i64 %3, i64* %8
%9 = load void (i64, double, i64)*, void (i64, double, i64)** %5
%10 = load i64, i64* %6
%11 = load double, double* %7
%12 = load i64, i64* %8
ret void
}

LLVM IR (-O2):
define void @testClosureLLDLLrV(void (i64, double, i64)* nocapture %0, i64 %1, double %2, i64 %3) {
tail call void %0(i64 %1, double %2, i64 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void wl_shell_surface_send_ping(struct wl_resource *resource_,
                                uint32_t serial) {
  wl_resource_post_event(resource_, 0, serial);
}


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

x86 assembly (clang, -O2):
<wl_shell_surface_send_ping>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_shell_surface_send_ping(%struct.wl_resource* %0, i32 %1) {
%3 = alloca %struct.wl_resource*
%4 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %3
store i32 %1, i32* %4
%5 = load %struct.wl_resource*, %struct.wl_resource** %3
%6 = load i32, i32* %4
%7 = call i32 @wl_resource_post_event(%struct.wl_resource* %5, i32 0, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_shell_surface_send_ping(%struct.wl_resource* %0, i32 %1) {
%3 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 0, i32 %1)
ret void
}
/* Variables and functions */
int f_int_int(int);
int /*<<< orphan*/ f_void_int(int);
int /*<<< orphan*/ printf(char *);
int foo(int abc) {
  printf("foobar baz\n");
  {
    int abc = 0;
    f_void_int(abc);
  }
  return f_int_int(abc);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f_void_int@plt>
mov    -0x4(%rbp),%edi
call   1050 <f_int_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <f_void_int@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <f_int_int@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"foobar baz\0A\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @f_void_int(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @f_int_int(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@str = [11 x i8] c"foobar baz\00"
define i32 @foo(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @f_void_int(i32 0)
%4 = tail call i32 @f_int_int(i32 %0)
ret i32 %4
}
/* Variables and functions */
unsigned int atoi(char *);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char *argv[]) {
  unsigned int seconds = atoi(argv[1]);
  unsigned int microseconds = atoi(argv[2]);
  unsigned int seed = (microseconds ^ (seconds << 20)) & 0xffffffff;
  printf("Seed: %u\n", seed);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x14,%ecx
xor    %ecx,%eax
and    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
shl    $0x14,%ebp
xor    %eax,%ebp
lea    0xeba(%rip),%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Seed: %u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %5
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = shl i32 %17, 20
%19 = xor i32 %16, %18
%20 = and i32 %19, -1
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"Seed: %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = shl i32 %5, 20
%10 = xor i32 %8, %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
struct ptp_clock_caps {
  int max_adj;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
scalar_t__ phc_get_caps(int /*<<< orphan*/, struct ptp_clock_caps *);
int phc_max_adj(clockid_t clkid) {
  int max;
  struct ptp_clock_caps caps;
  if (phc_get_caps(clkid, &caps))
    return 0;
  max = caps.max_adj;
  if ((sizeof(long) * 8) == 32 && max > 32767999)
    max = 32767999;
  return max;
}


x86 assembly (clang, -O0):
<phc_max_adj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <phc_get_caps@plt>
cmp    $0x0,%rax
je     113d <phc_max_adj+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1149 <phc_max_adj+0x39>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phc_max_adj>:
push   %rax
mov    %rsp,%rsi
call   1030 <phc_get_caps@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    1126 <phc_max_adj+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.ptp_clock_caps = type { i32 }
define i32 @phc_max_adj(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.ptp_clock_caps
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @phc_get_caps(i32 %6, %struct.ptp_clock_caps* %5)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %14
10: ; preds = %1
%11 = getelementptr inbounds %struct.ptp_clock_caps, %struct.ptp_clock_caps* %5, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.ptp_clock_caps = type { i32 }
define i32 @phc_max_adj(i32 %0) {
%2 = alloca %struct.ptp_clock_caps
%3 = bitcast %struct.ptp_clock_caps* %2 to i8*
%4 = call i64 @phc_get_caps(i32 %0, %struct.ptp_clock_caps* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.ptp_clock_caps, %struct.ptp_clock_caps* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 0
ret i32 %8
}
/* Variables and functions */
size_t next_prev_power_2(size_t);
size_t prev_power_2(size_t x) {
  if (x & (x - 1)) {
    x = next_prev_power_2(x);
    x = ((x >> 1) + 1);
  }
  return x;
}


x86 assembly (clang, -O0):
<prev_power_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1152 <prev_power_2+0x42>
mov    -0x8(%rbp),%rdi
call   1030 <next_prev_power_2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prev_power_2>:
mov    %rdi,%rax
lea    -0x1(%rdi),%rcx
test   %rcx,%rdi
je     1130 <prev_power_2+0x20>
push   %rax
mov    %rax,%rdi
call   1030 <next_prev_power_2@plt>
shr    %rax
add    $0x1,%rax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i64 @prev_power_2(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = icmp ult i64 %2, 2
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @next_prev_power_2(i64 %0)
%6 = lshr i64 %5, 1
%7 = add nuw i64 %6, 1
br label %8
8: ; preds = %4, %1
%9 = phi i64 [ %7, %4 ], [ %0, %1 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ system(char *);
int main(int argc, char **argv) {
  int i;
  for (i = 3; i < 1024; i++) {
    close(i);
  }
  if (argc > 1) {
    system(argv[1]);
  }
}


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)
movl   $0x3,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1160 <main+0x40>
mov    -0x14(%rbp),%edi
call   1040 <close@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
cmpl   $0x1,-0x8(%rbp)
jle    1177 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x3,%ebx
xchg   %ax,%ax
mov    %ebx,%edi
call   1040 <close@plt>
add    $0x1,%ebx
cmp    $0x400,%ebx
jne    1130 <main+0x10>
cmp    $0x2,%ebp
jl     1150 <main+0x30>
mov    0x8(%r14),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
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
store i32 3, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 1024
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 1
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @system(i8* %22)
br label %24
24: ; preds = %19, %16
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 3, %2 ], [ %6, %3 ]
%5 = tail call i32 @close(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 1024
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %14
10: ; preds = %8
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @system(i8* %12)
br label %14
14: ; preds = %10, %8
ret i32 0
}
unsigned char gf4_inv(unsigned char a) { return a ^ (a >> 1); }


x86 assembly (clang, -O0):
<gf4_inv>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x1(%rbp),%ecx
sar    $0x1,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf4_inv>:
mov    %edi,%eax
shr    %al
xor    %dil,%al
ret

LLVM IR (-O0):
define zeroext i8 @gf4_inv(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 1
%8 = xor i32 %4, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @gf4_inv(i8 zeroext %0) {
%2 = lshr i8 %0, 1
%3 = xor i8 %2, %0
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void my_putchar(FILE *f, int c) { fputc(c, f); }


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

x86 assembly (clang, -O2):
<my_putchar>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @my_putchar(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 = call i32 @fputc(i32 %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @my_putchar(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fputc(i32 %1, i32* %0)
ret void
}
void pipeto_finish(struct folder *fptr) {}


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

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

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

LLVM IR (-O2):
%struct.folder = type opaque
define void @pipeto_finish(%struct.folder* nocapture %0) {
ret void
}