xunge/DecIR huggingface dataset:
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_write_quaddobl_random_coefficient_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(472, a, b, c, 0);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @celcon_write_quaddobl_random_coefficient_system() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 472, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void i8080_hal_io_output(int port, int value) {
  extern void hal_io_output(int port, int value);
  hal_io_output(port, value);
}


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

x86 assembly (clang, -O2):
<i8080_hal_io_output>:
jmp    1030 <hal_io_output@plt>

LLVM IR (-O0):
define void @i8080_hal_io_output(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
ret void
}

LLVM IR (-O2):
define void @i8080_hal_io_output(i32 %0, i32 %1) {
tail call void @hal_io_output(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *twopence_strerror(int);
void twopence_perror(const char *msg, int rc) {
  fprintf(stderr, "%s: %s.\n", msg, twopence_strerror(rc));
}


x86 assembly (clang, -O0):
<twopence_perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <twopence_strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xea4(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twopence_perror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    %esi,%edi
call   1030 <twopence_strerror@plt>
lea    0xec3(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s.\0A\00"
define void @twopence_perror(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @twopence_strerror(i32 %7)
%9 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s.\0A\00"
define void @twopence_perror(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i8* @twopence_strerror(i32 %1)
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
int gen_x86_64_shrd(int a __attribute__((__unused__))) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @gen_x86_64_shrd(i32 %0) {
ret i32 0
}
mult(string1, string2) { return (binstr(strbin(string1) * strbin(string2))); }


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

x86 assembly (clang, -O2):
<mult>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
xor    %eax,%eax
call   1040 <strbin@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <strbin@plt>
imul   %eax,%ebp
mov    %ebp,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <binstr@plt>

LLVM IR (-O0):
define i32 @mult(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 = call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %7)
%9 = mul nsw i32 %6, %8
%10 = call i32 (i32, ...) bitcast (i32 (...)* @binstr to i32 (i32, ...)*)(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @strbin to i32 (i32, ...)*)(i32 %1)
%5 = mul nsw i32 %4, %3
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @binstr to i32 (i32, ...)*)(i32 %5)
ret i32 %6
}
char *strip_whitesp(char *str) { return 0; }


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

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

LLVM IR (-O0):
define i8* @strip_whitesp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @strip_whitesp(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ finalize_core();
void end_match() { finalize_core(); }


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

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

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

LLVM IR (-O2):
define void @end_match() {
%1 = tail call i32 (...) @finalize_core()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *, unsigned long);
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL)
    errx(EXIT_FAILURE, "out of memory allocation %lu bytes",
         (unsigned long)size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <xmalloc+0x3d>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xea8(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <xmalloc+0x2c>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %r14,%rdx
call   1030 <errx@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [35 x i8] c"out of memory allocation %lu bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @EXIT_FAILURE
%10 = load i64, i64* %2
%11 = call i32 @errx(i32 %9, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [35 x i8] c"out of memory allocation %lu bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @errx(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %7
7: ; preds = %4, %1
ret i8* %2
}
double obd_convert_61(int a, int b) { return (float)a - 125.0f; }


x86 assembly (clang, -O0):
<obd_convert_61>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xee9(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obd_convert_61>:
cvtsi2ss %edi,%xmm0
addss  0xef4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @obd_convert_61(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 = sitofp i32 %5 to float
%7 = fsub float %6, 1.250000e+02
%8 = fpext float %7 to double
ret double %8
}

LLVM IR (-O2):
define double @obd_convert_61(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to float
%4 = fadd float %3, -1.250000e+02
%5 = fpext float %4 to double
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int main() {
  f1(34);
  f1(0);
  f1(0);
  f1(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1030 <f1@plt>
xor    %edi,%edi
call   1030 <f1@plt>
xor    %edi,%edi
call   1030 <f1@plt>
xor    %edi,%edi
call   1030 <f1@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x22,%edi
call   1030 <f1@plt>
xor    %edi,%edi
call   1030 <f1@plt>
xor    %edi,%edi
call   1030 <f1@plt>
xor    %edi,%edi
call   1030 <f1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f1(i32 34)
%2 = call i32 @f1(i32 0)
%3 = call i32 @f1(i32 0)
%4 = call i32 @f1(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 34)
%2 = tail call i32 @f1(i32 0)
%3 = tail call i32 @f1(i32 0)
%4 = tail call i32 @f1(i32 0)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t format_nsec(int64_t s) {
  s = (s + 500000) / 1000000;
  if (s == 1000) {
    --s;
  }
  return s;
}


x86 assembly (clang, -O0):
<format_nsec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7a120,%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jne    1130 <format_nsec+0x30>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_nsec>:
lea    -0x3b9328e0(%rdi),%ecx
mov    $0x3e7,%eax
cmp    $0xf4240,%ecx
jb     1130 <format_nsec+0x30>
add    $0x7a120,%edi
movslq %edi,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @format_nsec(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 500000
%5 = sdiv i32 %4, 1000000
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 1000
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @format_nsec(i32 %0) {
%2 = add nsw i32 %0, 500000
%3 = sdiv i32 %2, 1000000
%4 = add i32 %0, -999500000
%5 = icmp ult i32 %4, 1000000
%6 = select i1 %5, i32 999, i32 %3
ret i32 %6
}
int RTP_increment_seqN(int n) {
  n++;
  if (n > 65535) {
    n = n - 65536;
  }
  return n;
}


x86 assembly (clang, -O0):
<RTP_increment_seqN>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xffff,-0x4(%rbp)
jle    1128 <RTP_increment_seqN+0x28>
mov    -0x4(%rbp),%eax
sub    $0x10000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RTP_increment_seqN>:
xor    %eax,%eax
cmp    $0xffff,%edi
setl   %al
shl    $0x10,%eax
add    %edi,%eax
add    $0xffff0001,%eax
ret

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

LLVM IR (-O2):
define i32 @RTP_increment_seqN(i32 %0) {
%2 = icmp sgt i32 %0, 65534
%3 = select i1 %2, i32 -65535, i32 1
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void read_cvt(char *buf) {
  FILE *fp = fopen("/tmp/gxrandr_cvt", "r");
  fgets(buf, 128, fp);
  fclose(fp);
}


x86 assembly (clang, -O0):
<read_cvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x80,%esi
call   1040 <fgets@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cvt>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xec2(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x80,%esi
mov    %rax,%rdx
call   1040 <fgets@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/tmp/gxrandr_cvt\00"
@.str.1 = [2 x i8] c"r\00"
define void @read_cvt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i8*, i8** %2
%6 = load i32*, i32** %3
%7 = call i32 @fgets(i8* %5, i32 128, i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fclose(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"/tmp/gxrandr_cvt\00"
@.str.1 = [2 x i8] c"r\00"
define void @read_cvt(i8* %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @fgets(i8* %0, i32 128, i32* %2)
%4 = tail call i32 @fclose(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int /*<<< orphan*/ HibernateWriteComplete();
void HibernateLowBatSet(unsigned long ulLowBatFlags) {
  DEBUG_ASSERT(!(ulLowBatFlags & ~(0x00006000 | 0x000000A0)));
  (*((volatile unsigned long *)(0x400FC010))) =
      (ulLowBatFlags | ((*((volatile unsigned long *)(0x400FC010))) &
                        ~(0x00006000 | 0x000000A0)));
  HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateLowBatSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffffff9f5f,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0xffffffffffff9f5f,%rax
or     %rax,%rcx
mov    $0x400fc010,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <HibernateWriteComplete@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateLowBatSet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   $0xffffffffffff9f5f,%rbx
sete   %dil
call   1040 <DEBUG_ASSERT@plt>
mov    $0xffffffffffff9f5f,%rax
and    0x400fc010,%rax
40
or     %rbx,%rax
mov    %rax,0x400fc010
40
xor    %eax,%eax
pop    %rbx
jmp    1030 <HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateLowBatSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -24737
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %2
%10 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%11 = and i64 %10, -24737
%12 = or i64 %9, %11
store volatile i64 %12, i64* inttoptr (i64 1074774032 to i64*)
%13 = call i32 (...) @HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateLowBatSet(i64 %0) {
%2 = and i64 %0, -24737
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%7 = and i64 %6, -24737
%8 = or i64 %7, %0
store volatile i64 %8, i64* inttoptr (i64 1074774032 to i64*)
%9 = tail call i32 (...) @HibernateWriteComplete()
ret void
}
int index_of_size(int s) {
  int k = 0;
  unsigned int size = s;
  while (size != 1) {
    size >>= 1;
    k++;
  }
  return (k < 32 ? k : 32);
}


x86 assembly (clang, -O0):
<index_of_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1135 <index_of_size+0x35>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <index_of_size+0x14>
cmpl   $0x20,-0x8(%rbp)
jge    114a <index_of_size+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <index_of_size+0x57>
mov    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    1157 <index_of_size+0x57>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index_of_size>:
xor    %eax,%eax
cmp    $0x1,%edi
je     1129 <index_of_size+0x29>
mov    $0xffffffff,%ecx
nopl   0x0(%rax)
shr    %edi
add    $0x1,%ecx
cmp    $0x1,%edi
jne    1110 <index_of_size+0x10>
mov    $0x20,%eax
cmp    $0x1e,%ecx
ja     1129 <index_of_size+0x29>
add    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @index_of_size(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = lshr i32 %4, 1
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %6, 1
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = icmp ult i32 %5, 31
br i1 %10, label %11, label %13
11: ; preds = %1, %9
%12 = phi i32 [ %7, %9 ], [ 0, %1 ]
br label %13
13: ; preds = %9, %11
%14 = phi i32 [ %12, %11 ], [ 32, %9 ]
ret i32 %14
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    if ((state[0UL] >> (unsigned short)4) & (unsigned short)1) {
      state[0UL] += state[0UL];
    }
    output[0UL] = state[0UL] - (unsigned short)29594;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     113d <RandomFunc+0x3d>
movzwl -0x12(%rbp),%ecx
movzwl -0x12(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sub    $0x739a,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0xb45,%eax
mov    %eax,%ecx
shr    $0x4,%cl
and    $0x1,%cl
shl    %cl,%eax
add    $0xffff8c66,%eax
mov    %ax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 2885
%5 = lshr i16 %4, 4
%6 = and i16 %5, 1
%7 = shl i16 %4, %6
%8 = add i16 %7, -29594
store i16 %8, i16* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeptr(void *ptr) {
  if (ptr != NULL) {
    free(ptr);
    ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<freeptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <freeptr+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @freeptr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void XkbAllocKeyboard() {}


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

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

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

LLVM IR (-O2):
define void @XkbAllocKeyboard() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ malloc(size_t);
void *memcpy(int /*<<< orphan*/, void *, size_t);
void *xmemdup(void *p, size_t s) { return p ? memcpy(malloc(s), p, s) : NULL; }


x86 assembly (clang, -O0):
<xmemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     115c <xmemdup+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    %rax,-0x18(%rbp)
jmp    1167 <xmemdup+0x47>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1167 <xmemdup+0x47>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemdup>:
test   %rdi,%rdi
je     114b <xmemdup+0x2b>
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @xmemdup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i64, i64* %4
%9 = call i32 @malloc(i64 %8)
%10 = load i8*, i8** %3
%11 = load i64, i64* %4
%12 = call i8* @memcpy(i32 %9, i8* %10, i64 %11)
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %7
%15 = phi i8* [ %12, %7 ], [ null, %13 ]
ret i8* %15
}

LLVM IR (-O2):
define i8* @xmemdup(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @malloc(i64 %1)
%6 = tail call i8* @memcpy(i32 %5, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %6, %4 ], [ null, %2 ]
ret i8* %8
}
/* Variables and functions */
int f324(int *);
int f325(int *p) { return f324(p); }


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

x86 assembly (clang, -O2):
<f325>:
jmp    1030 <f324@plt>

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

LLVM IR (-O2):
define i32 @f325(i32* %0) {
%2 = tail call i32 @f324(i32* %0)
ret i32 %2
}
/* Variables and functions */
char *internal_duplicate_max(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ trio_length(char const *);
char *trio_duplicate(const char *source) {
  return internal_duplicate_max(source, trio_length(source));
}


x86 assembly (clang, -O0):
<trio_duplicate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <trio_length@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <internal_duplicate_max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_duplicate>:
push   %rbx
mov    %rdi,%rbx
call   1040 <trio_length@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <internal_duplicate_max@plt>

LLVM IR (-O0):
define i8* @trio_duplicate(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @trio_length(i8* %4)
%6 = call i8* @internal_duplicate_max(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @trio_duplicate(i8* %0) {
%2 = tail call i32 @trio_length(i8* %0)
%3 = tail call i8* @internal_duplicate_max(i8* %0, i32 %2)
ret i8* %3
}
/* Type definitions */
struct usb_hcd {
  int dummy;
};
struct ohci_hcd {
  int dummy;
};

/* Variables and functions */
struct ohci_hcd *hcd_to_ohci(struct usb_hcd *);
int /*<<< orphan*/ ohci_hcd_init(struct ohci_hcd *);
int ohci_init(struct ohci_hcd *);
int ohci_pci_reset(struct usb_hcd *hcd) {
  struct ohci_hcd *ohci = hcd_to_ohci(hcd);
  ohci_hcd_init(ohci);
  return ohci_init(ohci);
}


x86 assembly (clang, -O0):
<ohci_pci_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hcd_to_ohci@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ohci_hcd_init@plt>
mov    -0x10(%rbp),%rdi
call   1030 <ohci_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ohci_pci_reset>:
push   %rbx
call   1040 <hcd_to_ohci@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <ohci_hcd_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ohci_init@plt>

LLVM IR (-O0):
%struct.usb_hcd = type { i32 }
%struct.ohci_hcd = type { i32 }
define i32 @ohci_pci_reset(%struct.usb_hcd* %0) {
%2 = alloca %struct.usb_hcd*
%3 = alloca %struct.ohci_hcd*
store %struct.usb_hcd* %0, %struct.usb_hcd** %2
%4 = load %struct.usb_hcd*, %struct.usb_hcd** %2
%5 = call %struct.ohci_hcd* @hcd_to_ohci(%struct.usb_hcd* %4)
store %struct.ohci_hcd* %5, %struct.ohci_hcd** %3
%6 = load %struct.ohci_hcd*, %struct.ohci_hcd** %3
%7 = call i32 @ohci_hcd_init(%struct.ohci_hcd* %6)
%8 = load %struct.ohci_hcd*, %struct.ohci_hcd** %3
%9 = call i32 @ohci_init(%struct.ohci_hcd* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.usb_hcd = type { i32 }
%struct.ohci_hcd = type { i32 }
define i32 @ohci_pci_reset(%struct.usb_hcd* %0) {
%2 = tail call %struct.ohci_hcd* @hcd_to_ohci(%struct.usb_hcd* %0)
%3 = tail call i32 @ohci_hcd_init(%struct.ohci_hcd* %2)
%4 = tail call i32 @ohci_init(%struct.ohci_hcd* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("hello world! \n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"hello world! \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
yyPrintIndex(i) long i;
{ printf("#%d", i); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"#%d\00"
define i32 @yyPrintIndex(i64 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i32 undef
}
/* Variables and functions */
double __ocml_ncdf_f64(double);
double normcdf(double x) { return __ocml_ncdf_f64(x); }


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

x86 assembly (clang, -O2):
<normcdf>:
jmp    1030 <__ocml_ncdf_f64@plt>

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

LLVM IR (-O2):
define double @normcdf(double %0) {
%2 = tail call double @__ocml_ncdf_f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned long);
void ultoa(unsigned long v, char *s, int b) { sprintf(s, "%lu", v); }


x86 assembly (clang, -O0):
<ultoa>:
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),%rdx
lea    0xece(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ultoa>:
mov    %rsi,%rax
mov    %rdi,%rdx
lea    0xee3(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%lu\00"
define void @ultoa(i64 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret void
}
/* Variables and functions */
scalar_t__ check_transmission();
int /*<<< orphan*/ outb(int, char);
void write_serial_char(char a) {
  while (check_transmission() == 0)
    ;
  outb(0x3f8, a);
}


x86 assembly (clang, -O0):
<write_serial_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <check_transmission@plt>
cmp    $0x0,%rax
jne    1144 <write_serial_char+0x24>
jmp    112e <write_serial_char+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial_char>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1040 <check_transmission@plt>
test   %rax,%rax
je     1130 <write_serial_char+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @write_serial_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 (...) @check_transmission()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outb(i32 1016, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @write_serial_char(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @check_transmission()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outb(i32 1016, i8 signext %0)
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *fixup_null_alloc(size_t);
void *xcalloc(size_t n, size_t s) {
  void *p = calloc(n, s);
  if (!p)
    p = fixup_null_alloc(n);
  return p;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <xcalloc+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <fixup_null_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <calloc@plt>
test   %rax,%rax
je     1130 <xcalloc+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fixup_null_alloc@plt>

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

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @fixup_null_alloc(i64 %0)
br label %7
7: ; preds = %5, %2
%8 = phi i8* [ %3, %2 ], [ %6, %5 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void error(char *msg) {
  printf("%s\n", msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@EXIT_FAILURE = global i32 0
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
int __min_int(int x, int y) { return ((x) > (y) ? (y) : (x)); }


x86 assembly (clang, -O0):
<__min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <__min_int+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <__min_int+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__min_int>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

LLVM IR (-O0):
define i32 @__min_int(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
br label %12
10: ; preds = %2
%11 = load i32, i32* %3
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @__min_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
float HPCC_sweps() {
  float eps, one, half;
  one = 1.0f;
  half = one / 2.0f;
  eps = one;
  while (one + eps != one)
    eps *= half;
  return eps;
}


x86 assembly (clang, -O0):
<HPCC_sweps>:
push   %rbp
mov    %rsp,%rbp
movss  0xef8(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1150 <HPCC_sweps+0x50>
jp     1150 <HPCC_sweps+0x50>
jmp    1164 <HPCC_sweps+0x64>
movss  -0xc(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1131 <HPCC_sweps+0x31>
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<HPCC_sweps>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @HPCC_sweps() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
store float 1.000000e+00, float* %2
%4 = load float, float* %2
%5 = fdiv float %4, 2.000000e+00
store float %5, float* %3
%6 = load float, float* %2
store float %6, float* %1
br label %7
7: ; preds = %13, %0
%8 = load float, float* %2
%9 = load float, float* %1
%10 = fadd float %8, %9
%11 = load float, float* %2
%12 = fcmp une float %10, %11
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = load float, float* %3
%15 = load float, float* %1
%16 = fmul float %15, %14
store float %16, float* %1
br label %7
17: ; preds = %7
%18 = load float, float* %1
ret float %18
}

LLVM IR (-O2):
define float @HPCC_sweps() {
ret float 0x3E70000000000000
}
void comedi_proc_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @comedi_proc_cleanup() {
ret void
}
void UARTWakeUpControl(unsigned int baseAdd, unsigned int controlFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x54)))) &= ~((0x00000004u));
  (*((volatile unsigned int *)(baseAdd + (0x54)))) |=
      (controlFlag & (0x00000004u));
}


x86 assembly (clang, -O0):
<UARTWakeUpControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x4,%edx
mov    -0x4(%rbp),%eax
add    $0x54,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTWakeUpControl>:
add    $0x54,%edi
andl   $0xfffffffb,(%rdi)
and    $0x4,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTWakeUpControl(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 = add i32 %5, 84
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -5
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 4
%13 = load i32, i32* %3
%14 = add i32 %13, 84
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTWakeUpControl(i32 %0, i32 %1) {
%3 = add i32 %0, 84
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -5
store volatile i32 %7, i32* %5
%8 = and i32 %1, 4
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
int main(void) {
  int a = 1;
  int b = 1;
  switch (a) {
  case 1:
    b = 3;
    break;
  case 2:
    b = 5;
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113e <main+0x3e>
jmp    112d <main+0x2d>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114a <main+0x4a>
jmp    1151 <main+0x51>
movl   $0x3,-0xc(%rbp)
jmp    1151 <main+0x51>
movl   $0x5,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main() {
  int b = 100;
  int *a = &b;
  int *c = 200;
  printf("In Main1: %d %d \n", *a, a);
  printf("In Main2: %d %d \n", c, &c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x64,0xc(%rsp)
movq   $0xc8,0x10(%rsp)
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rdx
mov    $0x64,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x10(%rsp),%rdx
mov    $0xc8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"In Main1: %d %d \0A\00"
@.str.1 = [18 x i8] c"In Main2: %d %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = bitcast i32* %1 to i8*
store i32 100, i32* %1
%4 = bitcast i32** %2 to i8*
store i32* inttoptr (i64 200 to i32*), i32** %2
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 100, i32* %1)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32* inttoptr (i64 200 to i32*), i32** %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void die_format() { die("Invalid file format."); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"Invalid file format.\00"
define void @die_format() {
%1 = call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Invalid file format.\00"
define void @die_format() {
%1 = tail call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
StrCpy(s, t) register char *s, *t;
{
  while (*s++ = *t++)
    ;
}


x86 assembly (clang, -O0):
<StrCpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%al
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <StrCpy+0x3b>
jmp    110c <StrCpy+0xc>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrCpy>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <StrCpy+0x10>
ret

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

LLVM IR (-O2):
define i32 @StrCpy(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i32 undef
}