xunge/DecIR huggingface dataset:
/* Type definitions */
struct j_state {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ i_instr_rm(struct j_state *, int, int, int /*<<< orphan*/,
                              int, int, int /*<<< orphan*/, size_t);
void i_load_c(struct j_state *s, int reg, int base, int64_t off, size_t size,
              int cond) {
  i_instr_rm(s, 1, 0x40 + cond, 0, reg, base, off, size);
}


x86 assembly (clang, -O0):
<i_load_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
add    $0x40,%edx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
mov    -0x14(%rbp),%r10d
mov    -0x20(%rbp),%rax
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <i_instr_rm@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_load_c>:
push   %rax
mov    %r8,%r11
mov    %ecx,%r10d
mov    %edx,%eax
mov    %esi,%r8d
lea    0x40(%r9),%edx
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %eax,%r9d
push   %r11
push   %r10
call   1030 <i_instr_rm@plt>
add    $0x10,%rsp
pop    %rax
ret

LLVM IR (-O0):
%struct.j_state = type { i32 }
define void @i_load_c(%struct.j_state* %0, i32 %1, i32 %2, i32 %3, i64 %4, i32 %5) {
%7 = alloca %struct.j_state*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i32
store %struct.j_state* %0, %struct.j_state** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i64 %4, i64* %11
store i32 %5, i32* %12
%13 = load %struct.j_state*, %struct.j_state** %7
%14 = load i32, i32* %12
%15 = add nsw i32 64, %14
%16 = load i32, i32* %8
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i64, i64* %11
%20 = call i32 @i_instr_rm(%struct.j_state* %13, i32 1, i32 %15, i32 0, i32 %16, i32 %17, i32 %18, i64 %19)
ret void
}

LLVM IR (-O2):
%struct.j_state = type { i32 }
define void @i_load_c(%struct.j_state* %0, i32 %1, i32 %2, i32 %3, i64 %4, i32 %5) {
%7 = add nsw i32 %5, 64
%8 = tail call i32 @i_instr_rm(%struct.j_state* %0, i32 1, i32 %7, i32 0, i32 %1, i32 %2, i32 %3, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x4c() {
  Assert_real((isalnum(76)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              385, ("isalnum should be 1 for L"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x4c>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4c,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x181,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x4c>:
push   %rax
mov    $0x4c,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x181,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for L\00"
define void @t_isalnum_0x4c() {
%1 = call i32 @isalnum(i32 76)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for L\00"
define void @t_isalnum_0x4c() {
%1 = tail call i32 @isalnum(i32 76)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 385, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint8_t *navdata_unpack_option(uint8_t *navdata_ptr, uint8_t *data,
                               uint32_t size) {
  memcpy(data, navdata_ptr, size);
  return (navdata_ptr + size);
}


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

x86 assembly (clang, -O2):
<navdata_unpack_option>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
call   1030 <memcpy@plt>
movslq %ebp,%rax
lea    (%rbx,%rax,4),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @navdata_unpack_option(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = call i32 @memcpy(i32* %7, i32* %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %6
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
ret i32* %14
}

LLVM IR (-O2):
define i32* @navdata_unpack_option(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @memcpy(i32* %1, i32* %0, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
ret i32* %6
}
int main(void) {
  double lower = 99.5, upper = 99.6;
  int one = 1, two = 2, ninetynine = 99;
  if (lower > upper || ninetynine) {
    return 40 + (one < two || one < two) + (ninetynine || ninetynine);
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xef5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x2,-0x20(%rbp)
movl   $0x63,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1154 <main+0x54>
cmpl   $0x0,-0x24(%rbp)
je     11ae <main+0xae>
mov    -0x1c(%rbp),%ecx
mov    $0x1,%al
cmp    -0x20(%rbp),%ecx
mov    %al,-0x25(%rbp)
jl     1171 <main+0x71>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
setl   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x28,%eax
mov    %eax,-0x2c(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x26(%rbp)
jne    1198 <main+0x98>
cmpl   $0x0,-0x24(%rbp)
setne  %al
mov    %al,-0x26(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x26(%rbp),%cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11b5 <main+0xb5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store double 9.950000e+01, double* %2
store double 0x4058E66666666666, double* %3
store i32 1, i32* %4
store i32 2, i32* %5
store i32 99, i32* %6
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fcmp ogt double %7, %8
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = load i32, i32* %6
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %34
13: ; preds = %10, %0
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %21, label %17
17: ; preds = %13
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = icmp slt i32 %18, %19
br label %21
21: ; preds = %17, %13
%22 = phi i1 [ true, %13 ], [ %20, %17 ]
%23 = zext i1 %22 to i32
%24 = add nsw i32 40, %23
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %21
%28 = load i32, i32* %6
%29 = icmp ne i32 %28, 0
br label %30
30: ; preds = %27, %21
%31 = phi i1 [ true, %21 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
%33 = add nsw i32 %24, %32
store i32 %33, i32* %1
br label %35
34: ; preds = %10
store i32 0, i32* %1
br label %35
35: ; preds = %34, %30
%36 = load i32, i32* %1
ret i32 %36
}

LLVM IR (-O2):
define i32 @main() {
ret i32 42
}
/* Variables and functions */
int strcmp(char *, char *);
int comparo(void *key1, void *key2) {
  return strcmp((char *)key1, (char *)key2);
}


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

LLVM IR (-O0):
define i32 @comparo(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 @comparo(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, ...);
int /*<<< orphan*/ stderr;
void _die(char *msg, int line, char *file) {
  fprintf(stderr, "Fatal error: %s\n", msg);
  fprintf(stderr, "Death occurred at %s, line %d\n", file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_die>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rdx
mov    0x2ead(%rip),%r14
mov    (%r14),%edi
lea    0xec3(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xec3(%rip),%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal error: %s\0A\00"
@.str.1 = [31 x i8] c"Death occurred at %s, line %d\0A\00"
define void @_die(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i32, i32* @stderr
%11 = load i8*, i8** %6
%12 = load i32, i32* %5
%13 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %11, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Fatal error: %s\0A\00"
@.str.1 = [31 x i8] c"Death occurred at %s, line %d\0A\00"
define void @_die(i8* %0, i32 %1, i8* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %1)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void reverse(int number) {
  int i;
  while (number != 0) {
    i = number % 10;
    printf("%d", i);
    number = number / 10;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1157 <reverse+0x47>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    111b <reverse+0xb>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
push   %r15
push   %r14
push   %rbx
test   %edi,%edi
je     1176 <reverse+0x56>
mov    %edi,%ebx
lea    0xece(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %ebx,%r15
imul   $0x66666667,%r15,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x22,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,1),%eax
lea    (%rax,%rax,4),%eax
mov    %r15d,%esi
sub    %eax,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x9,%r15d
cmp    $0x12,%r15d
ja     1140 <reverse+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = srem i32 %4, 10
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = sdiv i32 %4, 10
%8 = add i32 %4, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = tail call i32 @putchar(i32 10)
ret void
}
unsigned int to_abs_x(struct tsm_screen *con, unsigned int x) { return x; }


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

x86 assembly (clang, -O2):
<to_abs_x>:
mov    %esi,%eax
ret

LLVM IR (-O0):
%struct.tsm_screen = type opaque
define i32 @to_abs_x(%struct.tsm_screen* %0, i32 %1) {
%3 = alloca %struct.tsm_screen*
%4 = alloca i32
store %struct.tsm_screen* %0, %struct.tsm_screen** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.tsm_screen = type opaque
define i32 @to_abs_x(%struct.tsm_screen* nocapture readnone %0, i32 returned %1) {
ret i32 %1
}
void init() { return; }


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

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

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

LLVM IR (-O2):
define void @init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Clock_Init();
int /*<<< orphan*/ Uart_Init();
int /*<<< orphan*/ Uart_Printf(char *);
void Target_Init() {
  Clock_Init();
  Uart_Init();
  Uart_Printf("Hello UCOS2\n");
}


x86 assembly (clang, -O0):
<Target_Init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <Clock_Init@plt>
mov    $0x0,%al
call   1040 <Uart_Init@plt>
lea    0xeb7(%rip),%rdi
call   1030 <Uart_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Target_Init>:
push   %rax
xor    %eax,%eax
call   1050 <Clock_Init@plt>
xor    %eax,%eax
call   1040 <Uart_Init@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1030 <Uart_Printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello UCOS2\0A\00"
define void @Target_Init() {
%1 = call i32 (...) @Clock_Init()
%2 = call i32 (...) @Uart_Init()
%3 = call i32 @Uart_Printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello UCOS2\0A\00"
define void @Target_Init() {
%1 = tail call i32 (...) @Clock_Init()
%2 = tail call i32 (...) @Uart_Init()
%3 = tail call i32 @Uart_Printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mrand48();
long getrand() { return mrand48() & 3; }


x86 assembly (clang, -O0):
<getrand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <mrand48@plt>
and    $0x3,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrand>:
push   %rax
xor    %eax,%eax
call   1030 <mrand48@plt>
and    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @getrand() {
%1 = call i32 (...) @mrand48()
%2 = and i32 %1, 3
%3 = sext i32 %2 to i64
ret i64 %3
}

LLVM IR (-O2):
define i64 @getrand() {
%1 = tail call i32 (...) @mrand48()
%2 = and i32 %1, 3
%3 = zext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int g(int *, int *);
int main(void) {
  int a = 5;
  return g(&a, &a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rsi
mov    %rsi,%rdi
call   1030 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    %rdi,%rsi
call   1030 <g@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%3 = call i32 @g(i32* %2, i32* %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 5, i32* %1
%3 = call i32 @g(i32* %1, i32* %1)
ret i32 %3
}
struct bwb_line *bwb_SELECT(struct bwb_line *l) {
  bwx_DEBUG(__FUNCTION__);
  bwb_error("SELECT without CASE");
  return bwb_zline(l);
}


x86 assembly (clang, -O0):
<bwb_SELECT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <bwx_DEBUG@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <bwb_error@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <bwb_zline@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwb_SELECT>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <bwx_DEBUG@plt>
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <bwb_error@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <bwb_zline@plt>
cltq
pop    %rbx
ret

LLVM IR (-O0):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_SELECT = [11 x i8] c"bwb_SELECT\00"
@.str = [20 x i8] c"SELECT without CASE\00"
define %struct.bwb_line* @bwb_SELECT(%struct.bwb_line* %0) {
%2 = alloca %struct.bwb_line*
store %struct.bwb_line* %0, %struct.bwb_line** %2
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_SELECT, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @bwb_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%5 = load %struct.bwb_line*, %struct.bwb_line** %2
%6 = call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %5)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.bwb_line*
ret %struct.bwb_line* %8
}

LLVM IR (-O2):
%struct.bwb_line = type opaque
@__FUNCTION__.bwb_SELECT = [11 x i8] c"bwb_SELECT\00"
@.str = [20 x i8] c"SELECT without CASE\00"
define %struct.bwb_line* @bwb_SELECT(%struct.bwb_line* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwx_DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.bwb_SELECT, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bwb_error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (%struct.bwb_line*, ...) bitcast (i32 (...)* @bwb_zline to i32 (%struct.bwb_line*, ...)*)(%struct.bwb_line* %0)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.bwb_line*
ret %struct.bwb_line* %6
}
regx0adr1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[x0]) <= (*((unsigned short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0adr1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
mov    $0xa98ac7,%ecx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1147 <regx0adr1+0x47>
movl   $0x1,-0x4(%rbp)
jmp    114e <regx0adr1+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0adr1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%ecx
xor    %eax,%eax
cmp    0xa98ac7,%cx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @regx0adr1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = load i16, i16* inttoptr (i64 11111111 to i16*)
%11 = icmp ule i16 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void dss_write_ctrl(uint8_t val, void *p) {}


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

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

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

LLVM IR (-O2):
define void @dss_write_ctrl(i32 %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int __posix_fadvise50(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int);
int posix_fadvise(int fd, off_t offset, off_t size, int hint) {
  return __posix_fadvise50(fd, 0, offset, size, hint);
}


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

x86 assembly (clang, -O2):
<posix_fadvise>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <__posix_fadvise50@plt>

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

LLVM IR (-O2):
define i32 @posix_fadvise(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @__posix_fadvise50(i32 %0, i32 0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
void __kernel_cos(void) {}


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

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

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

LLVM IR (-O2):
define void @__kernel_cos() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set(int, int, int, int, int, int);
void hlen_vs_alpha(int y, int invert) {
  set(100, y, 300, y + 320, (invert ? 0x7F : 0), 0x0001 | 0x0010);
  set(100, y, 500, y + 320, (invert ? 0 : 0x7F), 0x0001 | 0x0010);
}


x86 assembly (clang, -O0):
<hlen_vs_alpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%ecx
add    $0x140,%ecx
mov    -0x8(%rbp),%edx
xor    %r8d,%r8d
mov    $0x7f,%eax
cmp    $0x0,%edx
cmovne %eax,%r8d
mov    $0x64,%edi
mov    $0x12c,%edx
mov    $0x11,%r9d
call   1030 <set@plt>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%ecx
add    $0x140,%ecx
mov    -0x8(%rbp),%edx
mov    $0x7f,%r8d
xor    %eax,%eax
cmp    $0x0,%edx
cmovne %eax,%r8d
mov    $0x64,%edi
mov    $0x1f4,%edx
mov    $0x11,%r9d
call   1030 <set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hlen_vs_alpha>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r8d
mov    %edi,%ebx
lea    0x140(%rbx),%r14d
xor    %ebp,%ebp
test   %esi,%esi
mov    $0x7f,%eax
cmovne %eax,%r8d
cmove  %eax,%ebp
mov    $0x64,%edi
mov    %ebx,%esi
mov    $0x12c,%edx
mov    %r14d,%ecx
mov    $0x11,%r9d
call   1030 <set@plt>
mov    $0x64,%edi
mov    %ebx,%esi
mov    $0x1f4,%edx
mov    %r14d,%ecx
mov    %ebp,%r8d
mov    $0x11,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <set@plt>

LLVM IR (-O0):
define void @hlen_vs_alpha(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 320
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 127, i32 0
%12 = call i32 @set(i32 100, i32 %5, i32 300, i32 %7, i32 %11, i32 17)
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 320
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 0, i32 127
%20 = call i32 @set(i32 100, i32 %13, i32 500, i32 %15, i32 %19, i32 17)
ret void
}

LLVM IR (-O2):
define void @hlen_vs_alpha(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 320
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 0, i32 127
%6 = tail call i32 @set(i32 100, i32 %0, i32 300, i32 %3, i32 %5, i32 17)
%7 = select i1 %4, i32 127, i32 0
%8 = tail call i32 @set(i32 100, i32 %0, i32 500, i32 %3, i32 %7, i32 17)
ret void
}
void __bitmap_equal(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<__bitmap_equal>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bitmap_equal>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.__bitmap_equal = [15 x i8] c"__bitmap_equal\00"
define void @__bitmap_equal() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.__bitmap_equal, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.__bitmap_equal = [15 x i8] c"__bitmap_equal\00"
define void @__bitmap_equal() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.__bitmap_equal, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(void) {
  int ipaddr = (192 << 24 | 168 << 16 | 0 << 8 | 1);
  printf("ip address: "
         "%d.%d.%d.%d"
         "\n",
         (((ipaddr & 0xff000000) >> 24) & 0xff), ((ipaddr & 0xff0000) >> 16),
         ((ipaddr & 0xff00) >> 8), (ipaddr & 0xff));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc0a80001,-0x8(%rbp)
mov    -0x8(%rbp),%esi
and    $0xff000000,%esi
shr    $0x18,%esi
and    $0xff,%esi
mov    -0x8(%rbp),%edx
and    $0xff0000,%edx
sar    $0x10,%edx
mov    -0x8(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%r8d
and    $0xff,%r8d
lea    0xe9e(%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
mov    $0xc0,%esi
mov    $0xa8,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"ip address: %d.%d.%d.%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1062731775, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = and i32 %5, 255
%7 = load i32, i32* %2
%8 = and i32 %7, 16711680
%9 = ashr i32 %8, 16
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = ashr i32 %11, 8
%13 = load i32, i32* %2
%14 = and i32 %13, 255
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"ip address: %d.%d.%d.%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 192, i32 168, i32 0, i32 1)
ret i32 0
}
unsigned int __inlc(unsigned short port) {
  unsigned int _v;
  __asm__ __volatile__("in"
                       "l"
                       " %"
                       ""
                       "1,%"
                       ""
                       "0"
                       : "=a"(_v)
                       : "id"(port));
  return _v;
}


x86 assembly (clang, -O0):
<__inlc>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__inlc>:
mov    %edi,%edx
in     (%dx),%eax
ret

LLVM IR (-O0):
define i32 @__inlc(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i32 asm sideeffect "inl $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @__inlc(i16 zeroext %0) {
%2 = tail call i32 asm sideeffect "inl $1,$0", "={ax},i{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i32 %2
}
void foo_1_1_1_1_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_1_1_2_2_2_2() {
ret void
}
long long int factorial(long long int n) {
  return n <= 1 ? 1 : n * factorial(n - 1);
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jg     1135 <factorial+0x25>
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    1159 <factorial+0x49>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1121 <factorial+0x21>
mov    $0x1,%eax
imul   %rdi,%rax
lea    -0x1(%rdi),%rcx
cmp    $0x2,%rdi
mov    %rcx,%rdi
ja     1110 <factorial+0x10>
ret

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

LLVM IR (-O2):
define i64 @factorial(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = add nsw i64 %4, -1
%7 = mul nsw i64 %4, %5
%8 = icmp ult i64 %4, 3
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Your test code goes here.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Your test code goes here.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"Your test code goes here.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
cbuf30(f, n) int f, n;
{ cbuf(f, n, 30); }


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

x86 assembly (clang, -O2):
<cbuf30>:
mov    $0x1e,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf30(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %6, i32 %7, i32 30)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @cbuf30(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 30)
ret i32 undef
}
int d_blg_rr2(double a1, double a2) {
  return !(__builtin_islessgreater(a1, a2));
}


x86 assembly (clang, -O0):
<d_blg_rr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blg_rr2>:
xor    %eax,%eax
ucomisd %xmm1,%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @d_blg_rr2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp one double %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_blg_rr2(double %0, double %1) {
%3 = fcmp ueq double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double CurrentFontSize();
int script_size(void) { return (int)(CurrentFontSize() / 1.2); }


x86 assembly (clang, -O0):
<script_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <CurrentFontSize@plt>
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_size>:
push   %rax
xor    %eax,%eax
call   1030 <CurrentFontSize@plt>
divsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @script_size() {
%1 = call double (...) @CurrentFontSize()
%2 = fdiv double %1, 1.200000e+00
%3 = fptosi double %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @script_size() {
%1 = tail call double (...) @CurrentFontSize()
%2 = fdiv double %1, 1.200000e+00
%3 = fptosi double %2 to i32
ret i32 %3
}
void g_node_first_sibling() {}


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

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

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

LLVM IR (-O2):
define void @g_node_first_sibling() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _printf_putls(int, int, int);
void putdec(int i) { _printf_putls(i, 10, 1); }


x86 assembly (clang, -O0):
<putdec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
mov    $0x1,%edx
call   1030 <_printf_putls@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putdec>:
mov    $0xa,%esi
mov    $0x1,%edx
jmp    1030 <_printf_putls@plt>

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

LLVM IR (-O2):
define void @putdec(i32 %0) {
%2 = tail call i32 @_printf_putls(i32 %0, i32 10, i32 1)
ret void
}
void NOR_SPI_EnableRxInt(void) {}


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

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

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

LLVM IR (-O2):
define void @NOR_SPI_EnableRxInt() {
ret void
}
void func1() { return; }


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

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

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

LLVM IR (-O2):
define void @func1() {
ret void
}
int hash_plugin_hash_length(void) { return 32; }


x86 assembly (clang, -O0):
<hash_plugin_hash_length>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash_plugin_hash_length() {
ret i32 32
}

LLVM IR (-O2):
define i32 @hash_plugin_hash_length() {
ret i32 32
}
void avcodec_find_best_pix_fmt2() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_find_best_pix_fmt2() {
ret void
}
void save_int(char *p, int n) {
  p[0] = n;
  p[1] = n >> 8;
  p[2] = n >> 16;
  p[3] = n >> 24;
}


x86 assembly (clang, -O0):
<save_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<save_int>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @save_int(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PlayTone(int, int);
int /*<<< orphan*/ Wait(int);
void Whistle() {
  PlayTone(700, 100);
  Wait(100);
}


x86 assembly (clang, -O0):
<Whistle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2bc,%edi
mov    $0x64,%esi
call   1030 <PlayTone@plt>
mov    $0x64,%edi
call   1040 <Wait@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Whistle>:
push   %rax
mov    $0x2bc,%edi
mov    $0x64,%esi
call   1030 <PlayTone@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <Wait@plt>

LLVM IR (-O0):
define void @Whistle() {
%1 = call i32 @PlayTone(i32 700, i32 100)
%2 = call i32 @Wait(i32 100)
ret void
}

LLVM IR (-O2):
define void @Whistle() {
%1 = tail call i32 @PlayTone(i32 700, i32 100)
%2 = tail call i32 @Wait(i32 100)
ret void
}
void _used(long a, ...) {
  if (a) {
  }
}


x86 assembly (clang, -O0):
<_used>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <_used+0x18>
jmp    1118 <_used+0x18>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_used(i64 %0, ...) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @_used(i64 %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output(char *);
void printCPUUserInfo(const char *cmd) {
  (void)cmd;
  output("CPU User Load\t0\t100\t%%\n");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"CPU User Load\090\09100\09%%\0A\00"
define void @printCPUUserInfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @output(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"CPU User Load\090\09100\09%%\0A\00"
define void @printCPUUserInfo(i8* nocapture readnone %0) {
%2 = tail call i32 @output(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seek_blk(int /*<<< orphan*/);
void dfi_s390tape_exit(void) { seek_blk(0); }


x86 assembly (clang, -O0):
<dfi_s390tape_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <seek_blk@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @dfi_s390tape_exit() {
%1 = call i32 @seek_blk(i32 0)
ret void
}

LLVM IR (-O2):
define void @dfi_s390tape_exit() {
%1 = tail call i32 @seek_blk(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vtputc(int /*<<< orphan*/);
int vtputs(const char *s) {
  int n = 0;
  while (*s != '\0') {
    vtputc(*s++);
    ++n;
  }
  return (n);
}


x86 assembly (clang, -O0):
<vtputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1158 <vtputs+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <vtputc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <vtputs+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtputs>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1138 <vtputs+0x28>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <vtputc@plt>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <vtputs+0x10>
jmp    113a <vtputs+0x2a>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @vtputs(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %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 %17
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 @vtputc(i32 %13)
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @vtputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @vtputc(i32 %8)
%11 = add nuw nsw i32 %6, 1
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c, d, h;
  scanf("%d", &h);
  if (h != 0) {
    while (a < 50) {
      if (b < c)
        d = 100;
      else
        d = 50;
    }
  } else {
    while (a < 50) {
      if (b >= c)
        d = 200;
      else
        d = 150;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <scanf@plt>
cmpl   $0x0,-0x18(%rbp)
je     1171 <main+0x61>
jmp    113e <main+0x2e>
cmpl   $0x32,-0x8(%rbp)
jge    116c <main+0x5c>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1160 <main+0x50>
movl   $0x64,-0x14(%rbp)
jmp    1167 <main+0x57>
movl   $0x32,-0x14(%rbp)
jmp    113e <main+0x2e>
jmp    11a9 <main+0x99>
jmp    1176 <main+0x66>
cmpl   $0x32,-0x8(%rbp)
jge    11a4 <main+0x94>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1198 <main+0x88>
movl   $0xc8,-0x14(%rbp)
jmp    119f <main+0x8f>
movl   $0x96,-0x14(%rbp)
jmp    1176 <main+0x66>
jmp    11a9 <main+0x99>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %0
br label %11
11: ; preds = %20, %10
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 50
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 100, i32* %5
br label %20
19: ; preds = %14
store i32 50, i32* %5
br label %20
20: ; preds = %19, %18
br label %11
21: ; preds = %11
br label %34
22: ; preds = %0
br label %23
23: ; preds = %32, %22
%24 = load i32, i32* %2
%25 = icmp slt i32 %24, 50
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = icmp sge i32 %27, %28
br i1 %29, label %30, label %31
30: ; preds = %26
store i32 200, i32* %5
br label %32
31: ; preds = %26
store i32 150, i32* %5
br label %32
32: ; preds = %31, %30
br label %23
33: ; preds = %23
br label %34
34: ; preds = %33, %21
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret i32 0
}