xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(int argc, char **argv) {
  char *s = argc >= 2 ? argv[1] : argv[0];
  reverse(s);
  printf("%s\n", s);
}


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)
cmpl   $0x2,-0x8(%rbp)
jl     1151 <main+0x31>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    115c <main+0x3c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x18(%rbp),%rsi
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
cmp    $0x2,%edi
setge  %al
mov    (%rsi,%rax,8),%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
br label %17
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
br label %17
17: ; preds = %13, %9
%18 = phi i8* [ %12, %9 ], [ %16, %13 ]
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = call i32 @reverse(i8* %19)
%21 = load i8*, i8** %6
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
%4 = zext i1 %3 to i64
%5 = getelementptr i8*, i8** %1, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @reverse(i8* %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}
int test_imm_B0uint8_reg(unsigned char val) {
  return ((val) & (-0xB0 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B0uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 80
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void const *GppcFinfoV1();
const void *pg_finfo_project_describe(void) { return GppcFinfoV1(); }


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

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

LLVM IR (-O0):
define i8* @pg_finfo_project_describe() {
%1 = call i8* (...) @GppcFinfoV1()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pg_finfo_project_describe() {
%1 = tail call i8* (...) @GppcFinfoV1()
ret i8* %1
}
/* Variables and functions */
unsigned char inportb(int);
int /*<<< orphan*/ outportb(int, unsigned char);
unsigned char read_register(unsigned char reg) {
  outportb(0x70, reg);
  return inportb(0x71);
}


x86 assembly (clang, -O0):
<read_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x70,%edi
movzbl -0x1(%rbp),%esi
call   1040 <outportb@plt>
mov    $0x71,%edi
call   1030 <inportb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_register>:
push   %rax
mov    %edi,%esi
mov    $0x70,%edi
call   1040 <outportb@plt>
mov    $0x71,%edi
pop    %rax
jmp    1030 <inportb@plt>

LLVM IR (-O0):
define zeroext i8 @read_register(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @outportb(i32 112, i8 zeroext %3)
%5 = call zeroext i8 @inportb(i32 113)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @read_register(i8 zeroext %0) {
%2 = tail call i32 @outportb(i32 112, i8 zeroext %0)
%3 = tail call zeroext i8 @inportb(i32 113)
ret i8 %3
}
/* Type definitions */
struct sk_buff {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len) {
  abort();
  return 0;
}


x86 assembly (clang, -O0):
<skb_copy_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<skb_copy_bits>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
define i32 @skb_copy_bits(%struct.sk_buff* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.sk_buff*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.sk_buff* %0, %struct.sk_buff** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
define i32 @skb_copy_bits(%struct.sk_buff* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 (...) @abort()
unreachable
}
int lstat(const char *file_name, struct stat *buf) { return -1; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
ret i32 -1
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @lstat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *p1 = "abcdefg";
  int *p2 = (int *)p1;
  printf("p2 = %d\n", *p2);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"p2 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 1684234849)
ret i32 0
}
/* Type definitions */
struct rcu_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void wakeme_after_rcu(struct rcu_head *head) { assert(0); }


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

x86 assembly (clang, -O2):
<wakeme_after_rcu>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
%struct.rcu_head = type { i32 }
define void @wakeme_after_rcu(%struct.rcu_head* %0) {
%2 = alloca %struct.rcu_head*
store %struct.rcu_head* %0, %struct.rcu_head** %2
%3 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
%struct.rcu_head = type { i32 }
define void @wakeme_after_rcu(%struct.rcu_head* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret void
}
unsigned int default_more_memory(unsigned int attempt, unsigned int size) {
  do {
    if (0)
      ((void)(size));
  } while (0);
  do {
    if (0)
      ((void)(attempt));
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<default_more_memory>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
jmp    110f <default_more_memory+0xf>
jmp    1114 <default_more_memory+0x14>
jmp    1119 <default_more_memory+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @default_more_memory(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @default_more_memory(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void t15(char **x, int offset) { free(x[offset]); }


x86 assembly (clang, -O0):
<t15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t15>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @t15(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8*, i8** %5, i64 %7
%9 = load i8*, i8** %8
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @t15(i8** nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = tail call i32 @free(i8* %5)
ret void
}
OP(dd, b2) {
  illegal_1();
  op_b2();
}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_b2()
ret i32 undef
}
int main(int argc, const char **argv) { return 0xB05D; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xb05d,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xb05d,%eax
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
ret i32 45149
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 45149
}
/* Variables and functions */
float expf(int /*<<< orphan*/);
int /*<<< orphan*/ loglaplace(float, float, float, float);
float laplace(float x, float loc, float sc, float logsc) {
  return expf(loglaplace(x, loc, sc, logsc));
}


x86 assembly (clang, -O0):
<laplace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <loglaplace@plt>
mov    %eax,%edi
call   1040 <expf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<laplace>:
push   %rax
call   1030 <loglaplace@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <expf@plt>

LLVM IR (-O0):
define float @laplace(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call i32 @loglaplace(float %9, float %10, float %11, float %12)
%14 = call float @expf(i32 %13)
ret float %14
}

LLVM IR (-O2):
define float @laplace(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @loglaplace(float %0, float %1, float %2, float %3)
%6 = tail call float @expf(i32 %5)
ret float %6
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_ceil(float *, float *);
__attribute__((always_)) struct vec3 *psvec3_ceil(struct vec3 *result,
                                                  struct vec3 *a) {
  vec3_ceil((float *)result, (float *)a);
  return result;
}


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

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

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_ceil(%struct.vec3* %0, %struct.vec3* %1) {
%3 = alloca %struct.vec3*
%4 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %3
store %struct.vec3* %1, %struct.vec3** %4
%5 = load %struct.vec3*, %struct.vec3** %3
%6 = bitcast %struct.vec3* %5 to float*
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = call i32 @vec3_ceil(float* %6, float* %8)
%10 = load %struct.vec3*, %struct.vec3** %3
ret %struct.vec3* %10
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_ceil(%struct.vec3* returned %0, %struct.vec3* %1) {
%3 = bitcast %struct.vec3* %0 to float*
%4 = bitcast %struct.vec3* %1 to float*
%5 = tail call i32 @vec3_ceil(float* %3, float* %4)
ret %struct.vec3* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_comige_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_comige_ss(__m128 A, __m128 B) { return _mm_comige_ss(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_comige_ss>:
jmp    1030 <_mm_comige_ss@plt>

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

LLVM IR (-O2):
define i32 @test_mm_comige_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_comige_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ inc(int *);
void address_of_param(int x) {
  x = 5;
  int *ptr = &x;
  inc(ptr);
  int z = x;
  assert(z == 6);
}


x86 assembly (clang, -O0):
<address_of_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <inc@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x6,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<address_of_param>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <inc@plt>
xor    %edi,%edi
cmpl   $0x6,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @address_of_param(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 %0, i32* %2
store i32 5, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @inc(i32* %5)
%7 = load i32, i32* %2
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 6
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret void
}

LLVM IR (-O2):
define void @address_of_param(i32 %0) {
%2 = alloca i32
store i32 5, i32* %2
%3 = call i32 @inc(i32* %2)
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 6
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Immediate8(int);
int /*<<< orphan*/ SBC8(int /*<<< orphan*/);
void OpE9M1(void) { SBC8(Immediate8(1)); }


x86 assembly (clang, -O0):
<OpE9M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <Immediate8@plt>
mov    %eax,%edi
call   1040 <SBC8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpE9M1>:
push   %rax
mov    $0x1,%edi
call   1030 <Immediate8@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <SBC8@plt>

LLVM IR (-O0):
define void @OpE9M1() {
%1 = call i32 @Immediate8(i32 1)
%2 = call i32 @SBC8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @OpE9M1() {
%1 = tail call i32 @Immediate8(i32 1)
%2 = tail call i32 @SBC8(i32 %1)
ret void
}
const char *strerror(int err) {
  extern const char *sys_errlist[];
  extern int sys_nerr;
  if (err < 0 || err >= sys_nerr)
    return "Unknown error";
  return sys_errlist[err];
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1123 <strerror+0x23>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jl     1133 <strerror+0x33>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <strerror+0x46>
movslq -0xc(%rbp),%rcx
mov    0x2eba(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
lea    0xef9(%rip),%rax
test   %edi,%edi
js     1123 <strerror+0x23>
mov    0x2ed6(%rip),%rcx
cmp    %edi,(%rcx)
jle    1123 <strerror+0x23>
mov    %edi,%eax
mov    0x2ed9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@.str = [14 x i8] c"Unknown error\00"
@sys_errlist = external global [0 x i8*]
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %6
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@.str = [14 x i8] c"Unknown error\00"
@sys_errlist = external global [0 x i8*]
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %11
}
int main() {
  int x = 100;
  int p;
  {
    if (p)
      x = -1;
    else
      x = 1;
  };
  while (x != 0)
    x--;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1128 <main+0x28>
movl   $0xffffffff,-0x8(%rbp)
jmp    112f <main+0x2f>
movl   $0x1,-0x8(%rbp)
jmp    1134 <main+0x34>
cmpl   $0x0,-0x8(%rbp)
je     114c <main+0x4c>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1134 <main+0x34>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dary2d_print(double **, size_t, size_t);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ pseq_to_str(double **, size_t, size_t, char *);
void print_for_movie(double **p, size_t n, size_t ndim, char *seq) {
  pseq_to_str(p, n, ndim, seq);
  printf("%s\n", seq);
  dary2d_print(p, n, ndim);
}


x86 assembly (clang, -O0):
<print_for_movie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <pseq_to_str@plt>
mov    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <dary2d_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_for_movie>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
call   1030 <pseq_to_str@plt>
lea    0xeb0(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <dary2d_print@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_for_movie(double** %0, i64 %1, i64 %2, i8* %3) {
%5 = alloca double**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store double** %0, double*** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load double**, double*** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i8*, i8** %8
%13 = call i32 @pseq_to_str(double** %9, i64 %10, i64 %11, i8* %12)
%14 = load i8*, i8** %8
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load double**, double*** %5
%17 = load i64, i64* %6
%18 = load i64, i64* %7
%19 = call i32 @dary2d_print(double** %16, i64 %17, i64 %18)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_for_movie(double** %0, i64 %1, i64 %2, i8* %3) {
%5 = tail call i32 @pseq_to_str(double** %0, i64 %1, i64 %2, i8* %3)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = tail call i32 @dary2d_print(double** %0, i64 %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSmile() { printf("Smile!"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Smile!\00"
define void @printSmile() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *get_string_time(int /*<<< orphan*/, char *);
int /*<<< orphan*/ get_time();
char *get_log_time() {
  return get_string_time(get_time(), "%d/%b/%Y:%H:%M:%S");
}


x86 assembly (clang, -O0):
<get_log_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_time@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
call   1030 <get_string_time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_log_time>:
push   %rax
xor    %eax,%eax
call   1040 <get_time@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <get_string_time@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%d/%b/%Y:%H:%M:%S\00"
define i8* @get_log_time() {
%1 = call i32 (...) @get_time()
%2 = call i8* @get_string_time(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}

LLVM IR (-O2):
@.str = [18 x i8] c"%d/%b/%Y:%H:%M:%S\00"
define i8* @get_log_time() {
%1 = tail call i32 (...) @get_time()
%2 = tail call i8* @get_string_time(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void ARGBToI444() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToI444() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_dobldobl_one_affinization(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(899, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_dobldobl_one_affinization>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x383,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_dobldobl_one_affinization>:
mov    $0x383,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_dobldobl_one_affinization() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 899, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_dobldobl_one_affinization() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 899, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int unlink(char *);
void cmd_unlink(int argc, char *argv[]) {
  if (unlink(argv[1]) == -1)
    perror("unlink");
}


x86 assembly (clang, -O0):
<cmd_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
jne    1151 <cmd_unlink+0x31>
lea    0xeb4(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_unlink>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <unlink@plt>
cmp    $0xffffffff,%eax
je     1131 <cmd_unlink+0x11>
pop    %rax
ret
lea    0xec8(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"unlink\00"
define void @cmd_unlink(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @unlink(i8* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
int strncmp(char *, char *, int);
void strncmp_diff_length_1() {
  char *x = "123";
  char *y = "23456";
  if (strncmp(x, y, 5) != -1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncmp_diff_length_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0xffffffff,%eax
je     1149 <strncmp_diff_length_1+0x39>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_diff_length_1>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    $0x5,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [6 x i8] c"23456\00"
define void @strncmp_diff_length_1() {
%1 = tail call i32 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
void main() {
  int x;
  x = 0;
  while (1) {
    if (x) {
      x = x + 4;
    } else {
      x = x + 6;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <main+0x23>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    112c <main+0x2c>
mov    -0x4(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %11
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 4
store i32 %7, i32* %1
br label %11
8: ; preds = %2
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 6
store i32 %10, i32* %1
br label %11
11: ; preds = %8, %5
br label %2
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
unsigned long X509_subject_name_hash(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned long);
char *gethash(X509 *cert, char *hash) {
  unsigned long hashvalue = X509_subject_name_hash(cert);
  sprintf(hash, "%08lx", hashvalue);
  return hash;
}


x86 assembly (clang, -O0):
<gethash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <X509_subject_name_hash@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xeb4(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethash>:
push   %rbx
mov    %rsi,%rbx
call   1030 <X509_subject_name_hash@plt>
lea    0xed0(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%08lx\00"
define i8* @gethash(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i64
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i32*, i32** %3
%7 = call i64 @X509_subject_name_hash(i32* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
@.str = [6 x i8] c"%08lx\00"
define i8* @gethash(i32* %0, i8* returned writeonly %1) {
%3 = tail call i64 @X509_subject_name_hash(i32* %0)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* %1
}
/* Type definitions */
struct em8051 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
int disasm_clr_c(struct em8051 *aCPU, int aPosition, char *aBuffer) {
  sprintf(aBuffer, "CLR   C");
  return 1;
}


x86 assembly (clang, -O0):
<disasm_clr_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disasm_clr_c>:
movabs $0x43202020524c43,%rax
mov    %rax,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
%struct.em8051 = type { i32 }
@.str = [8 x i8] c"CLR C\00"
define i32 @disasm_clr_c(%struct.em8051* %0, i32 %1, i8* %2) {
%4 = alloca %struct.em8051*
%5 = alloca i32
%6 = alloca i8*
store %struct.em8051* %0, %struct.em8051** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
%struct.em8051 = type { i32 }
define i32 @disasm_clr_c(%struct.em8051* nocapture readnone %0, i32 %1, i8* nocapture writeonly %2) {
%4 = bitcast i8* %2 to i64*
store i64 18894145792920643, i64* %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ cbguard2l(float *, int, int, int, int);
void cbguard2l_(float *bxy, int *nx, int *ny, int *nxe, int *nye) {
  cbguard2l(bxy, *nx, *ny, *nxe, *nye);
  return;
}


x86 assembly (clang, -O0):
<cbguard2l_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
call   1030 <cbguard2l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbguard2l_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
jmp    1030 <cbguard2l@plt>

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

LLVM IR (-O2):
define void @cbguard2l_(float* %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = tail call i32 @cbguard2l(float* %0, i32 %6, i32 %7, i32 %8, i32 %9)
ret void
}
long long szzu() { return 0xffff000000007fffLL; }


x86 assembly (clang, -O0):
<szzu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff000000007fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<szzu>:
movabs $0xffff000000007fff,%rax
ret

LLVM IR (-O0):
define i64 @szzu() {
ret i64 -281474976677889
}

LLVM IR (-O2):
define i64 @szzu() {
ret i64 -281474976677889
}
/* Type definitions */
struct utimbuf {
  int dummy;
};

/* Variables and functions */
int syscall(int, char const *, struct utimbuf const *);
int utime(const char *path, const struct utimbuf *times) {
  return syscall(30, path, times);
}


x86 assembly (clang, -O0):
<utime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x1e,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utime>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1e,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.utimbuf = type { i32 }
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = alloca i8*
%4 = alloca %struct.utimbuf*
store i8* %0, i8** %3
store %struct.utimbuf* %1, %struct.utimbuf** %4
%5 = load i8*, i8** %3
%6 = load %struct.utimbuf*, %struct.utimbuf** %4
%7 = call i32 @syscall(i32 30, i8* %5, %struct.utimbuf* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.utimbuf = type { i32 }
define i32 @utime(i8* %0, %struct.utimbuf* %1) {
%3 = tail call i32 @syscall(i32 30, i8* %0, %struct.utimbuf* %1)
ret i32 %3
}
void panic(msg) char *msg;
{
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<panic>:
push   %rax
xor    %eax,%eax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @panic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %3)
unreachable
}

LLVM IR (-O2):
define void @panic(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %0)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
double ut_encode_clock(int const, int const, double const);
double ut_encode_date(int const, int const, int const);
double ut_encode_time(const int year, const int month, const int day,
                      const int hour, const int minute, const double second) {
  return ut_encode_date(year, month, day) +
         ut_encode_clock(hour, minute, second);
}


x86 assembly (clang, -O0):
<ut_encode_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <ut_encode_date@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
movsd  -0x20(%rbp),%xmm0
call   1040 <ut_encode_clock@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_encode_time>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
mov    %r8d,%ebx
mov    %ecx,%ebp
call   1030 <ut_encode_date@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
movsd  0x10(%rsp),%xmm0
call   1040 <ut_encode_clock@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @ut_encode_time(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store double %5, double* %12
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = call double @ut_encode_date(i32 %13, i32 %14, i32 %15)
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load double, double* %12
%20 = call double @ut_encode_clock(i32 %17, i32 %18, double %19)
%21 = fadd double %16, %20
ret double %21
}

LLVM IR (-O2):
define double @ut_encode_time(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, double %5) {
%7 = tail call double @ut_encode_date(i32 %0, i32 %1, i32 %2)
%8 = tail call double @ut_encode_clock(i32 %3, i32 %4, double %5)
%9 = fadd double %7, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void ivector_free(int *v) {
  free(v);
  return;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @error_print_loc() {
ret void
}
int iTestStrBit2(unsigned char *psStr, int iByteNo, int iBitNo) {
  unsigned char ucByte;
  if (iBitNo < 1 || iBitNo > 8)
    return (0);
  ucByte = psStr[iByteNo];
  ucByte >>= (iBitNo - 1);
  if (ucByte & 0x01)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<iTestStrBit2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jl     1122 <iTestStrBit2+0x22>
cmpl   $0x8,-0x18(%rbp)
jle    112e <iTestStrBit2+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    116e <iTestStrBit2+0x6e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movzbl -0x19(%rbp),%eax
sar    %cl,%eax
mov    %al,-0x19(%rbp)
movzbl -0x19(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1167 <iTestStrBit2+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <iTestStrBit2+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iTestStrBit2>:
lea    -0x9(%rdx),%ecx
xor    %eax,%eax
cmp    $0xfffffff8,%ecx
jb     111b <iTestStrBit2+0x1b>
movslq %esi,%rax
movzbl (%rdi,%rax,1),%eax
add    $0xff,%dl
mov    %edx,%ecx
shr    %cl,%eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iTestStrBit2(i8* nocapture %0, i32 %1, i32 %2) {
%4 = add i32 %2, -9
%5 = icmp ult i32 %4, -8
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = add nsw i32 %2, -1
%11 = zext i8 %9 to i32
%12 = lshr i32 %11, %10
%13 = and i32 %12, 1
br label %14
14: ; preds = %6, %3
%15 = phi i32 [ 0, %3 ], [ %13, %6 ]
ret i32 %15
}
AX0I1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((((int *)10000000)[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
cmpl   $0x21,(%rax,%rcx,4)
jg     1137 <AX0I1+0x37>
movl   $0x1,-0x4(%rbp)
jmp    113e <AX0I1+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpl   $0x22,0x989680(,%rcx,4)
22
setl   %al
ret

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

LLVM IR (-O2):
define i32 @AX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void xassert(const char *expr, const char *file, int line) {
  fprintf(stderr, "assertion failed: %s:%d: \"%s\"\n", file, line, expr);
  abort();
}


x86 assembly (clang, -O0):
<xassert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<xassert>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"assertion failed: %s:%d: \22%s\22\0A\00"
define void @xassert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"assertion failed: %s:%d: \22%s\22\0A\00"
define void @xassert(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = tail call i32 (...) @abort()
unreachable
}