xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ name;

/* Variables and functions */
int /*<<< orphan*/ call_back_(float *, char *, int);
int /*<<< orphan*/ commons_();
int /*<<< orphan*/ fill_common();
int main() {
  float a = 3.14159;
  char name[] = "Wrapper";
  int size;
  fill_common();
  commons_();
  size = sizeof(name) / sizeof(char);
  call_back_(&a, name, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fill_common@plt>
mov    $0x0,%al
call   1030 <commons_@plt>
movl   $0x8,-0x14(%rbp)
lea    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x8(%rbp),%rdi
call   1040 <call_back_@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x40490fd0,0xc(%rsp)
40
movabs $0x72657070617257,%rax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
call   1050 <fill_common@plt>
xor    %eax,%eax
call   1030 <commons_@plt>
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x8,%edx
call   1040 <call_back_@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.name = [8 x i8] c"Wrapper\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca [8 x i8]
%4 = alloca i32
store i32 0, i32* %1
store float 0x400921FA00000000, float* %2
%5 = bitcast [8 x i8]* %3 to i8*
%6 = call i32 (...) @fill_common()
%7 = call i32 (...) @commons_()
store i32 8, i32* %4
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 @call_back_(float* %2, i8* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca float
%2 = alloca i64
%3 = bitcast float* %1 to i8*
store float 0x400921FA00000000, float* %1
%4 = bitcast i64* %2 to i8*
store i64 32199680941191767, i64* %2
%5 = tail call i32 (...) @fill_common()
%6 = tail call i32 (...) @commons_()
%7 = call i32 @call_back_(float* %1, i8* %4, i32 8)
ret i32 0
}
int find(int n, int parent[], int i) {
  while (parent[i] >= 0)
    i = parent[i];
  return (i);
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jl     1133 <find+0x33>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
jmp    110e <find+0xe>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
mov    %edx,%eax
movslq %edx,%rcx
mov    (%rsi,%rcx,4),%edx
test   %edx,%edx
jns    1100 <find>
ret

LLVM IR (-O0):
define i32 @find(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
br label %7
7: ; preds = %14, %3
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %20
14: ; preds = %7
%15 = load i32*, i32** %5
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
%19 = load i32, i32* %18
store i32 %19, i32* %6
br label %7
20: ; preds = %7
%21 = load i32, i32* %6
ret i32 %21
}

LLVM IR (-O2):
define i32 @find(i32 %0, i32* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ %2, %3 ], [ %8, %4 ]
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, -1
br i1 %9, label %4, label %10
10: ; preds = %4
ret i32 %5
}
/* Variables and functions */
size_t dt_char_span(unsigned char const *, size_t, unsigned char);
size_t dt_char_skip(const unsigned char **src, size_t len, unsigned char mask) {
  *src += len = dt_char_span(*src, len, mask);
  return len;
}


x86 assembly (clang, -O0):
<dt_char_skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
movzbl -0x11(%rbp),%edx
call   1030 <dt_char_span@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dt_char_skip>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <dt_char_span@plt>
add    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define i64 @dt_char_skip(i8** %0, i64 %1, i8 zeroext %2) {
%4 = alloca i8**
%5 = alloca i64
%6 = alloca i8
store i8** %0, i8*** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = load i64, i64* %5
%10 = load i8, i8* %6
%11 = call i64 @dt_char_span(i8* %8, i64 %9, i8 zeroext %10)
store i64 %11, i64* %5
%12 = load i8**, i8*** %4
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i8, i8* %13, i64 %11
store i8* %14, i8** %12
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @dt_char_skip(i8** nocapture %0, i64 %1, i8 zeroext %2) {
%4 = load i8*, i8** %0
%5 = tail call i64 @dt_char_span(i8* %4, i64 %1, i8 zeroext %2)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 %5
store i8* %7, i8** %0
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *, int, float);
int /*<<< orphan*/ stderr;
int make_thumbnail(const char *input, const char *output, int height,
                   float aspect) {
  fprintf(stderr,
          "make_thumbnail(\"%s\", \"%s\", %d, %f): Not implemented yet.\n",
          input, output, height, aspect);
  return 1;
}


x86 assembly (clang, -O0):
<make_thumbnail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movss  %xmm0,-0x18(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
movss  -0x18(%rbp),%xmm0
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_thumbnail>:
push   %rax
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
lea    0xed6(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"make_thumbnail(\22%s\22, \22%s\22, %d, %f): Not implemented yet.\0A\00"
define i32 @make_thumbnail(i8* %0, i8* %1, i32 %2, float %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca float
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store float %3, float* %8
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load float, float* %8
%14 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11, i32 %12, float %13)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"make_thumbnail(\22%s\22, \22%s\22, %d, %f): Not implemented yet.\0A\00"
define i32 @make_thumbnail(i8* %0, i8* %1, i32 %2, float %3) {
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2, float %3)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int hdr_test();
int /*<<< orphan*/ start_file(int /*<<< orphan*/ *);
int stbi_hdr_test_file(FILE *f) {
  int r, n = ftell(f);
  start_file(f);
  r = hdr_test();
  fseek(f, n, SEEK_SET);
  return r;
}


x86 assembly (clang, -O0):
<stbi_hdr_test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <start_file@plt>
mov    $0x0,%al
call   1060 <hdr_test@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    0x2e67(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi_hdr_test_file>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <ftell@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <start_file@plt>
xor    %eax,%eax
call   1060 <hdr_test@plt>
mov    %eax,%ebp
mov    0x2e79(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14d,%esi
call   1050 <fseek@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i32 @stbi_hdr_test_file(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @ftell(i32* %5)
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = call i32 @start_file(i32* %7)
%9 = call i32 (...) @hdr_test()
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %4
%12 = load i32, i32* @SEEK_SET
%13 = call i32 @fseek(i32* %10, i32 %11, i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @stbi_hdr_test_file(i32* %0) {
%2 = tail call i32 @ftell(i32* %0)
%3 = tail call i32 @start_file(i32* %0)
%4 = tail call i32 (...) @hdr_test()
%5 = load i32, i32* @SEEK_SET
%6 = tail call i32 @fseek(i32* %0, i32 %2, i32 %5)
ret i32 %4
}
/* Variables and functions */
scalar_t__ sqrt(float const);
float mvVecLength2(const float *v) {
  return (float)sqrt((v[0] * v[0]) + (v[1] * v[1]));
}


x86 assembly (clang, -O0):
<mvVecLength2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecLength2>:
push   %rax
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mvVecLength2(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = call i64 @sqrt(float %16)
%18 = sitofp i64 %17 to float
ret float %18
}

LLVM IR (-O2):
define float @mvVecLength2(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = tail call i64 @sqrt(float %6)
%8 = sitofp i64 %7 to float
ret float %8
}
int test_imm_66int8_mem(signed char *val) {
  return ((*val) & (-0x66 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_66int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -102
%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_66int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -102
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((section(".boottext"))) void dummy_int(void) {}


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

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

LLVM IR (-O0):
define void @dummy_int() section ".boottext" {
ret void
}

LLVM IR (-O2):
define void @dummy_int() section ".boottext" {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cnfImpn(char *const, int, int, char *);
int emsGtune(char *, int *const);
void ems_gtune_(char *const key, int *const value, int *const status,
                int key_length) {
  char ckey[6 + 1];

  cnfImpn(key, key_length, 6, ckey);
  *value = emsGtune(ckey, status);
  return;
}


x86 assembly (clang, -O0):
<ems_gtune_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
lea    -0x23(%rbp),%rcx
mov    $0x6,%edx
call   1030 <cnfImpn@plt>
lea    -0x23(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <emsGtune@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ems_gtune_>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
lea    0x9(%rsp),%r15
mov    %ecx,%esi
mov    $0x6,%edx
mov    %r15,%rcx
call   1030 <cnfImpn@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <emsGtune@plt>
mov    %eax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ems_gtune_(i8* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca [7 x i8]
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %8
%12 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 0
%13 = call i32 @cnfImpn(i8* %10, i32 %11, i32 6, i8* %12)
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %9, i64 0, i64 0
%15 = load i32*, i32** %7
%16 = call i32 @emsGtune(i8* %14, i32* %15)
%17 = load i32*, i32** %6
store i32 %16, i32* %17
ret void
}

LLVM IR (-O2):
define void @ems_gtune_(i8* %0, i32* nocapture writeonly %1, i32* %2, i32 %3) {
%5 = alloca [7 x i8]
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%7 = call i32 @cnfImpn(i8* %0, i32 %3, i32 6, i8* %6)
%8 = call i32 @emsGtune(i8* %6, i32* %2)
store i32 %8, i32* %1
ret void
}
void ZSTD_copy16(void *dst, const void *src) {
  __builtin_memcpy((dst), (src), (16));
}


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

x86 assembly (clang, -O2):
<ZSTD_copy16>:
movups (%rsi),%xmm0
movups %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @ZSTD_copy16(i8* nocapture writeonly %0, i8* nocapture %1) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(16) %0, i8* align 1 dereferenceable(16) %1, i64 16, i1 false)
ret void
}
short add_numbers(short a, short b) { return a + b; }


x86 assembly (clang, -O0):
<add_numbers>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_numbers>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define signext i16 @add_numbers(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = add nsw i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define signext i16 @add_numbers(i16 signext %0, i16 signext %1) {
%3 = add i16 %1, %0
ret i16 %3
}
int test_imm_00int64_lowword_mem(long long *val) {
  return ((*val) & (0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 0
%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_00int64_lowword_mem(i64* nocapture readnone %0) {
ret i32 -40
}
/* Type definitions */
typedef int /*<<< orphan*/ XImage;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XImage(void *_p) {
  if (_p == NULL)
    abort();
  free((XImage *)_p);
}


x86 assembly (clang, -O0):
<free_XImage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XImage+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XImage>:
test   %rdi,%rdi
je     112a <free_XImage+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XImage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XImage(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ root_visual;
};
typedef TYPE_1__ Screen;

/* Variables and functions */
void *get_Screen_root_visual(void *_p) {
  return (void *)((Screen *)_p)->root_visual;
}


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

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

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

LLVM IR (-O2):
define i8* @get_Screen_root_visual(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int is_space(char a) { return a == ' '; }


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
xor    %eax,%eax
cmp    $0x20,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ hoic_sw(int, int);
int hdoip_cli_debug(int fd, int fdr, char **argv, int argc) {
  hoic_sw(fd, (0x39000001));
  return 0;
}


x86 assembly (clang, -O0):
<hdoip_cli_debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x39000001,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdoip_cli_debug>:
push   %rax
mov    $0x39000001,%esi
call   1030 <hoic_sw@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hdoip_cli_debug(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = call i32 @hoic_sw(i32 %9, i32 956301313)
ret i32 0
}

LLVM IR (-O2):
define i32 @hdoip_cli_debug(i32 %0, i32 %1, i8** nocapture readnone %2, i32 %3) {
%5 = tail call i32 @hoic_sw(i32 %0, i32 956301313)
ret i32 0
}
int IsPress(int x, int y, int z1, int z2) { return y * (z2 - z1) < z1 * 15000; }


x86 assembly (clang, -O0):
<IsPress>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
imul   %ecx,%eax
imul   $0x3a98,-0xc(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsPress>:
sub    %edx,%ecx
imul   %esi,%ecx
imul   $0x3a98,%edx,%edx
xor    %eax,%eax
cmp    %edx,%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @IsPress(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = load i32, i32* %7
%12 = sub nsw i32 %10, %11
%13 = mul nsw i32 %9, %12
%14 = load i32, i32* %7
%15 = mul nsw i32 %14, 15000
%16 = icmp slt i32 %13, %15
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @IsPress(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %3, %2
%6 = mul nsw i32 %5, %1
%7 = mul nsw i32 %2, 15000
%8 = icmp slt i32 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
unsigned int max(unsigned int x, unsigned int y) {
  return x ^ ((x ^ y) & -(x < y));
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
cmp    -0x8(%rbp),%edx
setb   %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
and    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %edi,%eax
cmp    %esi,%edi
cmovb  %esi,%eax
ret

LLVM IR (-O0):
define i32 @max(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* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp ult i32 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = and i32 %8, %13
%15 = xor i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
const char *ap_check_cmd_context(void *a, int b) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @ap_check_cmd_context(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ CyPmHibSlpSaveSet();
void CyPmSlpSaveSet(void) { CyPmHibSlpSaveSet(); }


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

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

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

LLVM IR (-O2):
define void @CyPmSlpSaveSet() {
%1 = tail call i32 (...) @CyPmHibSlpSaveSet()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void rotate(uint32_t *key) { *key = (*key >> 1) | (*key << 31); }


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sar    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x1f,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    (%rdi),%eax
mov    %eax,%ecx
sar    %ecx
shl    $0x1f,%eax
or     %ecx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @rotate(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 1
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = shl i32 %7, 31
%9 = or i32 %5, %8
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret void
}

LLVM IR (-O2):
define void @rotate(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 1
%4 = shl i32 %2, 31
%5 = or i32 %3, %4
store i32 %5, i32* %0
ret void
}
void gtk_tree_view_column_get_sizing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_get_sizing() {
ret void
}
void async_os_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @async_os_shutdown() {
ret void
}
int func1(int a, int b) {
  volatile int r = a * b;
  r += (a | b);
  r += (a - b);
  return r;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
or     -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
mov    %esi,%eax
imul   %edi,%eax
mov    %eax,-0x4(%rsp)
mov    %esi,%eax
or     %edi,%eax
add    %eax,-0x4(%rsp)
sub    %esi,%edi
add    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @func1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store volatile i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = or i32 %9, %10
%12 = load volatile i32, i32* %5
%13 = add nsw i32 %12, %11
store volatile i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %14, %15
%17 = load volatile i32, i32* %5
%18 = add nsw i32 %17, %16
store volatile i32 %18, i32* %5
%19 = load volatile i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @func1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = mul nsw i32 %1, %0
store volatile i32 %5, i32* %3
%6 = or i32 %1, %0
%7 = load volatile i32, i32* %3
%8 = add nsw i32 %7, %6
store volatile i32 %8, i32* %3
%9 = sub i32 %0, %1
%10 = load volatile i32, i32* %3
%11 = add nsw i32 %9, %10
store volatile i32 %11, i32* %3
%12 = load volatile i32, i32* %3
ret i32 %12
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int isEqualTo(struct timeval timeA, struct timeval timeB) {
  int ret = 0;
  if ((timeA.tv_sec == timeB.tv_sec) && (timeA.tv_usec == timeB.tv_usec)) {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<isEqualTo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    113e <isEqualTo+0x3e>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113e <isEqualTo+0x3e>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEqualTo>:
xor    %rdx,%rdi
xor    %rcx,%rsi
xor    %eax,%eax
or     %rdi,%rsi
sete   %al
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @isEqualTo(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca i32
%8 = bitcast %struct.timeval* %5 to { i64, i64 }*
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 0
store i64 %0, i64* %9
%10 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %8, i32 0, i32 1
store i64 %1, i64* %10
%11 = bitcast %struct.timeval* %6 to { i64, i64 }*
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 0
store i64 %2, i64* %12
%13 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %11, i32 0, i32 1
store i64 %3, i64* %13
store i32 0, i32* %7
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%15 = load i64, i64* %14
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%17 = load i64, i64* %16
%18 = icmp eq i64 %15, %17
br i1 %18, label %19, label %26
19: ; preds = %4
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%21 = load i64, i64* %20
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%23 = load i64, i64* %22
%24 = icmp eq i64 %21, %23
br i1 %24, label %25, label %26
25: ; preds = %19
store i32 1, i32* %7
br label %26
26: ; preds = %25, %19, %4
%27 = load i32, i32* %7
ret i32 %27
}

LLVM IR (-O2):
define i32 @isEqualTo(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %0, %2
%6 = icmp eq i64 %1, %3
%7 = select i1 %5, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
int ft_op_prior(char c) {
  if (c == '(' || c == ')')
    return (1);
  if (c == '+' || c == '-')
    return (2);
  if (c == '*' || c == '/' || c == '%')
    return (3);
  return (-1);
}


x86 assembly (clang, -O0):
<ft_op_prior>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x28,%eax
je     1124 <ft_op_prior+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x29,%eax
jne    1130 <ft_op_prior+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1190 <ft_op_prior+0x90>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114a <ft_op_prior+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    1156 <ft_op_prior+0x56>
movl   $0x2,-0x4(%rbp)
jmp    1190 <ft_op_prior+0x90>
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     117d <ft_op_prior+0x7d>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     117d <ft_op_prior+0x7d>
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
jne    1189 <ft_op_prior+0x89>
movl   $0x3,-0x4(%rbp)
jmp    1190 <ft_op_prior+0x90>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_op_prior>:
mov    %edi,%ecx
and    $0xfe,%cl
mov    $0x1,%eax
cmp    $0x28,%cl
je     112c <ft_op_prior+0x2c>
add    $0xdb,%dil
mov    $0xffffffff,%eax
cmp    $0xa,%dil
ja     112c <ft_op_prior+0x2c>
movsbq %dil,%rax
lea    0xed7(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @ft_op_prior(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 40
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 41
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 1, i32* %2
br label %35
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 43
br i1 %15, label %20, label %16
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 45
br i1 %19, label %20, label %21
20: ; preds = %16, %12
store i32 2, i32* %2
br label %35
21: ; preds = %16
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 42
br i1 %24, label %33, label %25
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 47
br i1 %28, label %33, label %29
29: ; preds = %25
%30 = load i8, i8* %3
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 37
br i1 %32, label %33, label %34
33: ; preds = %29, %25, %21
store i32 3, i32* %2
br label %35
34: ; preds = %29
store i32 -1, i32* %2
br label %35
35: ; preds = %34, %33, %20, %11
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
@switch.table.ft_op_prior = [11 x i32] [i32 3, i32 -1, i32 -1, i32 -1, i32 -1, i32 3, i32 2, i32 -1, i32 2, i32 -1, i32 3]
define i32 @ft_op_prior(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 40
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = add i8 %0, -37
%6 = icmp ult i8 %5, 11
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = sext i8 %5 to i64
%9 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.ft_op_prior, i64 0, i64 %8
%10 = load i32, i32* %9
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 1, %1 ], [ %10, %7 ], [ -1, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  if (argc == 1)
    puts("Argc test...OK");
  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)
cmpl   $0x1,-0x8(%rbp)
jne    113c <main+0x2c>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x1,%edi
jne    1126 <main+0x16>
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Argc test...OK\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Argc test...OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello Nucleos\n");
  return 2;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello Nucleos\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 2
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int ssize_t;
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int fuzz_get_random_data(char *, int);
int fuzz_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
                struct timeval *timeout) {
  char val;
  ssize_t c = fuzz_get_random_data(&val, 1);
  return c;
}


x86 assembly (clang, -O0):
<fuzz_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x29(%rbp),%rdi
mov    $0x1,%esi
call   1030 <fuzz_get_random_data@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzz_select>:
push   %rax
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <fuzz_get_random_data@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @fuzz_select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
%11 = alloca i8
%12 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%13 = call i32 @fuzz_get_random_data(i8* %11, i32 1)
store i32 %13, i32* %12
%14 = load i32, i32* %12
ret i32 %14
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @fuzz_select(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, %struct.timeval* nocapture readnone %4) {
%6 = alloca i8
%7 = call i32 @fuzz_get_random_data(i8* %6, i32 1)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int mced_log(int, char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int mced_perror(int level, const char *str) {
  return mced_log(level, "%s: %s\n", str, strerror(errno));
}


x86 assembly (clang, -O0):
<mced_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0xea5(%rip),%rsi
call   1030 <mced_log@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mced_perror>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mced_log@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define i32 @mced_perror(i32 %0, i8* %1) {
%3 = load i32, i32* @errno
%4 = tail call i32 @strerror(i32 %3)
%5 = tail call i32 @mced_log(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome() {
  printf("****************************************\n");
  printf("*        4Gewinnt text based           *\n");
  printf("*                                      *\n");
  printf("* Press any key ... ([q] Quit)         *\n");
  printf("****************************************\n");
}


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

x86 assembly (clang, -O2):
<welcome>:
push   %rbx
lea    0xf63(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"****************************************\0A\00"
@.str.1 = [42 x i8] c"* 4Gewinnt text based *\0A\00"
@.str.2 = [42 x i8] c"* *\0A\00"
@.str.3 = [42 x i8] c"* Press any key ... ([q] Quit) *\0A\00"
define void @welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.4 = [41 x i8] c"* 4Gewinnt text based *\00"
@str.5 = [41 x i8] c"* *\00"
@str.6 = [41 x i8] c"* Press any key ... ([q] Quit) *\00"
@str.7 = [41 x i8] c"****************************************\00"
define void @welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.7, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.7, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_rastercon();
void Reset_Region() { reset_rastercon(); }


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

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

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

LLVM IR (-O2):
define void @Reset_Region() {
%1 = tail call i32 (...) @reset_rastercon()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_xwing() {
  printf(" ____________\n|____________|-----------(--\n   ',       ',\n     ', "
         "____  ',            ========------(- \n       ', __',  ',         .` "
         "   .`\n         ',       ',     .`    .`\n         __',_______',_.`  "
         "  .`\n         | ||      --^ |_ _.]\n        "
         "\\|_ll__________|-----...,____\n       ||                 '----\"    "
         " \"\"\"\"\"-------..,.,\n       | ______________ "
         "===========================|  \"\"-.\n       ]_| ||      '|  |    "
         "_______________________l...-\"\n         |_ll__________|.-`]\n       "
         "  .`        .` ',    ',\n       .`____    .`     ',    ',\n     "
         ".`____.`  .`        ========---------(-\n   .`        .`\n "
         ".`________.`\n |___________|-------------(--\n\n");
}


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

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

LLVM IR (-O0):
@.str = [647 x i8] c" ____________\0A|____________|-----------(--\0A ', ',\0A ', ____ ', ========------(- \0A ', __', ', .` .`\0A ', ', .` .`\0A __',_______',_.` .`\0A | || --^ |_ _.]\0A \\|_ll__________|-----...,____\0A || '----\22 \22\22\22\22\22-------..,.,\0A | ______________ ===========================| \22\22-.\0A ]_| || '| | _______________________l...-\22\0A |_ll__________|.-`]\0A .` .` ', ',\0A .`____ .` ', ',\0A .`____.` .` ========---------(-\0A .` .`\0A .`________.`\0A |___________|-------------(--\0A\0A\00"
define void @print_xwing() {
%1 = call i32 @printf(i8* getelementptr inbounds ([647 x i8], [647 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [646 x i8] c" ____________\0A|____________|-----------(--\0A ', ',\0A ', ____ ', ========------(- \0A ', __', ', .` .`\0A ', ', .` .`\0A __',_______',_.` .`\0A | || --^ |_ _.]\0A \\|_ll__________|-----...,____\0A || '----\22 \22\22\22\22\22-------..,.,\0A | ______________ ===========================| \22\22-.\0A ]_| || '| | _______________________l...-\22\0A |_ll__________|.-`]\0A .` .` ', ',\0A .`____ .` ', ',\0A .`____.` .` ========---------(-\0A .` .`\0A .`________.`\0A |___________|-------------(--\0A\00"
define void @print_xwing() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([646 x i8], [646 x i8]* @str, i64 0, i64 0))
ret void
}
void sound_add_cycles(unsigned c) {}


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

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

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

LLVM IR (-O2):
define void @sound_add_cycles(i32 %0) {
ret void
}
void foo_1_1_1_2_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_1_2_1_1_1() {
ret void
}
void *MyRealTimeMalloc(int numBytes) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @MyRealTimeMalloc(i32 %0) {
ret i8* null
}
void pnfs_destroy_layout(struct nfs_inode *nfsi) {}


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

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

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

LLVM IR (-O2):
%struct.nfs_inode = type opaque
define void @pnfs_destroy_layout(%struct.nfs_inode* nocapture %0) {
ret void
}
/* Variables and functions */
float logf(float);
float atanhf(float x) { return .5f * logf((1.f + x) / (1.f - x)); }


x86 assembly (clang, -O0):
<atanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedf(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  0xed2(%rip),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movss  0xeb5(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanhf>:
push   %rax
movss  0xee7(%rip),%xmm2
movaps %xmm0,%xmm1
addss  %xmm2,%xmm1
subss  %xmm0,%xmm2
divss  %xmm2,%xmm1
movaps %xmm1,%xmm0
call   1030 <logf@plt>
mulss  0xecc(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atanhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float 1.000000e+00, %3
%5 = load float, float* %2
%6 = fsub float 1.000000e+00, %5
%7 = fdiv float %4, %6
%8 = call float @logf(float %7)
%9 = fmul float 5.000000e-01, %8
ret float %9
}

LLVM IR (-O2):
define float @atanhf(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fsub float 1.000000e+00, %0
%4 = fdiv float %2, %3
%5 = tail call float @logf(float %4)
%6 = fmul float %5, 5.000000e-01
ret float %6
}