xunge/DecIR huggingface dataset:
void Report(char *cMonth, char *cYear, char *cPasswd) {
  char cTableName[12] = {""};
  ConnectDb();
  sprintf(cTableName, "t%.3s%.7s", cMonth, cYear);
  AcctReport(cTableName);
  exit(0);
}


x86 assembly (clang, -O0):
<Report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x24(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1040 <memset@plt>
mov    $0x0,%al
call   1030 <ConnectDb@plt>
lea    -0x24(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x24(%rbp),%rdi
mov    $0x0,%al
call   1050 <AcctReport@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<Report>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
xor    %eax,%eax
call   1030 <ConnectDb@plt>
lea    0xe93(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <AcctReport@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"t%.3s%.7s\00"
define void @Report(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [12 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast [12 x i8]* %7 to i8*
%9 = call i32 (...) @ConnectDb()
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @AcctReport to i32 (i8*, ...)*)(i8* %14)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"t%.3s%.7s\00"
define void @Report(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = alloca [12 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%6 = tail call i32 (...) @ConnectDb()
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @AcctReport to i32 (i8*, ...)*)(i8* %5)
unreachable
}
void g_usleep() {}


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

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

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

LLVM IR (-O2):
define void @g_usleep() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void UnitsApifree(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<UnitsApifree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @UnitsApifree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_emit_impl(int, char *);
void gen_function_epilogue(void) {
  gen_emit_impl(1009, "\t"
                      "leave");
  gen_emit_impl(1010, "\t"
                      "ret");
}


x86 assembly (clang, -O0):
<gen_function_epilogue>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f1,%edi
lea    0xee0(%rip),%rsi
call   1030 <gen_emit_impl@plt>
mov    $0x3f2,%edi
lea    0xed6(%rip),%rsi
call   1030 <gen_emit_impl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_function_epilogue>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3f1,%edi
call   1030 <gen_emit_impl@plt>
lea    0xede(%rip),%rsi
mov    $0x3f2,%edi
pop    %rax
jmp    1030 <gen_emit_impl@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\09leave\00"
@.str.1 = [5 x i8] c"\09ret\00"
define void @gen_function_epilogue() {
%1 = call i32 @gen_emit_impl(i32 1009, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen_emit_impl(i32 1010, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\09leave\00"
@.str.1 = [5 x i8] c"\09ret\00"
define void @gen_function_epilogue() {
%1 = tail call i32 @gen_emit_impl(i32 1009, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen_emit_impl(i32 1010, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void emit_type_definition_int8(
    struct processor_explicatory_state *process_state,
    struct modern_stream *stream, void *stream_state,
    struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_type_definition_int8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_int8(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_type_definition_int8(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(void *, size_t);
void do_bzero(void *s, size_t n) { bzero(s, n); }


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

x86 assembly (clang, -O2):
<do_bzero>:
jmp    1030 <bzero@plt>

LLVM IR (-O0):
define void @do_bzero(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 = load i64, i64* %4
%7 = call i32 @bzero(i8* %5, i64 %6)
ret void
}

LLVM IR (-O2):
define void @do_bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @bzero(i8* %0, i64 %1)
ret void
}
/* Variables and functions */
char *libraryFunction();
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", libraryFunction());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* (...) @libraryFunction()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
int polynomial(int x) {
  int result;
  result = (x - 1) * (3 * x * x * x * x + 5 * x * x * x - x + 6);
  return result;
}


x86 assembly (clang, -O0):
<polynomial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
imul   $0x3,-0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
imul   $0x5,-0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
imul   -0x4(%rbp),%edx
add    %edx,%ecx
sub    -0x4(%rbp),%ecx
add    $0x6,%ecx
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<polynomial>:
lea    -0x1(%rdi),%ecx
lea    (%rdi,%rdi,2),%eax
add    $0x5,%eax
mov    %edi,%edx
imul   %edi,%edx
imul   %edi,%eax
imul   %edx,%eax
sub    %edi,%eax
add    $0x6,%eax
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @polynomial(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = mul nsw i32 %0, 3
%4 = add i32 %3, 5
%5 = mul i32 %0, %0
%6 = mul i32 %5, %0
%7 = mul i32 %6, %4
%8 = sub i32 6, %0
%9 = add i32 %8, %7
%10 = mul nsw i32 %9, %2
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ place_queen(int /*<<< orphan*/);
int main(int argc, char *argv[]) { place_queen(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <place_queen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @place_queen(i32 0)
ret i32 0
}
/* Variables and functions */
int foo1b();
int foo2(void) { return foo1b(); }


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

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

LLVM IR (-O0):
define i32 @foo2() {
%1 = call i32 (...) @foo1b()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo2() {
%1 = tail call i32 (...) @foo1b()
ret i32 %1
}
unsigned xrop3_148_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = T | S;
  stk3 = D & stk4;
  stk2 = S ^ stk3;
  stk1 = T ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_148_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_148_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %edi,%esi
xor    %esi,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_148_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = load i32, i32* %6
%26 = or i32 %24, %25
store i32 %26, i32* %11
%27 = load i32, i32* %5
%28 = load i32, i32* %11
%29 = and i32 %27, %28
store i32 %29, i32* %10
%30 = load i32, i32* %6
%31 = load i32, i32* %10
%32 = xor i32 %30, %31
store i32 %32, i32* %9
%33 = load i32, i32* %7
%34 = load i32, i32* %9
%35 = xor i32 %33, %34
store i32 %35, i32* %8
%36 = load i32, i32* %8
ret i32 %36
}

LLVM IR (-O2):
define i32 @xrop3_148_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i8 %1, %0
%8 = zext i8 %7 to i32
%9 = xor i32 %4, %8
%10 = xor i32 %9, %6
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ StartVM(char *, int, char **);
int /*<<< orphan*/ init_dictionary(int);
int /*<<< orphan*/ init_support();
int main(int argc, char **argv, char **envp) {
  int dictsize = 0x10000;
  init_support();
  init_dictionary(dictsize);
  StartVM("cold", argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x10000,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <init_support@plt>
mov    -0x1c(%rbp),%edi
call   1040 <init_dictionary@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe99(%rip),%rdi
call   1030 <StartVM@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <init_support@plt>
mov    $0x10000,%edi
call   1040 <init_dictionary@plt>
lea    0xeb0(%rip),%rdi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <StartVM@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"cold\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
store i32 65536, i32* %7
%8 = call i32 (...) @init_support()
%9 = load i32, i32* %7
%10 = call i32 @init_dictionary(i32 %9)
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @StartVM(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11, i8** %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"cold\00"
define i32 @main(i32 %0, i8** %1, i8** nocapture readnone %2) {
%4 = tail call i32 (...) @init_support()
%5 = tail call i32 @init_dictionary(i32 65536)
%6 = tail call i32 @StartVM(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char const *, int /*<<< orphan*/);
int nmcadec_open(const char *pathname) { return open(pathname, O_RDWR); }


x86 assembly (clang, -O0):
<nmcadec_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmcadec_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
define i32 @nmcadec_open(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDWR
%5 = call i32 @open(i8* %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@O_RDWR = global i32 0
define i32 @nmcadec_open(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = tail call i32 @open(i8* %0, i32 %2)
ret i32 %3
}
int main() {
  int a, i;
#pragma acc parallel loop vector copy(a [0:100]) reduction(+ : a)
  for (i = 0; i < 100; i++)
    a++;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1133 <main+0x33>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <main+0x12>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
/* Variables and functions */
int strcmp(char const *, char const *);
int lenient_strcmp(const void *_a, const void *_b) {
  const char *a = _a, *b = _b;
  if (a == b) {
    return 0;
  } else if (!a) {
    return -1;
  } else if (!b) {
    return 1;
  } else {
    return strcmp(a, b);
  }
}


x86 assembly (clang, -O0):
<lenient_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    114a <lenient_strcmp+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1188 <lenient_strcmp+0x78>
cmpq   $0x0,-0x20(%rbp)
jne    1161 <lenient_strcmp+0x51>
movl   $0xffffffff,-0x4(%rbp)
jmp    1188 <lenient_strcmp+0x78>
cmpq   $0x0,-0x28(%rbp)
jne    1178 <lenient_strcmp+0x68>
movl   $0x1,-0x4(%rbp)
jmp    1188 <lenient_strcmp+0x78>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lenient_strcmp>:
cmp    %rsi,%rdi
je     1124 <lenient_strcmp+0x14>
test   %rdi,%rdi
je     1127 <lenient_strcmp+0x17>
test   %rsi,%rsi
je     112d <lenient_strcmp+0x1d>
jmp    1030 <strcmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @lenient_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %10
10: ; preds = %6, %4, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ -1, %4 ], [ 1, %6 ]
ret i32 %11
}
int snd_info_unregister(struct snd_info_entry *entry) { return 0; }


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

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

LLVM IR (-O0):
%struct.snd_info_entry = type opaque
define i32 @snd_info_unregister(%struct.snd_info_entry* %0) {
%2 = alloca %struct.snd_info_entry*
store %struct.snd_info_entry* %0, %struct.snd_info_entry** %2
ret i32 0
}

LLVM IR (-O2):
%struct.snd_info_entry = type opaque
define i32 @snd_info_unregister(%struct.snd_info_entry* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f10(unsigned long x,
                                               unsigned long y) {
  unsigned long r = x + y;
  if (r < x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1141 <f10+0x31>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f10>:
push   %rbx
mov    %rdi,%rbx
add    %rsi,%rbx
jae    1120 <f10+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @f10(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = load i64, i64* %3
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @foo(i32 0)
br label %14
14: ; preds = %12, %2
%15 = load i64, i64* %5
ret i64 %15
}

LLVM IR (-O2):
define i64 @f10(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = icmp ult i64 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i32 0)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
void f01(a01) int *a01;
{}


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

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

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

LLVM IR (-O2):
define void @f01(i32* nocapture %0) {
ret void
}
__attribute__((no, noclone)) signed __int128 t100_3add(signed __int128 y) {
  signed __int128 r;
  if (__builtin_add_overflow((signed __int128)(2), y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdx
mov    -0x28(%rbp),%rcx
add    $0x2,%rdx
adc    $0x0,%rcx
seto   %al
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x38(%rbp)
test   $0x1,%al
jne    1158 <t100_3add+0x48>
jmp    115f <t100_3add+0x4f>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x2,%rbx
adc    $0x0,%r14
jno    112b <t100_3add+0x1b>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t100_3add(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128
%6 = alloca i128
%7 = bitcast i128* %4 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %4
store i128 %10, i128* %5
%11 = load i128, i128* %5
%12 = call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 2, i128 %11)
%13 = extractvalue { i128, i1 } %12, 1
%14 = extractvalue { i128, i1 } %12, 0
store i128 %14, i128* %6
br i1 %13, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @bar()
br label %17
17: ; preds = %15, %2
%18 = load i128, i128* %6
store i128 %18, i128* %3
%19 = bitcast i128* %3 to { i64, i64 }*
%20 = load { i64, i64 }, { i64, i64 }* %19
ret { i64, i64 } %20
}

LLVM IR (-O2):
define { i64, i64 } @t100_3add(i64 %0, i64 %1) {
%3 = zext i64 %1 to i128
%4 = shl nuw i128 %3, 64
%5 = zext i64 %0 to i128
%6 = or i128 %4, %5
%7 = tail call { i128, i1 } @llvm.sadd.with.overflow.i128(i128 %6, i128 2)
%8 = extractvalue { i128, i1 } %7, 1
%9 = extractvalue { i128, i1 } %7, 0
br i1 %8, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (...) @bar()
br label %12
12: ; preds = %10, %2
%13 = trunc i128 %9 to i64
%14 = lshr i128 %9, 64
%15 = trunc i128 %14 to i64
%16 = insertvalue { i64, i64 } poison, i64 %13, 0
%17 = insertvalue { i64, i64 } %16, i64 %15, 1
ret { i64, i64 } %17
}
void PushRealArgumentSyntaxMapping(double *p_value) {}


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

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

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

LLVM IR (-O2):
define void @PushRealArgumentSyntaxMapping(double* nocapture %0) {
ret void
}
void(writel)(unsigned int b, void volatile *addr) {
  unsigned int volatile *mem_3;
  {
    mem_3 = (unsigned int volatile *)addr;
    (*mem_3) = (unsigned int volatile)b;
    return;
  }
}


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

x86 assembly (clang, -O2):
<writel>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @writel(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
int app_startup(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @app_startup() {
ret i32 0
}

LLVM IR (-O2):
define i32 @app_startup() {
ret i32 0
}
/* Variables and functions */
char const *strerror(int);
const char *cserial_strerror(int errnum) {
  switch (errnum) {
  default:
    return strerror(errnum);
  }
}


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

x86 assembly (clang, -O2):
<cserial_strerror>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @cserial_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
long combi(int n, int r) {
  if (r == 0 || r == n) {
    return 1L;
  } else {
    return combi(n - 1, r) + combi(n - 1, r - 1);
  }
}


x86 assembly (clang, -O0):
<combi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1134 <combi+0x24>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1141 <combi+0x31>
movq   $0x1,-0x8(%rbp)
jmp    1172 <combi+0x62>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
call   1030 <combi@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1030 <combi@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combi>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%eax
test   %esi,%esi
je     1158 <combi+0x48>
mov    %esi,%r14d
mov    %edi,%r15d
cmp    %edi,%esi
je     1158 <combi+0x48>
xor    %eax,%eax
mov    %r14d,%ebx
mov    %rax,%r12
lea    -0x1(%r15),%ebp
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <combi@plt>
add    %r12,%rax
add    $0xffffffff,%ebx
je     1154 <combi+0x44>
cmp    %r14d,%r15d
mov    %ebx,%r14d
mov    %ebp,%r15d
jne    1130 <combi+0x20>
add    $0x1,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @combi(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp eq i32 %1, %0
%5 = or i1 %3, %4
br i1 %5, label %19, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ %1, %2 ]
%8 = phi i32 [ %10, %6 ], [ %0, %2 ]
%9 = phi i64 [ %13, %6 ], [ 0, %2 ]
%10 = add nsw i32 %8, -1
%11 = tail call i64 @combi(i32 %10, i32 %7)
%12 = add nsw i32 %7, -1
%13 = add nsw i64 %11, %9
%14 = icmp eq i32 %12, 0
%15 = icmp eq i32 %7, %8
%16 = or i1 %14, %15
br i1 %16, label %17, label %6
17: ; preds = %6
%18 = add i64 %13, 1
br label %19
19: ; preds = %17, %2
%20 = phi i64 [ 1, %2 ], [ %18, %17 ]
ret i64 %20
}
long TypeLength(char type) {
  switch (type) {
  case 'y':
    return 365 * 24 * 60 * 60;
  case 'M':
    return 31 * 24 * 60 * 60;
  case 'w':
    return 7 * 24 * 60 * 60;
  case 'd':
    return 24 * 60 * 60;
  case 'h':
    return 60 * 60;
  case 'm':
    return 60;
  case 's':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<TypeLength>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
add    $0xffffffb3,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x2c,%eax
ja     118f <TypeLength+0x8f>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0x1e13380,-0x8(%rbp)
01
jmp    1197 <TypeLength+0x97>
movq   $0x28de80,-0x8(%rbp)
jmp    1197 <TypeLength+0x97>
movq   $0x93a80,-0x8(%rbp)
jmp    1197 <TypeLength+0x97>
movq   $0x15180,-0x8(%rbp)
jmp    1197 <TypeLength+0x97>
movq   $0xe10,-0x8(%rbp)
jmp    1197 <TypeLength+0x97>
movq   $0x3c,-0x8(%rbp)
jmp    1197 <TypeLength+0x97>
movq   $0x1,-0x8(%rbp)
jmp    1197 <TypeLength+0x97>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TypeLength>:
add    $0xffffffb3,%edi
cmp    $0x2c,%edi
ja     1123 <TypeLength+0x23>
mov    $0x1e13380,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
mov    $0x28de80,%eax
ret
xor    %eax,%eax
ret
mov    $0x15180,%eax
ret
mov    $0xe10,%eax
ret
mov    $0x1,%eax
ret
mov    $0x93a80,%eax
ret
mov    $0x3c,%eax
ret

LLVM IR (-O0):
define i64 @TypeLength(i8 signext %0) {
%2 = alloca i64
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %13 [
i32 121, label %6
i32 77, label %7
i32 119, label %8
i32 100, label %9
i32 104, label %10
i32 109, label %11
i32 115, label %12
]
6: ; preds = %1
store i64 31536000, i64* %2
br label %14
7: ; preds = %1
store i64 2678400, i64* %2
br label %14
8: ; preds = %1
store i64 604800, i64* %2
br label %14
9: ; preds = %1
store i64 86400, i64* %2
br label %14
10: ; preds = %1
store i64 3600, i64* %2
br label %14
11: ; preds = %1
store i64 60, i64* %2
br label %14
12: ; preds = %1
store i64 1, i64* %2
br label %14
13: ; preds = %1
store i64 0, i64* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @TypeLength(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %9 [
i32 121, label %10
i32 77, label %3
i32 119, label %4
i32 100, label %5
i32 104, label %6
i32 109, label %7
i32 115, label %8
]
3: ; preds = %1
br label %10
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %9, %8, %7, %6, %5, %4, %3
%11 = phi i64 [ 0, %9 ], [ 1, %8 ], [ 60, %7 ], [ 3600, %6 ], [ 86400, %5 ], [ 604800, %4 ], [ 2678400, %3 ], [ 31536000, %1 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ write_port(int, unsigned char);
void move_cursor(int col, int row) {
  unsigned short position = (row * 80) + col;
  write_port(0x3D4, 0x0F);
  write_port(0x3D5, (unsigned char)(position & 0xFF));
  write_port(0x3D4, 0x0E);
  write_port(0x3D5, (unsigned char)((position >> 8) & 0xFF));
}


x86 assembly (clang, -O0):
<move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x50,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %ax,-0xa(%rbp)
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port@plt>
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <write_port@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    $0x3d5,%edi
movzbl %al,%esi
call   1030 <write_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_cursor>:
push   %rbx
lea    (%rsi,%rsi,4),%ebx
shl    $0x4,%ebx
add    %edi,%ebx
mov    $0x3d4,%edi
mov    $0xf,%esi
call   1030 <write_port@plt>
movzbl %bl,%esi
mov    $0x3d5,%edi
call   1030 <write_port@plt>
mov    $0x3d4,%edi
mov    $0xe,%esi
call   1030 <write_port@plt>
movzbl %bh,%esi
mov    $0x3d5,%edi
pop    %rbx
jmp    1030 <write_port@plt>

LLVM IR (-O0):
define void @move_cursor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i16
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 80
%8 = load i32, i32* %3
%9 = add nsw i32 %7, %8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = call i32 @write_port(i32 980, i8 zeroext 15)
%12 = load i16, i16* %5
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = call i32 @write_port(i32 981, i8 zeroext %15)
%17 = call i32 @write_port(i32 980, i8 zeroext 14)
%18 = load i16, i16* %5
%19 = zext i16 %18 to i32
%20 = ashr i32 %19, 8
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = call i32 @write_port(i32 981, i8 zeroext %22)
ret void
}

LLVM IR (-O2):
define void @move_cursor(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 80
%4 = add nsw i32 %3, %0
%5 = tail call i32 @write_port(i32 980, i8 zeroext 15)
%6 = trunc i32 %4 to i8
%7 = tail call i32 @write_port(i32 981, i8 zeroext %6)
%8 = tail call i32 @write_port(i32 980, i8 zeroext 14)
%9 = lshr i32 %4, 8
%10 = trunc i32 %9 to i8
%11 = tail call i32 @write_port(i32 981, i8 zeroext %10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_usleep(int);
int /*<<< orphan*/ pic24_nvmcon_write_completion(int, int);
int /*<<< orphan*/ pic24_nvmcon_write_initiate();
int /*<<< orphan*/ pic24_program_verify();
int /*<<< orphan*/ pic24_six(int, int);
int /*<<< orphan*/ pic24_standby();
void pic24_PIC24FJ_GA6_GB6_erase(void) {
  pic24_program_verify();
  pic24_six(0x2400E0, 0);
  pic24_six(0x883B00, 0);
  pic24_nvmcon_write_initiate();
  pic24_six(0xA8E761, 4);
  io_usleep(25001);
  pic24_nvmcon_write_completion(0x8000, 0x0000);
  pic24_standby();
}


x86 assembly (clang, -O0):
<pic24_PIC24FJ_GA6_GB6_erase>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <pic24_program_verify@plt>
mov    $0x2400e0,%edi
xor    %esi,%esi
call   1080 <pic24_six@plt>
mov    $0x883b00,%edi
xor    %esi,%esi
call   1080 <pic24_six@plt>
mov    $0x0,%al
call   1030 <pic24_nvmcon_write_initiate@plt>
mov    $0xa8e761,%edi
mov    $0x4,%esi
call   1080 <pic24_six@plt>
mov    $0x61a9,%edi
call   1060 <io_usleep@plt>
mov    $0x8000,%edi
xor    %esi,%esi
call   1050 <pic24_nvmcon_write_completion@plt>
mov    $0x0,%al
call   1040 <pic24_standby@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pic24_PIC24FJ_GA6_GB6_erase>:
push   %rax
xor    %eax,%eax
call   1070 <pic24_program_verify@plt>
mov    $0x2400e0,%edi
xor    %esi,%esi
call   1080 <pic24_six@plt>
mov    $0x883b00,%edi
xor    %esi,%esi
call   1080 <pic24_six@plt>
xor    %eax,%eax
call   1030 <pic24_nvmcon_write_initiate@plt>
mov    $0xa8e761,%edi
mov    $0x4,%esi
call   1080 <pic24_six@plt>
mov    $0x61a9,%edi
call   1060 <io_usleep@plt>
mov    $0x8000,%edi
xor    %esi,%esi
call   1050 <pic24_nvmcon_write_completion@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pic24_standby@plt>

LLVM IR (-O0):
define void @pic24_PIC24FJ_GA6_GB6_erase() {
%1 = call i32 (...) @pic24_program_verify()
%2 = call i32 @pic24_six(i32 2359520, i32 0)
%3 = call i32 @pic24_six(i32 8928000, i32 0)
%4 = call i32 (...) @pic24_nvmcon_write_initiate()
%5 = call i32 @pic24_six(i32 11069281, i32 4)
%6 = call i32 @io_usleep(i32 25001)
%7 = call i32 @pic24_nvmcon_write_completion(i32 32768, i32 0)
%8 = call i32 (...) @pic24_standby()
ret void
}

LLVM IR (-O2):
define void @pic24_PIC24FJ_GA6_GB6_erase() {
%1 = tail call i32 (...) @pic24_program_verify()
%2 = tail call i32 @pic24_six(i32 2359520, i32 0)
%3 = tail call i32 @pic24_six(i32 8928000, i32 0)
%4 = tail call i32 (...) @pic24_nvmcon_write_initiate()
%5 = tail call i32 @pic24_six(i32 11069281, i32 4)
%6 = tail call i32 @io_usleep(i32 25001)
%7 = tail call i32 @pic24_nvmcon_write_completion(i32 32768, i32 0)
%8 = tail call i32 (...) @pic24_standby()
ret void
}
/* Variables and functions */
long atol(char const *);
long stringToLong(char *string) { return atol((const char *)string); }


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

x86 assembly (clang, -O2):
<stringToLong>:
jmp    1030 <atol@plt>

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

LLVM IR (-O2):
define i64 @stringToLong(i8* nocapture %0) {
%2 = tail call i64 @atol(i8* %0)
ret i64 %2
}
int lsb_to_int(unsigned char *lsb_array) {
  int result;
  result = ((int)lsb_array[0]) + (((int)lsb_array[1]) << 8) +
           (((int)lsb_array[2]) << 16) + (((int)lsb_array[3]) << 24);
  return result;
}


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

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

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

LLVM IR (-O2):
define i32 @lsb_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
unsigned int cudbg_mbytes_to_bytes(unsigned int size) {
  return size * 1024 * 1024;
}


x86 assembly (clang, -O0):
<cudbg_mbytes_to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
shl    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cudbg_mbytes_to_bytes>:
mov    %edi,%eax
shl    $0x14,%eax
ret

LLVM IR (-O0):
define i32 @cudbg_mbytes_to_bytes(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1024
%5 = mul i32 %4, 1024
ret i32 %5
}

LLVM IR (-O2):
define i32 @cudbg_mbytes_to_bytes(i32 %0) {
%2 = shl i32 %0, 20
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ wFree(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(char);
void wBasAsc() {
  char *string;
  string = wPopString();
  wPushNumber(string[0]);
  wFree(string);
}


x86 assembly (clang, -O0):
<wBasAsc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <wPushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1050 <wFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasAsc>:
push   %rbx
xor    %eax,%eax
call   1030 <wPopString@plt>
mov    %rax,%rbx
movsbl (%rax),%edi
call   1040 <wPushNumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <wFree@plt>

LLVM IR (-O0):
define void @wBasAsc() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i32 @wPushNumber(i8 signext %5)
%7 = load i8*, i8** %1
%8 = call i32 @wFree(i8* %7)
ret void
}

LLVM IR (-O2):
define void @wBasAsc() {
%1 = tail call i8* (...) @wPopString()
%2 = load i8, i8* %1
%3 = tail call i32 @wPushNumber(i8 signext %2)
%4 = tail call i32 @wFree(i8* %1)
ret void
}
void foo() {
  int i;
#pragma omp distribute parallel for
  for (i = 0; i < 10; i)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    111f <foo+0x1f>
jmp    111a <foo+0x1a>
jmp    110b <foo+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ putc(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void etx(uint8_t c) { (void)putc(c, stderr); }


x86 assembly (clang, -O0):
<etx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etx>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @etx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @stderr
%5 = call i32 @putc(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @etx(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @putc(i32 %0, i32 %2)
ret void
}
/* Variables and functions */
unsigned int getNthUglyNo(int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned no = getNthUglyNo(150);
  printf("%d ", no);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x96,%edi
call   1050 <getNthUglyNo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x96,%edi
call   1050 <getNthUglyNo@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = tail call i32 @getNthUglyNo(i32 150)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int ForkWithIO(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ SwitchProgram(char *, char *, char *, char *);
int /*<<< orphan*/ _exit(int);
int Spawn(char *ProgName, char *User, char *Group, char *Dir) {
  int pid;
  pid = ForkWithIO(0, 1, 2);
  if (pid == 0) {
    SwitchProgram(ProgName, User, Group, Dir);
    _exit(pid);
  }
  return (pid);
}


x86 assembly (clang, -O0):
<Spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1050 <ForkWithIO@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    1183 <Spawn+0x53>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <SwitchProgram@plt>
mov    -0x24(%rbp),%edi
call   1040 <_exit@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Spawn>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
call   1050 <ForkWithIO@plt>
test   %eax,%eax
je     1165 <Spawn+0x35>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1030 <SwitchProgram@plt>
xor    %edi,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
define i32 @Spawn(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = call i32 @ForkWithIO(i32 0, i32 1, i32 2)
store i32 %10, i32* %9
%11 = load i32, i32* %9
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %21
13: ; preds = %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = load i8*, i8** %7
%17 = load i8*, i8** %8
%18 = call i32 @SwitchProgram(i8* %14, i8* %15, i8* %16, i8* %17)
%19 = load i32, i32* %9
%20 = call i32 @_exit(i32 %19)
unreachable
21: ; preds = %4
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @Spawn(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @ForkWithIO(i32 0, i32 1, i32 2)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @SwitchProgram(i8* %0, i8* %1, i8* %2, i8* %3)
%9 = tail call i32 @_exit(i32 0)
unreachable
10: ; preds = %4
ret i32 %5
}