xunge/DecIR huggingface dataset:
int int_compare(const void *a, const void *b) { return *(int *)a < *(int *)b; }


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

x86 assembly (clang, -O2):
<int_compare>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @int_compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @int_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void map_normal() { (*(unsigned int *)(0x400fc040)) = 1; }


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

x86 assembly (clang, -O2):
<map_normal>:
movl   $0x1,0x400fc040
ret

LLVM IR (-O0):
define void @map_normal() {
store i32 1, i32* inttoptr (i64 1074774080 to i32*)
ret void
}

LLVM IR (-O2):
define void @map_normal() {
store i32 1, i32* inttoptr (i64 1074774080 to i32*)
ret void
}
int main(int argc, const char *argv[]) {
  int i;
  int k;
  int sum;
  i = 5;
  k = 8;
  sum = i + k;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void common_load_map(void *img, int imgtarget, void *map, int maptarget,
                     void *pal) {}


x86 assembly (clang, -O0):
<common_load_map>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @common_load_map(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @common_load_map(i8* nocapture %0, i32 %1, i8* nocapture %2, i32 %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ matNf_mult_vecNf_new(float *, float const *, float *,
                                        int const);
void matNf_mult_vecNf(float vector[], const float matrix[], const int n) {
  matNf_mult_vecNf_new(vector, matrix, vector, n);
}


x86 assembly (clang, -O0):
<matNf_mult_vecNf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <matNf_mult_vecNf_new@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matNf_mult_vecNf>:
mov    %edx,%ecx
mov    %rdi,%rdx
jmp    1030 <matNf_mult_vecNf_new@plt>

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

LLVM IR (-O2):
define void @matNf_mult_vecNf(float* %0, float* %1, i32 %2) {
%4 = tail call i32 @matNf_mult_vecNf_new(float* %0, float* %1, float* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_shift_operators(int lhs, int rhs) {
  __emit_expression_range(0, lhs << rhs);
  __emit_expression_range(0, lhs >> rhs);
}


x86 assembly (clang, -O0):
<test_shift_operators>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
shl    %cl,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
sar    %cl,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shift_operators>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%esi
mov    %ebx,%ecx
shl    %cl,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    %ebx,%ecx
sar    %cl,%ebp
xor    %edi,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_shift_operators(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 = shl i32 %5, %6
%8 = call i32 @__emit_expression_range(i32 0, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = ashr i32 %9, %10
%12 = call i32 @__emit_expression_range(i32 0, i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_shift_operators(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = tail call i32 @__emit_expression_range(i32 0, i32 %3)
%5 = ashr i32 %0, %1
%6 = tail call i32 @__emit_expression_range(i32 0, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int const);
void matNf_copy(float dest[], const float src[], const int n) {
  memcpy(dest, src, n * n * sizeof(float));
}


x86 assembly (clang, -O0):
<matNf_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matNf_copy>:
imul   %edx,%edx
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @matNf_copy(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load float*, float** %5
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 4
%14 = trunc i64 %13 to i32
%15 = call i32 @memcpy(float* %7, float* %8, i32 %14)
ret void
}

LLVM IR (-O2):
define void @matNf_copy(float* %0, float* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = mul i32 %4, %2
%6 = tail call i32 @memcpy(float* %0, float* %1, i32 %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ munmap(int /*<<< orphan*/, size_t);
int free_pages(void *pages, size_t size, const int sbrk_b) {
  if (!sbrk_b) {
    (void)munmap((caddr_t)pages, size);
  }
  return 1;
}


x86 assembly (clang, -O0):
<free_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    113c <free_pages+0x2c>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_pages>:
test   %edx,%edx
je     111a <free_pages+0xa>
mov    $0x1,%eax
ret
push   %rax
call   1030 <munmap@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @free_pages(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = ptrtoint i8* %10 to i32
%12 = load i64, i64* %5
%13 = call i32 @munmap(i32 %11, i64 %12)
br label %14
14: ; preds = %9, %3
ret i32 1
}

LLVM IR (-O2):
define i32 @free_pages(i8* %0, i64 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = ptrtoint i8* %0 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i32 @munmap(i32 %7, i64 %1)
br label %9
9: ; preds = %5, %3
ret i32 1
}
unsigned num_undump_word32(const void *src) {
  return ((unsigned)(((const unsigned char *)src)[0]) << 24) +
         ((unsigned)(((const unsigned char *)src)[1]) << 16) +
         ((unsigned)(((const unsigned char *)src)[2]) << 8) +
         ((unsigned)(((const unsigned char *)src)[3]));
}


x86 assembly (clang, -O0):
<num_undump_word32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @num_undump_word32(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = add i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add i32 %13, %18
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i64 3
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = add i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @num_undump_word32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Type definitions */
struct wl_resource {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int);
void wl_pointer_send_frame(struct wl_resource *resource_) {
  wl_resource_post_event(resource_, 5);
}


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

x86 assembly (clang, -O2):
<wl_pointer_send_frame>:
mov    $0x5,%esi
jmp    1030 <wl_resource_post_event@plt>

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

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_pointer_send_frame(%struct.wl_resource* %0) {
%2 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 5)
ret void
}
int nt_machine_ncpu(int *fake64) {
  int ncpu = 0;
  *fake64 = 0;
  ncpu = 2;
  return ncpu;
}


x86 assembly (clang, -O0):
<nt_machine_ncpu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nt_machine_ncpu>:
movl   $0x0,(%rdi)
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @nt_machine_ncpu(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void n(int x) { fprintf(stderr, "%c%d\n", 'n', x); }


x86 assembly (clang, -O0):
<n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x6e,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x6e,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @n(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 110, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @n(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 110, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float f;
  printf("Float number: ");
  scanf("%f", &f);
  printf("The input is %.6f or %.6e.\n", f, f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xeac(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec1(%rip),%rdi
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Float number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"The input is %.6f or %.6e.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %6, double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Float number: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"The input is %.6f or %.6e.\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %6, double %6)
ret i32 0
}
/* Variables and functions */
int get16(int);
int mcb_owner(int mcb) {
  if (mcb < 0 || mcb >= 0x10000)
    return 0;
  return get16(mcb * 16 + 1);
}


x86 assembly (clang, -O0):
<mcb_owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1132 <mcb_owner+0x22>
cmpl   $0x10000,-0x8(%rbp)
jl     113e <mcb_owner+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    114f <mcb_owner+0x3f>
mov    -0x8(%rbp),%edi
shl    $0x4,%edi
add    $0x1,%edi
call   1030 <get16@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcb_owner>:
cmp    $0xffff,%edi
jbe    111b <mcb_owner+0xb>
xor    %eax,%eax
ret
shl    $0x4,%edi
or     $0x1,%edi
jmp    1030 <get16@plt>

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

LLVM IR (-O2):
define i32 @mcb_owner(i32 %0) {
%2 = icmp ugt i32 %0, 65535
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = shl nuw nsw i32 %0, 4
%5 = or i32 %4, 1
%6 = tail call i32 @get16(i32 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void mpgedit_indexfile_close(FILE *fp) {
  if (fp) {
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<mpgedit_indexfile_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <mpgedit_indexfile_close+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpgedit_indexfile_close>:
test   %rdi,%rdi
je     111a <mpgedit_indexfile_close+0xa>
jmp    1030 <fclose@plt>
ret

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

LLVM IR (-O2):
define void @mpgedit_indexfile_close(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @fclose(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printFahrList(int, int /*<<< orphan*/, int, int);
int main() { printFahrList(300, 0, -20, 1); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12c,%edi
xor    %esi,%esi
mov    $0xffffffec,%edx
mov    $0x1,%ecx
call   1030 <printFahrList@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @printFahrList(i32 300, i32 0, i32 -20, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printFahrList(i32 300, i32 0, i32 -20, i32 1)
ret i32 0
}
/* Variables and functions */
double powInt(int, int);
float maxFixed(int k, int l) {
  return (float)powInt(2, k - 1) - (1.0 / powInt(2, l));
}


x86 assembly (clang, -O0):
<maxFixed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
sub    $0x1,%esi
mov    $0x2,%edi
call   1030 <powInt@plt>
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1030 <powInt@plt>
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxFixed>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    -0x1(%rdi),%esi
mov    $0x2,%edi
call   1030 <powInt@plt>
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <powInt@plt>
movsd  0xeba(%rip),%xmm1
divsd  %xmm0,%xmm1
addsd  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @maxFixed(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 = sub nsw i32 %5, 1
%7 = call double @powInt(i32 2, i32 %6)
%8 = fptrunc double %7 to float
%9 = fpext float %8 to double
%10 = load i32, i32* %4
%11 = call double @powInt(i32 2, i32 %10)
%12 = fdiv double 1.000000e+00, %11
%13 = fsub double %9, %12
%14 = fptrunc double %13 to float
ret float %14
}

LLVM IR (-O2):
define float @maxFixed(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = tail call double @powInt(i32 2, i32 %3)
%5 = fptrunc double %4 to float
%6 = fpext float %5 to double
%7 = tail call double @powInt(i32 2, i32 %1)
%8 = fdiv double 1.000000e+00, %7
%9 = fsub double %6, %8
%10 = fptrunc double %9 to float
ret float %10
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint64_t __muldi3(uint64_t a, uint64_t b) {
  uint32_t al = (uint32_t)a;
  uint32_t ah = (uint32_t)(a >> 32);
  uint32_t bl = (uint32_t)b;
  uint32_t bh = (uint32_t)(b >> 32);
  uint64_t v;
  v = (uint64_t)al * bl;
  v += (uint64_t)(al * bh + ah * bl) << 32;
  return v;
}


x86 assembly (clang, -O0):
<__muldi3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
add    %ecx,%eax
mov    $0x20,%ecx
shl    %cl,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__muldi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = ashr i32 %11, 32
store i32 %12, i32* %6
%13 = load i32, i32* %4
store i32 %13, i32* %7
%14 = load i32, i32* %4
%15 = ashr i32 %14, 32
store i32 %15, i32* %8
%16 = load i32, i32* %5
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
store i32 %18, i32* %9
%19 = load i32, i32* %5
%20 = load i32, i32* %8
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = mul nsw i32 %22, %23
%25 = add nsw i32 %21, %24
%26 = shl i32 %25, 32
%27 = load i32, i32* %9
%28 = add nsw i32 %27, %26
store i32 %28, i32* %9
%29 = load i32, i32* %9
ret i32 %29
}

LLVM IR (-O2):
define i32 @__muldi3(i32 %0, i32 %1) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void list_interfaces() {
  printf("interface {display=TCPTEST}{value=tcptest}\n");
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"interface {display=TCPTEST}{value=tcptest}\0A\00"
define void @list_interfaces() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"interface {display=TCPTEST}{value=tcptest}\00"
define void @list_interfaces() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret void
}
char bits2ASCII(char b) {
  if (b >= 0 && b < 10) {
    return (b + '0');
  } else if (b >= 10 && b <= 15) {
    return (b - 10 + 'a');
  }
  return 0;
}


x86 assembly (clang, -O0):
<bits2ASCII>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jl     1133 <bits2ASCII+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1133 <bits2ASCII+0x33>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1168 <bits2ASCII+0x68>
movsbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jl     115f <bits2ASCII+0x5f>
movsbl -0x2(%rbp),%eax
cmp    $0xf,%eax
jg     115f <bits2ASCII+0x5f>
movsbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1168 <bits2ASCII+0x68>
jmp    1164 <bits2ASCII+0x64>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits2ASCII>:
mov    %edi,%eax
cmp    $0x9,%al
ja     1109 <bits2ASCII+0x9>
add    $0x30,%al
ret
lea    -0xa(%rax),%ecx
add    $0x57,%al
xor    %edx,%edx
cmp    $0x6,%cl
movzbl %al,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @bits2ASCII(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 10
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %32
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp sge i32 %18, 10
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 15
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8, i8* %3
%26 = sext i8 %25 to i32
%27 = sub nsw i32 %26, 10
%28 = add nsw i32 %27, 97
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
br label %32
30: ; preds = %20, %16
br label %31
31: ; preds = %30
store i8 0, i8* %2
br label %32
32: ; preds = %31, %24, %11
%33 = load i8, i8* %2
ret i8 %33
}

LLVM IR (-O2):
define signext i8 @bits2ASCII(i8 signext %0) {
%2 = icmp ult i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nuw nsw i8 %0, 48
br label %10
5: ; preds = %1
%6 = add i8 %0, -10
%7 = icmp ult i8 %6, 6
%8 = add i8 %0, 87
%9 = select i1 %7, i8 %8, i8 0
br label %10
10: ; preds = %5, %3
%11 = phi i8 [ %4, %3 ], [ %9, %5 ]
ret i8 %11
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void const *, int);
void *copy_array_(void const *source, int size) {
  void *target = malloc(size);
  memcpy(target, source, size);
  return target;
}


x86 assembly (clang, -O0):
<copy_array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_array_>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @copy_array_(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
define i8* @copy_array_(i8* %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = tail call i32 @memcpy(i8* %3, i8* %0, i32 %1)
ret i8* %3
}
void PKCS7_DIGEST_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_DIGEST_free() {
ret void
}
/* Variables and functions */
int IntOrError(int, char **, int);
int Os9Dup(int, int *);
int atoi(char *);
int picolCommand9Dup(int argc, char **argv, void *pd) {
  int new_path = 0;
  int path = atoi(argv[1]);
  int e = Os9Dup(path, &new_path);
  return IntOrError(e, argv, new_path);
}


x86 assembly (clang, -O0):
<picolCommand9Dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x1c(%rbp),%rsi
call   1030 <Os9Dup@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <IntOrError@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<picolCommand9Dup>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movl   $0x0,0xc(%rsp)
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
lea    0xc(%rsp),%rsi
mov    %eax,%edi
call   1030 <Os9Dup@plt>
mov    0xc(%rsp),%edx
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <IntOrError@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @picolCommand9Dup(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = call i32 @Os9Dup(i32 %14, i32* %7)
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = load i8**, i8*** %5
%18 = load i32, i32* %7
%19 = call i32 @IntOrError(i32 %16, i8** %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @picolCommand9Dup(i32 %0, i8** %1, i8* nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = call i32 @Os9Dup(i32 %8, i32* %4)
%10 = load i32, i32* %4
%11 = call i32 @IntOrError(i32 %9, i8** %1, i32 %10)
ret i32 %11
}
int test_imm_54int8_reg(signed char val) {
  return ((val) & (-0x54 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_54int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -84
%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_54int8_reg(i8 signext %0) {
%2 = and i8 %0, -84
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int strcmp(char const *, char const *);
int string_cmp(const void *elt1, const void *elt2) {
  return strcmp((const char *)elt1, (const char *)elt2);
}


x86 assembly (clang, -O0):
<string_cmp>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
char *fourcc_str(int i) {
  static char str[5];
  str[0] = ((char)(i & 0xFF)), str[1] = ((char)((i >> 8) & 0xFF)),
  str[2] = ((char)((i >> 16) & 0xFF)), str[3] = ((char)((i >> 24) & 0xFF)),
  str[4] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<fourcc_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,0x2f0c(%rip)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,0x2efc(%rip)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,0x2eec(%rip)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,0x2edc(%rip)
movb   $0x0,0x2ed6(%rip)
lea    0x2ecb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourcc_str>:
mov    %edi,%ecx
mov    %cl,0x2f19(%rip)
lea    0x2f12(%rip),%rax
mov    %ch,0x2f0d(%rip)
mov    %edi,%edx
shr    $0x10,%edx
mov    %dl,0x2f03(%rip)
shr    $0x18,%ecx
mov    %cl,0x2efb(%rip)
movb   $0x0,0x2ef5(%rip)
ret

LLVM IR (-O0):
@fourcc_str.str = internal global [5 x i8] zeroinitializer
define i8* @fourcc_str(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = trunc i32 %4 to i8
store i8 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 0)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
store i8 %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 1)
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
store i8 %13, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 2)
%14 = load i32, i32* %2
%15 = ashr i32 %14, 24
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
store i8 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 0)
}

LLVM IR (-O2):
@fourcc_str.str = internal global [5 x i8] zeroinitializer
define i8* @fourcc_str(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 0)
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 1)
%5 = lshr i32 %0, 16
%6 = trunc i32 %5 to i8
store i8 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 2)
%7 = lshr i32 %0, 24
%8 = trunc i32 %7 to i8
store i8 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 3)
store i8 0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 4)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @fourcc_str.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *ieee1888_mk_string(const char *str) {
  int len = strlen(str);
  char *p = (char *)malloc(len + 1);
  strcpy(p, str);
  return p;
}


x86 assembly (clang, -O0):
<ieee1888_mk_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee1888_mk_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ieee1888_mk_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
%14 = load i8*, i8** %4
ret i8* %14
}

LLVM IR (-O2):
define i8* @ieee1888_mk_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
uint32_t absInt32(int32_t i) { return (i >= 0) ? i : -i; }


x86 assembly (clang, -O0):
<absInt32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <absInt32+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <absInt32+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absInt32>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @absInt32(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void plot(const int x, const int y, unsigned char *image, const int pitch) {
  image[x + y * pitch] ^= 255;
}


x86 assembly (clang, -O0):
<plot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
imul   -0x14(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
xor    $0xff,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<plot>:
imul   %ecx,%esi
add    %edi,%esi
movslq %esi,%rax
notb   (%rdx,%rax,1)
ret

LLVM IR (-O0):
define void @plot(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 i8*, i8** %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %8
%13 = mul nsw i32 %11, %12
%14 = add nsw i32 %10, %13
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %9, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = xor i32 %18, 255
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @plot(i32 %0, i32 %1, i8* nocapture %2, i32 %3) {
%5 = mul nsw i32 %3, %1
%6 = add nsw i32 %5, %0
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %2, i64 %7
%9 = load i8, i8* %8
%10 = xor i8 %9, -1
store i8 %10, i8* %8
ret void
}
/* Variables and functions */
scalar_t__ lt_prime(int);
scalar_t__ rt_prime(int);
int lprime(int p) { return (lt_prime(p) && rt_prime(p)); }


x86 assembly (clang, -O0):
<lprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <lt_prime@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     1157 <lprime+0x37>
mov    -0x4(%rbp),%edi
call   1030 <rt_prime@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lprime>:
push   %rbx
mov    %edi,%ebx
call   1040 <lt_prime@plt>
test   %rax,%rax
je     1141 <lprime+0x21>
mov    %ebx,%edi
call   1030 <rt_prime@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lprime(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @lt_prime(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @rt_prime(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @lprime(i32 %0) {
%2 = tail call i64 @lt_prime(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @rt_prime(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void BN_nist_mod_256(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_nist_mod_256() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void main() {
  char *temp = "Paras";
  int i;
  i = 0;
  temp[3] = 'F';
  for (i = 0; i < 5; i++)
    printf("%c\n", temp[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x46,0x3(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1169 <main+0x59>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeb4(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <main+0x29>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x72,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x73,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%c\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 80)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 97)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 114)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 97)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext 115)
ret void
}
/* Variables and functions */
char *get_os_name();
char *get_version_info();
int /*<<< orphan*/ printf(char *, char *, char *);
void print_A_banner() {
  printf("library A, version %s running on %s\n", get_version_info(),
         get_os_name());
}


x86 assembly (clang, -O0):
<print_A_banner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_version_info@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <get_os_name@plt>
mov    -0x8(%rbp),%rsi
mov    %rax,%rdx
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_A_banner>:
push   %rbx
xor    %eax,%eax
call   1040 <get_version_info@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <get_os_name@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"library A, version %s running on %s\0A\00"
define void @print_A_banner() {
%1 = call i8* (...) @get_version_info()
%2 = call i8* (...) @get_os_name()
%3 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"library A, version %s running on %s\0A\00"
define void @print_A_banner() {
%1 = tail call i8* (...) @get_version_info()
%2 = tail call i8* (...) @get_os_name()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}
__attribute__((__always___)) unsigned int rte_xbegin(void) {
  unsigned int ret = (~0u);
  __asm__ volatile(".byte 0xc7,0xf8 ; .long 0" : "+a"(ret)::"memory");
  return ret;
}


x86 assembly (clang, -O0):
<rte_xbegin>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xbegin 1114 <rte_xbegin+0x14>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rte_xbegin>:
mov    $0xffffffff,%eax
xbegin 110b <rte_xbegin+0xb>
ret

LLVM IR (-O0):
define i32 @rte_xbegin() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @rte_xbegin() {
%1 = tail call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 -1)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
void SysCtlResetCauseClear(uint32_t ui32Causes) {
  (*((volatile uint32_t *)(0x400FE05C))) &= ~(ui32Causes);
}


x86 assembly (clang, -O0):
<SysCtlResetCauseClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    $0x400fe05c,%ecx
mov    (%rcx),%ecx
and    %eax,%ecx
mov    $0x400fe05c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlResetCauseClear>:
mov    %edi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
not    %eax
and    %eax,0x400fe05c
ret

LLVM IR (-O0):
define void @SysCtlResetCauseClear(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* inttoptr (i64 1074782300 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 1074782300 to i32*)
ret void
}

LLVM IR (-O2):
define void @SysCtlResetCauseClear(i32 %0) {
%2 = alloca i32
store volatile i32 %0, i32* %2
%3 = load volatile i32, i32* %2
%4 = xor i32 %3, -1
%5 = load volatile i32, i32* inttoptr (i64 1074782300 to i32*)
%6 = and i32 %5, %4
store volatile i32 %6, i32* inttoptr (i64 1074782300 to i32*)
ret void
}
void Hal_hook_wr_sgndrecfield_recelemb(void) {}


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

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

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

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