xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
bn_div_words_abort(int i) {
  fprintf(stderr, "Division would overflow (%d)\n", i);
  abort();
}


x86 assembly (clang, -O0):
<bn_div_words_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<bn_div_words_abort>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Division would overflow (%d)\0A\00"
define i32 @bn_div_words_abort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Division would overflow (%d)\0A\00"
define i32 @bn_div_words_abort(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int AF_INET;
char const *inet_ntop(int, void const *, char *, int);
const char *rt_addr_n2a(int af, int len, const void *addr, char *buf,
                        int buflen) {
  if (af == AF_INET)
    return inet_ntop(af, addr, buf, buflen);
  return "???";
}


x86 assembly (clang, -O0):
<rt_addr_n2a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2eb4(%rip),%rcx
cmp    (%rcx),%eax
jne    1158 <rt_addr_n2a+0x48>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   1030 <inet_ntop@plt>
mov    %rax,-0x8(%rbp)
jmp    1163 <rt_addr_n2a+0x53>
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt_addr_n2a>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1129 <rt_addr_n2a+0x19>
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8d,%ecx
jmp    1030 <inet_ntop@plt>
lea    0xed0(%rip),%rax
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@.str = [4 x i8] c"???\00"
define i8* @rt_addr_n2a(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%12 = load i32, i32* %7
%13 = load i32, i32* @AF_INET
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %21
15: ; preds = %5
%16 = load i32, i32* %7
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = load i32, i32* %11
%20 = call i8* @inet_ntop(i32 %16, i8* %17, i8* %18, i32 %19)
store i8* %20, i8** %6
br label %22
21: ; preds = %5
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %6
br label %22
22: ; preds = %21, %15
%23 = load i8*, i8** %6
ret i8* %23
}

LLVM IR (-O2):
@AF_INET = global i32 0
@.str = [4 x i8] c"???\00"
define i8* @rt_addr_n2a(i32 %0, i32 %1, i8* %2, i8* %3, i32 %4) {
%6 = load i32, i32* @AF_INET
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i8* @inet_ntop(i32 %0, i8* %2, i8* %3, i32 %4)
br label %10
10: ; preds = %5, %8
%11 = phi i8* [ %9, %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), %5 ]
ret i8* %11
}
/* Variables and functions */
int erf(double);
double sqrt(int);
double probNormDist(double x) { return (erf(x / sqrt(2)) / 2.); }


x86 assembly (clang, -O0):
<probNormDist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <erf@plt>
cvtsi2sd %eax,%xmm0
movsd  0xea2(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<probNormDist>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <erf@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xeaf(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @probNormDist(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(i32 2)
%5 = fdiv double %3, %4
%6 = call i32 @erf(double %5)
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 2.000000e+00
ret double %8
}

LLVM IR (-O2):
define double @probNormDist(double %0) {
%2 = tail call double @sqrt(i32 2)
%3 = fdiv double %0, %2
%4 = tail call i32 @erf(double %3)
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ script_write_byte(int);
void script_straight(int speed) {
  script_write_byte(145);
  script_write_byte(((speed & 0xFFFF) >> 8));
  script_write_byte((speed & 0xFF));
  script_write_byte(((speed & 0xFFFF) >> 8));
  script_write_byte((speed & 0xFF));
}


x86 assembly (clang, -O0):
<script_straight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xffff,%edi
sar    $0x8,%edi
call   1030 <script_write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <script_write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<script_straight>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x91,%edi
call   1030 <script_write_byte@plt>
movzbl %bh,%edi
mov    %edi,%r14d
call   1030 <script_write_byte@plt>
movzbl %bl,%ebp
mov    %ebp,%edi
call   1030 <script_write_byte@plt>
mov    %r14d,%edi
call   1030 <script_write_byte@plt>
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <script_write_byte@plt>

LLVM IR (-O0):
define void @script_straight(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @script_write_byte(i32 145)
%4 = load i32, i32* %2
%5 = and i32 %4, 65535
%6 = ashr i32 %5, 8
%7 = call i32 @script_write_byte(i32 %6)
%8 = load i32, i32* %2
%9 = and i32 %8, 255
%10 = call i32 @script_write_byte(i32 %9)
%11 = load i32, i32* %2
%12 = and i32 %11, 65535
%13 = ashr i32 %12, 8
%14 = call i32 @script_write_byte(i32 %13)
%15 = load i32, i32* %2
%16 = and i32 %15, 255
%17 = call i32 @script_write_byte(i32 %16)
ret void
}

LLVM IR (-O2):
define void @script_straight(i32 %0) {
%2 = tail call i32 @script_write_byte(i32 145)
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = tail call i32 @script_write_byte(i32 %4)
%6 = and i32 %0, 255
%7 = tail call i32 @script_write_byte(i32 %6)
%8 = tail call i32 @script_write_byte(i32 %4)
%9 = tail call i32 @script_write_byte(i32 %6)
ret void
}
int main(void) {
  int i = 0;
  while (i < 10) {
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
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
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int main() { *(int *)0 = 0; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
movl   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
store i32 0, i32* null
ret i32 0
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ init_builtin_alias();
void init_builtins(void) { init_builtin_alias(); }


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

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

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

LLVM IR (-O2):
define void @init_builtins() {
%1 = tail call i32 (...) @init_builtin_alias()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long sump(int *, int *);
int main(void) {
  int marbles[10] = {20, 10, 5, 39, 4, 16, 19, 26, 31, 20};
  long answer;
  answer = sump(marbles, marbles + 10);
  printf("The total number of marbles is %ld.\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rsi
add    $0x28,%rsi
call   1050 <sump@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x28(%rsp),%rsi
mov    %rsp,%rdi
call   1040 <sump@plt>
lea    0xecd(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i64
store i32 0, i32* %1
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%7 = getelementptr inbounds i32, i32* %6, i64 10
%8 = call i64 @sump(i32* %5, i32* %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.marbles = [10 x i32] [i32 20, i32 10, i32 5, i32 39, i32 4, i32 16, i32 19, i32 26, i32 31, i32 20]
@.str = [37 x i8] c"The total number of marbles is %ld.\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 10
%5 = call i64 @sump(i32* %3, i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i64 %5)
ret i32 0
}
/* Variables and functions */
int mul8bit(int, int);
unsigned short pack_rgba4(int r, int g, int b, int a) {
  return ((mul8bit(a, 15) << 12) | (mul8bit(r, 15) << 8) |
          (mul8bit(g, 15) << 4) | (mul8bit(b, 15)));
}


x86 assembly (clang, -O0):
<pack_rgba4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
shl    $0xc,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
movzwl %ax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_rgba4>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%ebx
mov    %ecx,%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ebp
shl    $0xc,%ebp
mov    %ebx,%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
or     %ebp,%ebx
mov    %r15d,%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
mov    %r14d,%edi
mov    $0xf,%esi
call   1030 <mul8bit@plt>
or     %ebp,%eax
or     %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @pack_rgba4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = call i32 @mul8bit(i32 %9, i32 15)
%11 = shl i32 %10, 12
%12 = load i32, i32* %5
%13 = call i32 @mul8bit(i32 %12, i32 15)
%14 = shl i32 %13, 8
%15 = or i32 %11, %14
%16 = load i32, i32* %6
%17 = call i32 @mul8bit(i32 %16, i32 15)
%18 = shl i32 %17, 4
%19 = or i32 %15, %18
%20 = load i32, i32* %7
%21 = call i32 @mul8bit(i32 %20, i32 15)
%22 = or i32 %19, %21
%23 = trunc i32 %22 to i16
ret i16 %23
}

LLVM IR (-O2):
define zeroext i16 @pack_rgba4(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @mul8bit(i32 %3, i32 15)
%6 = shl i32 %5, 12
%7 = tail call i32 @mul8bit(i32 %0, i32 15)
%8 = shl i32 %7, 8
%9 = or i32 %8, %6
%10 = tail call i32 @mul8bit(i32 %1, i32 15)
%11 = shl i32 %10, 4
%12 = or i32 %9, %11
%13 = tail call i32 @mul8bit(i32 %2, i32 15)
%14 = or i32 %12, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}
OP(ed, fa) { illegal_2(); }


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

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

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @illegal_2()
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
char analysis_is_program_correct() { return 1; }


x86 assembly (clang, -O0):
<analysis_is_program_correct>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<analysis_is_program_correct>:
mov    $0x1,%al
ret

LLVM IR (-O0):
define signext i8 @analysis_is_program_correct() {
ret i8 1
}

LLVM IR (-O2):
define signext i8 @analysis_is_program_correct() {
ret i8 1
}
void call_save_data(int id, void *data) {}


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

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

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

LLVM IR (-O2):
define void @call_save_data(i32 %0, i8* nocapture %1) {
ret void
}
int test_016(int a, int b, int c, int d) { return a + (a & 1); }


x86 assembly (clang, -O0):
<test_016>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_016>:
mov    %edi,%eax
and    $0x1,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_016(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %0, 1
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
char *malloc(size_t);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
char *getInfo() {
  char *name;
  size_t size;
  size = strlen("Noise (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
                "under GNU GPL");
  name = malloc(size + 1);
  strncpy(name,
          ("Noise (C) 2004 Panayotis Katsaloulis http://www.panayotis.com "
           "under GNU GPL"),
          size + 1);
  return name;
}


x86 assembly (clang, -O0):
<getInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
lea    0xe94(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInfo>:
push   %rbx
mov    $0x4c,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rsi
mov    $0x4c,%edx
mov    %rax,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"Noise (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = alloca i8*
%2 = alloca i64
%3 = call i64 @strlen(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0))
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, 1
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = load i64, i64* %2
%9 = add i64 %8, 1
%10 = call i32 @strncpy(i8* %7, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i8*, i8** %1
ret i8* %11
}

LLVM IR (-O2):
@.str = [76 x i8] c"Noise (C) 2004 Panayotis Katsaloulis http://www.panayotis.com under GNU GPL\00"
define i8* @getInfo() {
%1 = tail call dereferenceable_or_null(76) i8* @malloc(i64 76)
%2 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i64 76)
ret i8* %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t read16be(void *buf) {
  uint8_t *p = buf;
  return p[1] | p[0] << 8;
}


x86 assembly (clang, -O0):
<read16be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16be>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read16be(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @read16be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = load i32, i32* %2
%7 = shl i32 %6, 8
%8 = or i32 %7, %5
ret i32 %8
}
int main(void) {
  int i;
  i = 123456789;
  i = '0';
  i = 'a';
  i = ' ';
  i = '\n';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x75bcd15,-0x4(%rbp)
movl   $0x30,-0x4(%rbp)
movl   $0x61,-0x4(%rbp)
movl   $0x20,-0x4(%rbp)
movl   $0xa,-0x4(%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
store i32 123456789, i32* %1
store i32 48, i32* %1
store i32 97, i32* %1
store i32 32, i32* %1
store i32 10, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void inchal2inchalExtUnit_inchal() {}


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

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

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

LLVM IR (-O2):
define void @inchal2inchalExtUnit_inchal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *malloc(size_t);
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (p == NULL)
    abort();
  return p;
}


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    114b <xmalloc+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     112d <xmalloc+0xd>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
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 %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
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 %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
void g_ascii_toupper() {}


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

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

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

LLVM IR (-O2):
define void @g_ascii_toupper() {
ret void
}
__attribute__((__no__)) void
do_nothing_trailing_hole_dynamic_partial(struct test_trailing_hole *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_trailing_hole_dynamic_partial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_trailing_hole_dynamic_partial+0x1b>
jmp    1120 <do_nothing_trailing_hole_dynamic_partial+0x20>
jmp    1120 <do_nothing_trailing_hole_dynamic_partial+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_dynamic_partial(%struct.test_trailing_hole* %0) {
%2 = alloca %struct.test_trailing_hole*
store %struct.test_trailing_hole* %0, %struct.test_trailing_hole** %2
%3 = load %struct.test_trailing_hole*, %struct.test_trailing_hole** %2
%4 = ptrtoint %struct.test_trailing_hole* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_trailing_hole = type opaque
define void @do_nothing_trailing_hole_dynamic_partial(%struct.test_trailing_hole* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *emalloc(size_t num, size_t size) {
  void *mem = malloc(num * size);
  if (!mem) {
    fprintf(stderr, "Failed to allocate %zu bytes\n", num * size);
    exit(EXIT_FAILURE);
  }
  return mem;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1189 <emalloc+0x59>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e56(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1147 <emalloc+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Failed to allocate %zu bytes\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @emalloc(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 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %20, label %12
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
%17 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %2
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Failed to allocate %zu bytes\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @emalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i64 %3)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %2
ret i8* %4
}
int cloneIntABO(void *dst, const void *src) {
  *((int *)dst) = *((int *)src);
  return 0;
}


x86 assembly (clang, -O0):
<cloneIntABO>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cloneIntABO>:
mov    (%rsi),%eax
mov    %eax,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cloneIntABO(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
store i32 %4, i32* %5
ret i32 0
}
Min(char *a) { return *a & 0x20; }


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

x86 assembly (clang, -O2):
<Min>:
movzbl (%rdi),%eax
and    $0x20,%eax
ret

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

LLVM IR (-O2):
define i32 @Min(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 32
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
__attribute__((constructor)) void __init_mymemcpy() {
  fprintf(stderr, "MYMEMCPY IN USE!\n");
}


x86 assembly (clang, -O0):
<__init_mymemcpy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__init_mymemcpy>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"MYMEMCPY IN USE!\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__init_mymemcpy, i8* null }]
define void @__init_mymemcpy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"MYMEMCPY IN USE!\0A\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @__init_mymemcpy, i8* null }]
define void @__init_mymemcpy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
int main(int argc, char **argv) {
  size_t size = 15;
  int count = 0;
  if (0 == argc)
    count++;
  if (0 != argc)
    count--;
  void *p = malloc(size + count);
  ((char *)p)[size] = 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xf,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jne    1149 <main+0x39>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
je     115d <main+0x4d>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 15, i64* %6
store i32 0, i32* %7
%9 = load i32, i32* %4
%10 = icmp eq i32 0, %9
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %7
%13 = add nsw i32 %12, 1
store i32 %13, i32* %7
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %4
%16 = icmp ne i32 0, %15
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %7
%19 = add nsw i32 %18, -1
store i32 %19, i32* %7
br label %20
20: ; preds = %17, %14
%21 = load i64, i64* %6
%22 = load i32, i32* %7
%23 = sext i32 %22 to i64
%24 = add i64 %21, %23
%25 = call i8* @malloc(i64 %24)
store i8* %25, i8** %8
%26 = load i8*, i8** %8
%27 = load i64, i64* %6
%28 = getelementptr inbounds i8, i8* %26, i64 %27
store i8 0, i8* %28
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void USBIntEnableEndpoint(unsigned long ulBase, unsigned long ulFlags) {
  ;
  (*((volatile unsigned short *)(ulBase + 0x00000006))) |=
      ulFlags & (0x0000FFFE | 0x0000FFFE | 0x00000001);
  (*((volatile unsigned short *)(ulBase + 0x00000008))) |=
      ((ulFlags & (0xFFFE0000 | 0xFFFE0000)) >> 16);
}


x86 assembly (clang, -O0):
<USBIntEnableEndpoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
and    $0xffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x6(%rax),%cx
movzwl %cx,%ecx
or     %rdx,%rcx
mov    %cx,0x6(%rax)
movabs $0xfffe0000,%rdx
and    -0x10(%rbp),%rdx
shr    $0x10,%rdx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%cx
movzwl %cx,%ecx
or     %rdx,%rcx
mov    %cx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBIntEnableEndpoint>:
or     %si,0x6(%rdi)
shr    $0x10,%esi
and    $0xfffffffe,%esi
or     %si,0x8(%rdi)
ret

LLVM IR (-O0):
define void @USBIntEnableEndpoint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = and i64 %5, 65535
%7 = load i64, i64* %3
%8 = add i64 %7, 6
%9 = inttoptr i64 %8 to i16*
%10 = load volatile i16, i16* %9
%11 = zext i16 %10 to i64
%12 = or i64 %11, %6
%13 = trunc i64 %12 to i16
store volatile i16 %13, i16* %9
%14 = load i64, i64* %4
%15 = and i64 %14, 4294836224
%16 = lshr i64 %15, 16
%17 = load i64, i64* %3
%18 = add i64 %17, 8
%19 = inttoptr i64 %18 to i16*
%20 = load volatile i16, i16* %19
%21 = zext i16 %20 to i64
%22 = or i64 %21, %16
%23 = trunc i64 %22 to i16
store volatile i16 %23, i16* %19
ret void
}

LLVM IR (-O2):
define void @USBIntEnableEndpoint(i64 %0, i64 %1) {
%3 = add i64 %0, 6
%4 = inttoptr i64 %3 to i16*
%5 = load volatile i16, i16* %4
%6 = trunc i64 %1 to i16
%7 = or i16 %5, %6
store volatile i16 %7, i16* %4
%8 = lshr i64 %1, 16
%9 = add i64 %0, 8
%10 = inttoptr i64 %9 to i16*
%11 = load volatile i16, i16* %10
%12 = trunc i64 %8 to i16
%13 = and i16 %12, -2
%14 = or i16 %11, %13
store volatile i16 %14, i16* %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int Assert_fatal_error(char *msg, char *filename, int lineno) {
  fprintf(stderr, "*** assertion failed ***\n");
  fprintf(stderr, "%s:%d: %s\n", filename, lineno, msg);
  exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<Assert_fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Assert_fatal_error>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x2ea9(%rip),%r15
mov    (%r15),%edi
lea    0xebf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xec8(%rip),%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
mov    %rbp,%r8
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"*** assertion failed ***\0A\00"
@.str.1 = [11 x i8] c"%s:%d: %s\0A\00"
define i32 @Assert_fatal_error(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i8*, i8** %4
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %10, i32 %11, i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"*** assertion failed ***\0A\00"
@.str.1 = [11 x i8] c"%s:%d: %s\0A\00"
define i32 @Assert_fatal_error(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
}
void MergeUVRow_16_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @MergeUVRow_16_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *th_alarm(void *time) {
  int i;
  printf("I am in thread function\n");
  sleep(*((int *)time));
  printf("Alarm beeping\n");
  printf("\a");
  return NULL;
}


x86 assembly (clang, -O0):
<th_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <sleep@plt>
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<th_alarm>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%edi
call   1050 <sleep@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
mov    $0x7,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"I am in thread function\0A\00"
@.str.1 = [15 x i8] c"Alarm beeping\0A\00"
@.str.2 = [2 x i8] c"\07\00"
define i8* @th_alarm(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = call i32 @sleep(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [24 x i8] c"I am in thread function\00"
@str.3 = [14 x i8] c"Alarm beeping\00"
define noalias i8* @th_alarm(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @sleep(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.3, i64 0, i64 0))
%7 = tail call i32 @putchar(i32 7)
ret i8* null
}
unsigned store_16(unsigned r, unsigned g, unsigned b, unsigned add) {
  unsigned rgb;
  rgb = (((r << 5) - r + add) >> 8) << 11;
  rgb += (((g << 6) - g + add) >> 8) << 5;
  rgb += ((b << 5) - b + add) >> 8;
  return rgb;
}


x86 assembly (clang, -O0):
<store_16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
sub    -0x4(%rbp),%eax
add    -0x10(%rbp),%eax
shr    $0x8,%eax
shl    $0xb,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x6,%eax
sub    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
shr    $0x8,%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
sub    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
shr    $0x8,%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_16>:
mov    %edi,%eax
shl    $0x5,%eax
sub    %edi,%eax
add    %ecx,%eax
and    $0xffffff00,%eax
mov    %esi,%edi
shl    $0x6,%edi
sub    %esi,%edi
add    %ecx,%edi
shr    $0x3,%edi
and    $0xffffffe0,%edi
mov    %edx,%esi
shl    $0x5,%esi
sub    %edx,%esi
add    %ecx,%esi
shr    $0x8,%esi
add    %edi,%esi
lea    (%rsi,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @store_16(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = shl i32 %10, 5
%12 = load i32, i32* %5
%13 = sub i32 %11, %12
%14 = load i32, i32* %8
%15 = add i32 %13, %14
%16 = lshr i32 %15, 8
%17 = shl i32 %16, 11
store i32 %17, i32* %9
%18 = load i32, i32* %6
%19 = shl i32 %18, 6
%20 = load i32, i32* %6
%21 = sub i32 %19, %20
%22 = load i32, i32* %8
%23 = add i32 %21, %22
%24 = lshr i32 %23, 8
%25 = shl i32 %24, 5
%26 = load i32, i32* %9
%27 = add i32 %26, %25
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = shl i32 %28, 5
%30 = load i32, i32* %7
%31 = sub i32 %29, %30
%32 = load i32, i32* %8
%33 = add i32 %31, %32
%34 = lshr i32 %33, 8
%35 = load i32, i32* %9
%36 = add i32 %35, %34
store i32 %36, i32* %9
%37 = load i32, i32* %9
ret i32 %37
}

LLVM IR (-O2):
define i32 @store_16(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul i32 %0, 31
%6 = add i32 %5, %3
%7 = shl i32 %6, 3
%8 = and i32 %7, -2048
%9 = mul i32 %1, 63
%10 = add i32 %9, %3
%11 = lshr i32 %10, 3
%12 = and i32 %11, 536870880
%13 = mul i32 %2, 31
%14 = add i32 %13, %3
%15 = lshr i32 %14, 8
%16 = add nuw nsw i32 %12, %15
%17 = add i32 %16, %8
ret i32 %17
}
/* Variables and functions */
int getchar();
void wait_input() {
  int k;
  while (1) {
    k = getchar();
    switch (k) {
    case 'h':
      return;
    }
  }
}


x86 assembly (clang, -O0):
<wait_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x68,%eax
jne    1139 <wait_input+0x29>
jmp    1133 <wait_input+0x23>
add    $0x10,%rsp
pop    %rbp
ret
jmp    1118 <wait_input+0x8>

x86 assembly (clang, -O2):
<wait_input>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x68,%eax
jne    1120 <wait_input+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @wait_input() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 104
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
char *strerror(int);
int sys_nerr;
int main() {
  int idx = 0;
  for (idx = 0; idx < sys_nerr; idx++) {
    printf("Error #%3d: %s\n", idx, strerror(idx));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%eax
jge    117d <main+0x5d>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <strerror@plt>
mov    -0xc(%rbp),%esi
mov    %rax,%rdx
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2ec4(%rip),%r15
cmpl   $0x0,(%r15)
jle    115c <main+0x3c>
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <strerror@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    (%r15),%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@sys_nerr = global i32 0
@.str = [16 x i8] c"Error #%3d: %s\0A\00"
define i32 @main() {
%1 = load i32, i32* @sys_nerr
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 0, %0 ]
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = add nuw nsw i32 %4, 1
%8 = load i32, i32* @sys_nerr
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
short *vrna_pt_pk_get(char const *);
short *make_pair_table_pk(const char *structure) {
  return vrna_pt_pk_get(structure);
}


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

x86 assembly (clang, -O2):
<make_pair_table_pk>:
jmp    1030 <vrna_pt_pk_get@plt>

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

LLVM IR (-O2):
define i16* @make_pair_table_pk(i8* %0) {
%2 = tail call i16* @vrna_pt_pk_get(i8* %0)
ret i16* %2
}
void uart4_iomux_config() {}


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

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

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

LLVM IR (-O2):
define void @uart4_iomux_config() {
ret void
}
/* Variables and functions */
char *jsonZcbString(char *, char *);
char *jsonZcbLog(char *text) { return (jsonZcbString("log", text)); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"log\00"
define i8* @jsonZcbLog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @jsonZcbString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"log\00"
define i8* @jsonZcbLog(i8* %0) {
%2 = tail call i8* @jsonZcbString(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int UP3D_GetParameter(int);
int32_t UP3D_GetProgramState() {
  int32_t state = UP3D_GetParameter(0x01);
  if ((state < 0) || (state > 3))
    state = 4;
  return state;
}


x86 assembly (clang, -O0):
<UP3D_GetProgramState>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1139 <UP3D_GetProgramState+0x29>
cmpl   $0x3,-0x4(%rbp)
jle    1140 <UP3D_GetProgramState+0x30>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UP3D_GetProgramState>:
push   %rax
mov    $0x1,%edi
call   1030 <UP3D_GetParameter@plt>
cmp    $0x4,%eax
mov    $0x4,%ecx
cmovae %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @UP3D_GetProgramState() {
%1 = alloca i32
%2 = call i32 @UP3D_GetParameter(i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %5, %0
store i32 4, i32* %1
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @UP3D_GetProgramState() {
%1 = tail call i32 @UP3D_GetParameter(i32 1)
%2 = icmp ult i32 %1, 4
%3 = select i1 %2, i32 %1, i32 4
ret i32 %3
}
void _libkb_kbmlock_c_extern_e(void) {}


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

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

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

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