xunge/DecIR huggingface dataset:
unsigned long get4Bytes(unsigned char *addr) {
  return (unsigned long)addr[0] << 24 | (unsigned long)addr[1] << 16 |
         (unsigned long)addr[2] << 8 | (unsigned long)addr[3] << 0;
}


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

x86 assembly (clang, -O2):
<get4Bytes>:
mov    (%rdi),%eax
shl    $0x20,%rax
bswap  %rax
ret

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

LLVM IR (-O2):
define i64 @get4Bytes(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %7, 16
%9 = or i64 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = shl nuw nsw i64 %12, 8
%14 = or i64 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = or i64 %14, %17
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void crumbwrap_syntax(void) {
  fprintf(stderr, "syntax:\n");
  fprintf(stderr, "    crumbwrap [-h] [-s] [-f <stdin> <stdout>]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<crumbwrap_syntax>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crumbwrap_syntax>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"syntax:\0A\00"
@.str.1 = [47 x i8] c" crumbwrap [-h] [-s] [-f <stdin> <stdout>]\0A\00"
define void @crumbwrap_syntax() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"syntax:\0A\00"
@.str.1 = [47 x i8] c" crumbwrap [-h] [-s] [-f <stdin> <stdout>]\0A\00"
define void @crumbwrap_syntax() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ serial_putchar(char);
void serial_print(const char *p) {
  while (*p) {
    char c = *p++;
    if (c == '\n')
      serial_putchar('\r');
    serial_putchar(c);
  }
}


x86 assembly (clang, -O0):
<serial_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <serial_print+0x52>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    1154 <serial_print+0x44>
mov    $0xd,%edi
call   1030 <serial_putchar@plt>
movsbl -0x9(%rbp),%edi
call   1030 <serial_putchar@plt>
jmp    111c <serial_print+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_print>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1157 <serial_print+0x47>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    1145 <serial_print+0x35>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %bpl,%edi
call   1030 <serial_putchar@plt>
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
je     1157 <serial_print+0x47>
cmp    $0xa,%bpl
jne    1130 <serial_print+0x20>
mov    $0xd,%edi
call   1030 <serial_putchar@plt>
jmp    1130 <serial_print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @serial_print(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %20
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8, i8* %9
store i8 %11, i8* %3
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = call i32 @serial_putchar(i8 signext 13)
br label %17
17: ; preds = %15, %8
%18 = load i8, i8* %3
%19 = call i32 @serial_putchar(i8 signext %18)
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @serial_print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %7, %11 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = icmp eq i8 %5, 10
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @serial_putchar(i8 signext 13)
br label %11
11: ; preds = %9, %4
%12 = tail call i32 @serial_putchar(i8 signext %5)
%13 = load i8, i8* %7
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
int f229(int *);
int f230(int *p) { return f229(p); }


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

x86 assembly (clang, -O2):
<f230>:
jmp    1030 <f229@plt>

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

LLVM IR (-O2):
define i32 @f230(i32* %0) {
%2 = tail call i32 @f229(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void func1() { print("how long alarm  \nwill work "); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"how long alarm \0Awill work \00"
define void @func1() {
%1 = call i32 @print(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"how long alarm \0Awill work \00"
define void @func1() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void my_assert(int cond) {
  if (!cond) {
    printf("Test failed!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<my_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114f <my_assert+0x2f>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_assert>:
test   %edi,%edi
je     1125 <my_assert+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Test failed!\00"
@EXIT_FAILURE = global i32 0
define void @my_assert(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Test failed!\00"
@EXIT_FAILURE = global i32 0
define void @my_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
int SATinstance(int *ptr) { return ptr[-2]; }


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

x86 assembly (clang, -O2):
<SATinstance>:
mov    -0x8(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @SATinstance(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -2
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
double log(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main(void) {
  double x;
  double result;
  printf("x: ");
  scanf("%lf", &x);
  result = log(x);
  printf("log(%lf) = %lf\n", x, result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe8b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <log@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
lea    0xea1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"x: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [16 x i8] c"log(%lf) = %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
%6 = call double @log(double %5)
%7 = load double, double* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %7, double %6)
ret i32 0
}
int __attribute__((no)) imulv(int a, int b) { return a * b; }


x86 assembly (clang, -O0):
<imulv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @imulv(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
char _Locale_frac_digits(struct _Locale_monetary *lmon
                         __attribute__((__unused__))) {
  return 0;
}


x86 assembly (clang, -O0):
<_Locale_frac_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_monetary = type opaque
define signext i8 @_Locale_frac_digits(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
ret i8 0
}

LLVM IR (-O2):
%struct._Locale_monetary = type opaque
define signext i8 @_Locale_frac_digits(%struct._Locale_monetary* nocapture readnone %0) {
ret i8 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int const, int const, int const,
                          int const, int const);
void print_eui48addr(const uint8_t addr[6]) {
  printf("%02x:%02x:%02x:%02x:%02x:%02x", addr[0], addr[1], addr[2], addr[3],
         addr[4], addr[5]);
}


x86 assembly (clang, -O0):
<print_eui48addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
lea    0xeb2(%rip),%rdi
mov    %eax,(%rsp)
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_eui48addr>:
push   %rax
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
mov    0x14(%rdi),%eax
mov    %eax,(%rsp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [30 x i8] c"%02x:%02x:%02x:%02x:%02x:%02x\00"
define void @print_eui48addr(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %0, i64 3
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %0, i64 4
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 5
%12 = load i32, i32* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4, i32 %6, i32 %8, i32 %10, i32 %12)
ret void
}
int test10(int c) { return c ? 4 : 5; }


x86 assembly (clang, -O0):
<test10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x5,%eax
mov    $0x4,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
or     $0x4,%eax
ret

LLVM IR (-O0):
define i32 @test10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 4, i32 5
ret i32 %6
}

LLVM IR (-O2):
define i32 @test10(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 5, i32 4
ret i32 %3
}
int f(int x, int y) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
jmp    110a <f+0xa>

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

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
br label %3
3: ; preds = %2, %3
br label %3
}
void turn(double angle) {}


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

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

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

LLVM IR (-O2):
define void @turn(double %0) {
ret void
}
void test2() {
  if ("hi") {
  }
  while ("hello") {
  }
  for (; "howdy";) {
  }
  do {
  } while ("hey");
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
test   $0x1,%al
jne    1113 <test2+0x13>
jmp    1118 <test2+0x18>
jmp    1118 <test2+0x18>
jmp    111d <test2+0x1d>
jmp    111d <test2+0x1d>

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

LLVM IR (-O0):
@.str = [3 x i8] c"hi\00"
@.str.1 = [6 x i8] c"hello\00"
define void @test2() {
br i1 true, label %1, label %2
1: ; preds = %0
br label %2
2: ; preds = %1, %0
br label %3
3: ; preds = %2, %3
br label %3
}

LLVM IR (-O2):
define void @test2() {
br label %1
1: ; preds = %0, %1
br label %1
}
unsigned long assemble_21(x)
unsigned int x;
{
  unsigned long temp;
  temp = ((x & 1) << 20) | ((x & 0xffe) << 8) | ((x & 0xc000) >> 7) |
         ((x & 0x1f0000) >> 14) | ((x & 0x003000) >> 12);
  return temp & 0x1fffff;
}


x86 assembly (clang, -O0):
<assemble_21>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x14,%eax
mov    -0x4(%rbp),%ecx
and    $0xffe,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xc000,%ecx
shr    $0x7,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x1f0000,%ecx
shr    $0xe,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x3000,%ecx
shr    $0xc,%ecx
or     %ecx,%eax
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x1fffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<assemble_21>:
mov    %edi,%eax
and    $0x1,%eax
shl    $0x14,%eax
mov    %edi,%ecx
shl    $0x8,%ecx
and    $0xffe00,%ecx
or     %eax,%ecx
mov    %edi,%edx
shr    $0x7,%edx
and    $0x180,%edx
or     %ecx,%edx
mov    %edi,%eax
shr    $0xe,%eax
and    $0x7c,%eax
or     %edx,%eax
shr    $0xc,%edi
and    $0x3,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i64 @assemble_21(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 1
%6 = shl i32 %5, 20
%7 = load i32, i32* %2
%8 = and i32 %7, 4094
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 49152
%13 = lshr i32 %12, 7
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, 2031616
%17 = lshr i32 %16, 14
%18 = or i32 %14, %17
%19 = load i32, i32* %2
%20 = and i32 %19, 12288
%21 = lshr i32 %20, 12
%22 = or i32 %18, %21
%23 = zext i32 %22 to i64
store i64 %23, i64* %3
%24 = load i64, i64* %3
%25 = and i64 %24, 2097151
ret i64 %25
}

LLVM IR (-O2):
define i64 @assemble_21(i32 %0) {
%2 = shl i32 %0, 20
%3 = and i32 %2, 1048576
%4 = shl i32 %0, 8
%5 = and i32 %4, 1048064
%6 = or i32 %3, %5
%7 = lshr i32 %0, 7
%8 = and i32 %7, 384
%9 = or i32 %6, %8
%10 = lshr i32 %0, 14
%11 = and i32 %10, 124
%12 = or i32 %9, %11
%13 = lshr i32 %0, 12
%14 = and i32 %13, 3
%15 = or i32 %12, %14
%16 = zext i32 %15 to i64
ret i64 %16
}
/* Variables and functions */
int lrand48();
int gen_signed_number(int range) {
  int temp;
  temp = lrand48() % (2 * range - 1);
  return temp - (range - 1);
}


x86 assembly (clang, -O0):
<gen_signed_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_signed_number>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lrand48@plt>
lea    (%rbx,%rbx,1),%ecx
add    $0xffffffff,%ecx
cltd
idiv   %ecx
sub    %ebx,%edx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_signed_number(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @lrand48()
%5 = load i32, i32* %2
%6 = mul nsw i32 2, %5
%7 = sub nsw i32 %6, 1
%8 = srem i32 %4, %7
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
%12 = sub nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @gen_signed_number(i32 %0) {
%2 = tail call i32 (...) @lrand48()
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, -1
%5 = srem i32 %2, %4
%6 = sub i32 1, %0
%7 = add i32 %6, %5
ret i32 %7
}
/* Type definitions */
struct ps_process {
  int dummy;
};

/* Variables and functions */
void *obus_object_get_user_data(int /*<<< orphan*/);
int /*<<< orphan*/ ps_process_const_object(struct ps_process const *);
void *ps_process_get_user_data(const struct ps_process *object) {
  return obus_object_get_user_data(ps_process_const_object(object));
}


x86 assembly (clang, -O0):
<ps_process_get_user_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ps_process_const_object@plt>
mov    %eax,%edi
call   1040 <obus_object_get_user_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ps_process = type { i32 }
define i8* @ps_process_get_user_data(%struct.ps_process* %0) {
%2 = alloca %struct.ps_process*
store %struct.ps_process* %0, %struct.ps_process** %2
%3 = load %struct.ps_process*, %struct.ps_process** %2
%4 = call i32 @ps_process_const_object(%struct.ps_process* %3)
%5 = call i8* @obus_object_get_user_data(i32 %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.ps_process = type { i32 }
define i8* @ps_process_get_user_data(%struct.ps_process* %0) {
%2 = tail call i32 @ps_process_const_object(%struct.ps_process* %0)
%3 = tail call i8* @obus_object_get_user_data(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ isprime(int);
int nextprime(int v) {
  while (!isprime(v))
    v++;
  return v;
}


x86 assembly (clang, -O0):
<nextprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isprime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1138 <nextprime+0x28>
jmp    1146 <nextprime+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <nextprime+0xb>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextprime>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <isprime@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1120 <nextprime+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @nextprime(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %6, %2 ]
%4 = tail call i32 @isprime(i32 %3)
%5 = icmp eq i32 %4, 0
%6 = add nsw i32 %3, 1
br i1 %5, label %2, label %7
7: ; preds = %2
ret i32 %3
}
void NCONF_WIN32(void) {}


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

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

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

LLVM IR (-O2):
define void @NCONF_WIN32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: tgetxattr aname path [attr ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: tgetxattr aname path [attr ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Usage: tgetxattr aname path [attr ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int a, b, c;
  float d, e;
  int f, g;
  printf("Hello world is coming back !");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"Hello world is coming back !\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Hello world is coming back !\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main(int argc, char *argv[]) {
  const int i = 1;
  printf("%d\n", i);
  return 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)
movl   $0x1,-0x14(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int i = 315, j = 120;
  printf("GCD of %d and %d is %d\n\n", i, j, gcd(i, j));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x13b,-0x8(%rbp)
movl   $0x78,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <gcd@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x13b,%edi
mov    $0x78,%esi
call   1040 <gcd@plt>
lea    0xec9(%rip),%rdi
mov    $0x13b,%esi
mov    $0x78,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [25 x i8] c"GCD of %d and %d is %d\0A\0A\00"
define i32 @main() {
%1 = tail call i32 @gcd(i32 315, i32 120)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 315, i32 120, i32 %1)
ret i32 0
}
int find_nbits(unsigned int i) {
  return (i == 0) ? 0 : 8 * sizeof(unsigned int) - __builtin_clz(i);
}


x86 assembly (clang, -O0):
<find_nbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111c <find_nbits+0x1c>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1134 <find_nbits+0x34>
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
movslq %eax,%rcx
mov    $0x20,%eax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_nbits>:
test   %edi,%edi
je     110e <find_nbits+0xe>
bsr    %edi,%eax
xor    $0xffffffe0,%eax
add    $0x21,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @find_nbits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 @llvm.ctlz.i32(i32 %7, i1 true)
%9 = sext i32 %8 to i64
%10 = sub i64 32, %9
br label %11
11: ; preds = %6, %5
%12 = phi i64 [ 0, %5 ], [ %10, %6 ]
%13 = trunc i64 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @find_nbits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%5 = sub nuw nsw i32 32, %4
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int N_f(char *s) {
  debug("N_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<N_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<N_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf03(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"N_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @N_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [44 x i8] c"N_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @N_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void InitDma(void) {
  outb(0x0a, 0x06);
  outb(0x0c, 0xFF);
  outb(0x04, 0x00);
  outb(0x04, 0x10);
  outb(0x0c, 0xFF);
  outb(0x05, 0xFF);
  outb(0x05, 0x23);
  outb(0x81, 0x00);
  outb(0x0a, 0x02);
}


x86 assembly (clang, -O0):
<InitDma>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <outb@plt>
mov    $0xc,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x4,%edi
mov    $0x10,%esi
call   1030 <outb@plt>
mov    $0xc,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x5,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1030 <outb@plt>
mov    $0x81,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa,%edi
mov    $0x2,%esi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitDma>:
push   %rax
mov    $0xa,%edi
mov    $0x6,%esi
call   1030 <outb@plt>
mov    $0xc,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x4,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0x4,%edi
mov    $0x10,%esi
call   1030 <outb@plt>
mov    $0xc,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x5,%edi
mov    $0xff,%esi
call   1030 <outb@plt>
mov    $0x5,%edi
mov    $0x23,%esi
call   1030 <outb@plt>
mov    $0x81,%edi
xor    %esi,%esi
call   1030 <outb@plt>
mov    $0xa,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @InitDma() {
%1 = call i32 @outb(i32 10, i32 6)
%2 = call i32 @outb(i32 12, i32 255)
%3 = call i32 @outb(i32 4, i32 0)
%4 = call i32 @outb(i32 4, i32 16)
%5 = call i32 @outb(i32 12, i32 255)
%6 = call i32 @outb(i32 5, i32 255)
%7 = call i32 @outb(i32 5, i32 35)
%8 = call i32 @outb(i32 129, i32 0)
%9 = call i32 @outb(i32 10, i32 2)
ret void
}

LLVM IR (-O2):
define void @InitDma() {
%1 = tail call i32 @outb(i32 10, i32 6)
%2 = tail call i32 @outb(i32 12, i32 255)
%3 = tail call i32 @outb(i32 4, i32 0)
%4 = tail call i32 @outb(i32 4, i32 16)
%5 = tail call i32 @outb(i32 12, i32 255)
%6 = tail call i32 @outb(i32 5, i32 255)
%7 = tail call i32 @outb(i32 5, i32 35)
%8 = tail call i32 @outb(i32 129, i32 0)
%9 = tail call i32 @outb(i32 10, i32 2)
ret void
}
float nullFilterApply(void *filter, float input) {
  (void)(filter);
  return input;
}


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

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

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

LLVM IR (-O2):
define float @nullFilterApply(i8* nocapture readnone %0, float returned %1) {
ret float %1
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_tex_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("tex", " %comment"),
                            "comment", "%comment");
}


x86 assembly (clang, -O0):
<test_tex_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec6(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tex_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"tex\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"%comment\00"
define void @test_tex_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"tex\00"
@.str.1 = [10 x i8] c" %comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"%comment\00"
define void @test_tex_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FB_PRINT_CONVERT_BIN_NEWLINE(int);
int /*<<< orphan*/ fb_LPrintInit();
int /*<<< orphan*/ fb_PrintFixString(int, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ fb_hFloat2Str(double, char *, int, int);
void fb_LPrintSingle(int fnum, float val, int mask) {
  char buffer[8 + 1 + 9 + 1];
  fb_LPrintInit();
  fb_PrintFixString(fnum, fb_hFloat2Str((double)val, buffer, 7, 0x00000001),
                    FB_PRINT_CONVERT_BIN_NEWLINE(mask));
}


x86 assembly (clang, -O0):
<fb_LPrintSingle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <fb_LPrintInit@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
call   1060 <fb_hFloat2Str@plt>
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <FB_PRINT_CONVERT_BIN_NEWLINE@plt>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    %eax,%edx
call   1050 <fb_PrintFixString@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_LPrintSingle>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebx
movss  %xmm0,0xc(%rsp)
mov    %edi,%r14d
xor    %eax,%eax
call   1030 <fb_LPrintInit@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0x10(%rsp),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
call   1060 <fb_hFloat2Str@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <FB_PRINT_CONVERT_BIN_NEWLINE@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1050 <fb_PrintFixString@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fb_LPrintSingle(i32 %0, float %1, i32 %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
%7 = alloca [19 x i8]
store i32 %0, i32* %4
store float %1, float* %5
store i32 %2, i32* %6
%8 = call i32 (...) @fb_LPrintInit()
%9 = load i32, i32* %4
%10 = load float, float* %5
%11 = fpext float %10 to double
%12 = getelementptr inbounds [19 x i8], [19 x i8]* %7, i64 0, i64 0
%13 = call i32 @fb_hFloat2Str(double %11, i8* %12, i32 7, i32 1)
%14 = load i32, i32* %6
%15 = call i32 @FB_PRINT_CONVERT_BIN_NEWLINE(i32 %14)
%16 = call i32 @fb_PrintFixString(i32 %9, i32 %13, i32 %15)
ret void
}

LLVM IR (-O2):
define void @fb_LPrintSingle(i32 %0, float %1, i32 %2) {
%4 = alloca [19 x i8]
%5 = getelementptr inbounds [19 x i8], [19 x i8]* %4, i64 0, i64 0
%6 = tail call i32 (...) @fb_LPrintInit()
%7 = fpext float %1 to double
%8 = call i32 @fb_hFloat2Str(double %7, i8* %5, i32 7, i32 1)
%9 = call i32 @FB_PRINT_CONVERT_BIN_NEWLINE(i32 %2)
%10 = call i32 @fb_PrintFixString(i32 %0, i32 %8, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PopSource();
void CmdEndInput(int code) { PopSource(); }


x86 assembly (clang, -O0):
<CmdEndInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <PopSource@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @CmdEndInput(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @PopSource()
ret void
}

LLVM IR (-O2):
define void @CmdEndInput(i32 %0) {
%2 = tail call i32 (...) @PopSource()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage: access [OPTIONS].. [FILE]...\n"
         "Lists whether the current user does have specified permissions to "
         "the files.\n"
         "The exit code is 0 if all the listed files match the mask.\n"
         "See man 2 access for more details.\n"
         "\n"
         "  -q, --quiet\t\t\tNo output, just the exit code\n"
         "  -e, --effective\t\tUse the eacess syscall instead\n"
         "  -r, --read\t\t\tCheck whether the user can read\n"
         "  -w, --write\t\t\tCheck whether the user can write\n"
         "  -x, --execute\t\t\tCheck whether the user can execute\n"
         "  -h, --help\t\t\tDisplay this message\n");
}


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

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

LLVM IR (-O0):
@.str = [490 x i8] c"Usage: access [OPTIONS].. [FILE]...\0ALists whether the current user does have specified permissions to the files.\0AThe exit code is 0 if all the listed files match the mask.\0ASee man 2 access for more details.\0A\0A -q, --quiet\09\09\09No output, just the exit code\0A -e, --effective\09\09Use the eacess syscall instead\0A -r, --read\09\09\09Check whether the user can read\0A -w, --write\09\09\09Check whether the user can write\0A -x, --execute\09\09\09Check whether the user can execute\0A -h, --help\09\09\09Display this message\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([490 x i8], [490 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [489 x i8] c"Usage: access [OPTIONS].. [FILE]...\0ALists whether the current user does have specified permissions to the files.\0AThe exit code is 0 if all the listed files match the mask.\0ASee man 2 access for more details.\0A\0A -q, --quiet\09\09\09No output, just the exit code\0A -e, --effective\09\09Use the eacess syscall instead\0A -r, --read\09\09\09Check whether the user can read\0A -w, --write\09\09\09Check whether the user can write\0A -x, --execute\09\09\09Check whether the user can execute\0A -h, --help\09\09\09Display this message\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([489 x i8], [489 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  printf("%d", strlen("hello, world!"));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"hello, world!\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int isfloat(char *);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, char *);
int main() {
  char s[127 + 1];
  if (scanf("%"
            "127"
            "s",
            s) == 1)
    printf("%d\n", isfloat(s));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rsi
lea    0xeb0(%rip),%rdi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1178 <main+0x48>
lea    -0x90(%rbp),%rdi
call   1040 <isfloat@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x88,%rsp
lea    0xec2(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1161 <main+0x31>
mov    %rsp,%rdi
call   1040 <isfloat@plt>
lea    0xeac(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%127s\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @isfloat(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ sigsend(int /*<<< orphan*/, int /*<<< orphan*/);
void abort(void) { sigsend(getpid(), SIGABRT); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <sigsend@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <sigsend@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
define void @abort() {
%1 = call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = call i32 @sigsend(i32 %1, i32 %2)
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
define void @abort() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGABRT
%3 = tail call i32 @sigsend(i32 %1, i32 %2)
unreachable
}