xunge/DecIR huggingface dataset:
int test_imm_D1uint8_reg(unsigned char val) {
  return ((val) & (0xD1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D1uint8_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, 209
%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_D1uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -47
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void foo046(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo046(i32 %0) {
ret void
}
float __ocl_convert_float_char(char src) { return (float)src; }


x86 assembly (clang, -O0):
<__ocl_convert_float_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_convert_float_char>:
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @__ocl_convert_float_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sitofp i8 %3 to float
ret float %4
}

LLVM IR (-O2):
define float @__ocl_convert_float_char(i8 signext %0) {
%2 = sitofp i8 %0 to float
ret float %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
bool test_file(char *f) {
  struct stat sb;
  if (stat(f, &sb)) {
    fprintf(stderr, "Error: File '%s' does not exist.\n", f);
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<test_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     1168 <test_file+0x48>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116f <test_file+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_file>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
je     1153 <test_file+0x33>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
xor    %eax,%eax
jmp    1158 <test_file+0x38>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [34 x i8] c"Error: File '%s' does not exist.\0A\00"
define i32 @test_file(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %3
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [34 x i8] c"Error: File '%s' does not exist.\0A\00"
define i32 @test_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %1, %6
%10 = phi i32 [ 0, %6 ], [ 1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char **);
void bt_frames_free(char **backtrace) { free(backtrace); }


x86 assembly (clang, -O0):
<bt_frames_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):
<bt_frames_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @bt_frames_free(i8** nocapture %0) {
%2 = tail call i32 @free(i8** %0)
ret void
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t map(int32_t value, int32_t fromStart, int32_t fromEnd, int32_t toStart,
            int32_t toEnd) {
  return ((int64_t)(value - fromStart) * (toEnd - toStart)) /
             (fromEnd - fromStart) +
         toStart;
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
mov    %r8d,%eax
mov    %edx,%r8d
sub    %esi,%edi
sub    %ecx,%eax
imul   %edi,%eax
sub    %esi,%r8d
cltd
idiv   %r8d
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @map(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = sub nsw i32 %11, %12
%14 = load i32, i32* %10
%15 = load i32, i32* %9
%16 = sub nsw i32 %14, %15
%17 = mul nsw i32 %13, %16
%18 = load i32, i32* %8
%19 = load i32, i32* %7
%20 = sub nsw i32 %18, %19
%21 = sdiv i32 %17, %20
%22 = load i32, i32* %9
%23 = add nsw i32 %21, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @map(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %0, %1
%7 = sub nsw i32 %4, %3
%8 = mul nsw i32 %7, %6
%9 = sub nsw i32 %2, %1
%10 = sdiv i32 %8, %9
%11 = add nsw i32 %10, %3
ret i32 %11
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int *ptr1, *ptr2;
  ptr1 = malloc(sizeof(int));
  *ptr1 = 100;
  ptr2 = ptr1;
  free(ptr1);
  *ptr2 = 200;
  printf("ptr2 = %d\n", *ptr2);
  int *ptr3;
  {
    int val = 300;
    ptr3 = &val;
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x64,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
movl   $0xc8,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
movl   $0x12c,-0x24(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e46(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
movl   $0x64,(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
lea    0xeb0(%rip),%rdi
mov    $0xc8,%esi
call   1040 <printf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"ptr2 = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32* @malloc(i32 4)
store i32* %6, i32** %2
%7 = load i32*, i32** %2
store i32 100, i32* %7
%8 = load i32*, i32** %2
store i32* %8, i32** %3
%9 = load i32*, i32** %2
%10 = call i32 @free(i32* %9)
%11 = load i32*, i32** %3
store i32 200, i32* %11
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %13)
store i32 300, i32* %5
store i32* %5, i32** %4
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@.str = [11 x i8] c"ptr2 = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
store i32 100, i32* %1
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 200)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int linearSearch(int *, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int A[] = {1, 9, 8, 8};
  printf("The element 8 is found at position %d.\n", linearSearch(A, 4, 8));
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <linearSearch@plt>
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xec5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x8,%edx
call   1030 <linearSearch@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [4 x i32] [i32 1, i32 9, i32 8, i32 8]
@.str = [40 x i8] c"The element 8 is found at position %d.\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @linearSearch(i32* %3, i32 4, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [4 x i32] [i32 1, i32 9, i32 8, i32 8]
@.str = [40 x i8] c"The element 8 is found at position %d.\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @linearSearch(i32* %3, i32 4, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_clamp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *, int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *psvec3i_clamp(struct vec3i *result,
                                                     struct vec3i *a,
                                                     struct vec3i *lower,
                                                     struct vec3i *higher) {
  vec3i_clamp((int32_t *)result, (int32_t *)a, (int32_t *)lower,
              (int32_t *)higher);
  return result;
}


x86 assembly (clang, -O0):
<psvec3i_clamp>:
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 <vec3i_clamp@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_clamp(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2, %struct.vec3i* %3) {
%5 = alloca %struct.vec3i*
%6 = alloca %struct.vec3i*
%7 = alloca %struct.vec3i*
%8 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %5
store %struct.vec3i* %1, %struct.vec3i** %6
store %struct.vec3i* %2, %struct.vec3i** %7
store %struct.vec3i* %3, %struct.vec3i** %8
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = load %struct.vec3i*, %struct.vec3i** %7
%14 = bitcast %struct.vec3i* %13 to i32*
%15 = load %struct.vec3i*, %struct.vec3i** %8
%16 = bitcast %struct.vec3i* %15 to i32*
%17 = call i32 @vec3i_clamp(i32* %10, i32* %12, i32* %14, i32* %16)
%18 = load %struct.vec3i*, %struct.vec3i** %5
ret %struct.vec3i* %18
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_clamp(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2, %struct.vec3i* %3) {
%5 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%6 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%7 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%8 = getelementptr %struct.vec3i, %struct.vec3i* %3, i64 0, i32 0
%9 = tail call i32 @vec3i_clamp(i32* %5, i32* %6, i32* %7, i32* %8)
ret %struct.vec3i* %0
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_metadata_load(void *, void **, void **,
                                                 size_t *, void **);
__attribute__((__weak__, __always___)) void
__softboundcets_metadata_load_vector(void *addr_of_ptr, void **base,
                                     void **bound, size_t *key, void **lock,
                                     int index) {
  size_t val = index * 8;
  size_t addr = (size_t)addr_of_ptr;
  addr = addr + val;
  __softboundcets_metadata_load((void *)addr, base, bound, key, lock);
}


x86 assembly (clang, -O0):
<__softboundcets_metadata_load_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
shl    $0x3,%eax
cltq
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <__softboundcets_metadata_load@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundcets_metadata_load_vector>:
shl    $0x3,%r9d
movslq %r9d,%rax
add    %rax,%rdi
jmp    1030 <__softboundcets_metadata_load@plt>

LLVM IR (-O0):
define weak void @__softboundcets_metadata_load_vector(i8* %0, i8** %1, i8** %2, i64* %3, i8** %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i64*
%11 = alloca i8**
%12 = alloca i32
%13 = alloca i64
%14 = alloca i64
store i8* %0, i8** %7
store i8** %1, i8*** %8
store i8** %2, i8*** %9
store i64* %3, i64** %10
store i8** %4, i8*** %11
store i32 %5, i32* %12
%15 = load i32, i32* %12
%16 = mul nsw i32 %15, 8
%17 = sext i32 %16 to i64
store i64 %17, i64* %13
%18 = load i8*, i8** %7
%19 = ptrtoint i8* %18 to i64
store i64 %19, i64* %14
%20 = load i64, i64* %14
%21 = load i64, i64* %13
%22 = add i64 %20, %21
store i64 %22, i64* %14
%23 = load i64, i64* %14
%24 = inttoptr i64 %23 to i8*
%25 = load i8**, i8*** %8
%26 = load i8**, i8*** %9
%27 = load i64*, i64** %10
%28 = load i8**, i8*** %11
%29 = call i32 @__softboundcets_metadata_load(i8* %24, i8** %25, i8** %26, i64* %27, i8** %28)
ret void
}

LLVM IR (-O2):
define weak void @__softboundcets_metadata_load_vector(i8* %0, i8** %1, i8** %2, i64* %3, i8** %4, i32 %5) {
%7 = shl nsw i32 %5, 3
%8 = sext i32 %7 to i64
%9 = ptrtoint i8* %0 to i64
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @__softboundcets_metadata_load(i8* %11, i8** %1, i8** %2, i64* %3, i8** %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int x = 10;
  if (x == 100) {
    printf("x is 100\n");
  } else {
    printf("x is not 100\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jne    1141 <main+0x31>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    114d <main+0x3d>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [13 x i8] c"x is not 100\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int msg_getcmd(const char *msg) { return msg[4]; }


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

x86 assembly (clang, -O2):
<msg_getcmd>:
movsbl 0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @msg_getcmd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @msg_getcmd(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
int test_bit(int nr, volatile void *addr) {
  return ((1UL << (nr & 31)) & (((const unsigned int *)addr)[nr >> 5])) != 0;
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%rax
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edx
sar    $0x5,%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%ecx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,4),%ecx
xor    %eax,%eax
bt     %edi,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 31
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %3
%12 = ashr i32 %11, 5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
%16 = zext i32 %15 to i64
%17 = and i64 %8, %16
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i8* nocapture %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = bitcast i8* %1 to i32*
%7 = ashr i32 %0, 5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = zext i32 %10 to i64
%12 = and i64 %5, %11
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int info(char *text) { printf("INFO: %s\n", text); }


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

x86 assembly (clang, -O2):
<info>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"INFO: %s\0A\00"
define i32 @info(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ template_append(char **, char const *, size_t,
                                   char const **);
char *template_bake(const char *data, size_t len, const char **subst) {
  char *result = NULL;
  template_append(&result, data, len, subst);
  return result;
}


x86 assembly (clang, -O0):
<template_bake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%rdi
call   1030 <template_append@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<template_bake>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1030 <template_append@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @template_bake(i8* %0, i64 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8** %2, i8*** %6
store i8* null, i8** %7
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = load i8**, i8*** %6
%11 = call i32 @template_append(i8** %7, i8* %8, i64 %9, i8** %10)
%12 = load i8*, i8** %7
ret i8* %12
}

LLVM IR (-O2):
define i8* @template_bake(i8* %0, i64 %1, i8** %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
store i8* null, i8** %4
%6 = call i32 @template_append(i8** %4, i8* %0, i64 %1, i8** %2)
%7 = load i8*, i8** %4
ret i8* %7
}
/* Variables and functions */
int strlen(char *s) {
  int comprimento;
  for (comprimento = 1; *s != '\0'; s++) {
    ++comprimento;
  }
  return comprimento;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <strlen+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111b <strlen+0x1b>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *integrity_chassis_to_str(int chassis, char *str) {
  if (chassis == -1)
    return "n/a";
  sprintf(str, "%d", chassis);
  return str;
}


x86 assembly (clang, -O0):
<integrity_chassis_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1139 <integrity_chassis_to_str+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <integrity_chassis_to_str+0x44>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<integrity_chassis_to_str>:
push   %rbx
cmp    $0xffffffff,%edi
je     112c <integrity_chassis_to_str+0x1c>
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee2(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
jmp    1133 <integrity_chassis_to_str+0x23>
lea    0xecd(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"n/a\00"
@.str.1 = [3 x i8] c"%d\00"
define i8* @integrity_chassis_to_str(i32 %0, i8* writeonly %1) {
%3 = icmp eq i32 %0, -1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %1, %4 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %7
}
void f11(unsigned i) {
  int *x = 0;
  if (i >= 0) {
  } else {
    *x = 42;
  }
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jb     111e <f11+0x1e>
jmp    1128 <f11+0x28>
mov    -0x10(%rbp),%rax
movl   $0x2a,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f11(i32 %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_retrieve_quaddobl_term(int i, int j, int n, int *exp, double *c) {
  int a[3], fail;
  a[0] = n;
  a[1] = i;
  a[2] = j;
  fail = _ada_use_c2phc(385, a, exp, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_retrieve_quaddobl_term>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x181,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_retrieve_quaddobl_term>:
sub    $0x18,%rsp
mov    %edx,0xc(%rsp)
mov    %edi,0x10(%rsp)
mov    %esi,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x181,%edi
mov    %rcx,%rdx
mov    %r8,%rcx
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @syscon_retrieve_quaddobl_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca double*
%11 = alloca [3 x i32]
%12 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store double* %4, double** %10
%13 = load i32, i32* %8
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
store i32 %13, i32* %14
%15 = load i32, i32* %6
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 1
store i32 %15, i32* %16
%17 = load i32, i32* %7
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 2
store i32 %17, i32* %18
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %11, i64 0, i64 0
%20 = load i32*, i32** %9
%21 = load double*, double** %10
%22 = call i32 @_ada_use_c2phc(i32 385, i32* %19, i32* %20, double* %21)
store i32 %22, i32* %12
%23 = load i32, i32* %12
ret i32 %23
}

LLVM IR (-O2):
define i32 @syscon_retrieve_quaddobl_term(i32 %0, i32 %1, i32 %2, i32* %3, double* %4) {
%6 = alloca [3 x i32]
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %2, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %0, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %1, i32* %10
%11 = call i32 @_ada_use_c2phc(i32 385, i32* %8, i32* %3, double* %4)
ret i32 %11
}
int digit(char c) { return ('0' <= c && c <= '9'); }


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
jg     112d <digit+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sle i32 48, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
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 @digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ compare_strings(char *, char *);
char *perform_operation(char *, char);
char *perform_exponent(char buffer[]) {
  char *string = buffer;
  do {
    buffer = string;
    string = perform_operation(buffer, '^');
  } while (!compare_strings(buffer, string));
  return string;
}


x86 assembly (clang, -O0):
<perform_exponent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x5e,%esi
call   1030 <perform_operation@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <compare_strings@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <perform_exponent+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perform_exponent>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%r14
mov    %rbx,%rdi
mov    $0x5e,%esi
call   1030 <perform_operation@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <compare_strings@plt>
test   %eax,%eax
je     1130 <perform_exponent+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @perform_exponent(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %9, %1
%6 = load i8*, i8** %3
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @perform_operation(i8* %7, i8 signext 94)
store i8* %8, i8** %3
br label %9
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @compare_strings(i8* %10, i8* %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %5, label %15
15: ; preds = %9
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @perform_exponent(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = tail call i8* @perform_operation(i8* %3, i8 signext 94)
%5 = tail call i32 @compare_strings(i8* %3, i8* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
void view_boss_mode_on(void) { curs_set(1); }


x86 assembly (clang, -O0):
<view_boss_mode_on>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<view_boss_mode_on>:
mov    $0x1,%edi
jmp    1030 <curs_set@plt>

LLVM IR (-O0):
define void @view_boss_mode_on() {
%1 = call i32 @curs_set(i32 1)
ret void
}

LLVM IR (-O2):
define void @view_boss_mode_on() {
%1 = tail call i32 @curs_set(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _audio_ic_write(unsigned int);
unsigned int audio_ic_read(unsigned int);
void masked_audio_ic_write(unsigned reg, unsigned mask, unsigned bits) {
  unsigned old, new;
  old = audio_ic_read(reg - 0x100);
  new = (old & ~mask) | (bits & mask);
  _audio_ic_write(reg | new);
}


x86 assembly (clang, -O0):
<masked_audio_ic_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x100,%edi
call   1040 <audio_ic_read@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0xc(%rbp),%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
or     -0x14(%rbp),%edi
call   1030 <_audio_ic_write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<masked_audio_ic_write>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
lea    -0x100(%r14),%edi
call   1040 <audio_ic_read@plt>
and    %ebp,%ebx
not    %ebp
and    %eax,%ebp
or     %r14d,%ebx
or     %ebp,%ebx
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <_audio_ic_write@plt>

LLVM IR (-O0):
define void @masked_audio_ic_write(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = sub i32 %9, 256
%11 = call i32 @audio_ic_read(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = and i32 %16, %17
%19 = or i32 %15, %18
store i32 %19, i32* %8
%20 = load i32, i32* %4
%21 = load i32, i32* %8
%22 = or i32 %20, %21
%23 = call i32 @_audio_ic_write(i32 %22)
ret void
}

LLVM IR (-O2):
define void @masked_audio_ic_write(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %0, -256
%5 = tail call i32 @audio_ic_read(i32 %4)
%6 = xor i32 %1, -1
%7 = and i32 %5, %6
%8 = and i32 %2, %1
%9 = or i32 %8, %0
%10 = or i32 %9, %7
%11 = tail call i32 @_audio_ic_write(i32 %10)
ret void
}
/* Variables and functions */
int readchar();
void wait_for(int ch) {
  register char c;
  if (ch == '\n')
    while ((c = readchar()) != '\n' && c != '\r')
      continue;
  else
    while (readchar() != ch)
      continue;
}


x86 assembly (clang, -O0):
<wait_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    116c <wait_for+0x5c>
jmp    112a <wait_for+0x1a>
mov    $0x0,%al
call   1030 <readchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x6(%rbp)
je     1152 <wait_for+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    1162 <wait_for+0x52>
jmp    1167 <wait_for+0x57>
jmp    112a <wait_for+0x1a>
jmp    118b <wait_for+0x7b>
jmp    1171 <wait_for+0x61>
mov    $0x0,%al
call   1030 <readchar@plt>
cmp    -0x4(%rbp),%eax
je     1186 <wait_for+0x76>
jmp    1171 <wait_for+0x61>
jmp    118b <wait_for+0x7b>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for>:
push   %rbx
cmp    $0xa,%edi
jne    113a <wait_for+0x2a>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <readchar@plt>
shl    $0x18,%eax
cmp    $0xa000000,%eax
je     114b <wait_for+0x3b>
cmp    $0xd000000,%eax
jne    1120 <wait_for+0x10>
jmp    114b <wait_for+0x3b>
mov    %edi,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <readchar@plt>
cmp    %ebx,%eax
jne    1140 <wait_for+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait_for(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %20
6: ; preds = %1
br label %7
7: ; preds = %18, %6
%8 = call i32 (...) @readchar()
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 13
br label %16
16: ; preds = %12, %7
%17 = phi i1 [ false, %7 ], [ %15, %12 ]
br i1 %17, label %18, label %19
18: ; preds = %16
br label %7
19: ; preds = %16
br label %27
20: ; preds = %1
br label %21
21: ; preds = %25, %20
%22 = call i32 (...) @readchar()
%23 = load i32, i32* %2
%24 = icmp ne i32 %22, %23
br i1 %24, label %25, label %26
25: ; preds = %21
br label %21
26: ; preds = %21
br label %27
27: ; preds = %26, %19
ret void
}

LLVM IR (-O2):
define void @wait_for(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1, %3
%4 = tail call i32 (...) @readchar()
%5 = shl i32 %4, 24
switch i32 %5, label %3 [
i32 218103808, label %9
i32 167772160, label %9
]
6: ; preds = %1, %6
%7 = tail call i32 (...) @readchar()
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %6
9: ; preds = %6, %3, %3
ret void
}
int is_prime(int n) {
  int i;
  for (i = 2; i < n; i++) {
    if (n % i == 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1149 <is_prime+0x49>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1136 <is_prime+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1150 <is_prime+0x50>
jmp    113b <is_prime+0x3b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
/* Variables and functions */
char tolower(char);
char asymbol(char t) { return tolower(t); }


x86 assembly (clang, -O0):
<asymbol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <tolower@plt>
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asymbol>:
jmp    1030 <tolower@plt>

LLVM IR (-O0):
define signext i8 @asymbol(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call signext i8 @tolower(i8 signext %3)
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @asymbol(i8 signext %0) {
%2 = tail call signext i8 @tolower(i8 signext %0)
ret i8 %2
}
/* Variables and functions */
int sinc(int);
double hn_lpf(int n, double lpf, double fs) {
  double t = 1 / fs;
  double omega = 2 * 3.1415926535897932384626433832795028842 * lpf;
  return 2 * lpf * t * sinc(n * omega * t);
}


x86 assembly (clang, -O0):
<hn_lpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  0xee3(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec9(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeaf(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sinc@plt>
movsd  -0x30(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
mulsd  %xmm1,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hn_lpf>:
push   %rax
movsd  0xee7(%rip),%xmm3
divsd  %xmm1,%xmm3
movsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm0,%xmm0
mulsd  %xmm3,%xmm0
movsd  %xmm0,(%rsp)
cvtsi2sd %edi,%xmm2
mulsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
cvttsd2si %xmm2,%edi
call   1030 <sinc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @hn_lpf(i32 %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %6
%10 = fdiv double 1.000000e+00, %9
store double %10, double* %7
%11 = load double, double* %5
%12 = fmul double 0x401921FB54442D18, %11
store double %12, double* %8
%13 = load double, double* %5
%14 = fmul double 2.000000e+00, %13
%15 = load double, double* %7
%16 = fmul double %14, %15
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to double
%19 = load double, double* %8
%20 = fmul double %18, %19
%21 = load double, double* %7
%22 = fmul double %20, %21
%23 = fptosi double %22 to i32
%24 = call i32 @sinc(i32 %23)
%25 = sitofp i32 %24 to double
%26 = fmul double %16, %25
ret double %26
}

LLVM IR (-O2):
define double @hn_lpf(i32 %0, double %1, double %2) {
%4 = fdiv double 1.000000e+00, %2
%5 = fmul double %1, 0x401921FB54442D18
%6 = fmul double %1, 2.000000e+00
%7 = fmul double %6, %4
%8 = sitofp i32 %0 to double
%9 = fmul double %5, %8
%10 = fmul double %9, %4
%11 = fptosi double %10 to i32
%12 = tail call i32 @sinc(i32 %11)
%13 = sitofp i32 %12 to double
%14 = fmul double %7, %13
ret double %14
}
/* Variables and functions */
char *legible_1(char *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned long);
char *legible_very_long(unsigned long l) {
  char inbuf[128];
  sprintf(inbuf, "%lu", l);
  return legible_1(inbuf);
}


x86 assembly (clang, -O0):
<legible_very_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <legible_1@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<legible_very_long>:
push   %rbx
sub    $0x80,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <legible_1@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lu\00"
define i8* @legible_very_long(i64 %0) {
%2 = alloca i64
%3 = alloca [128 x i8]
store i64 %0, i64* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i64, i64* %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = call i8* @legible_1(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define i8* @legible_very_long(i64 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%5 = call i8* @legible_1(i8* %3)
ret i8* %5
}
double fabs(double x) {
  *(((int *)&x) + 1) &= 0x7fffffff;
  return x;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffffff,%eax
mov    %eax,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 2147483647
store i32 %6, i32* %4
%7 = load double, double* %2
ret double %7
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = bitcast double %0 to i64
%3 = and i64 %2, 9223372036854775807
%4 = bitcast i64 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init(void) { srandom(time(NULL)); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srandom(i32 %1)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srandom(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MessageBufferLayerP__0__RadioSend__ready();
void RandomCollisionLayerP__0__RadioSend__ready(void) {
  MessageBufferLayerP__0__RadioSend__ready();
}


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

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

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

LLVM IR (-O2):
define void @RandomCollisionLayerP__0__RadioSend__ready() {
%1 = tail call i32 (...) @MessageBufferLayerP__0__RadioSend__ready()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *strnlen;
int main(int argc, char *argv[]) {
  void *p;
  (void)argc;
  (void)argv;
  p = strnlen;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@strnlen = global i8* null
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 = load i8**, i8*** %5
%9 = load i8*, i8** @strnlen
store i8* %9, i8** %6
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@strnlen = global i8* null
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}