xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write_src(char *);
void leq_handler(void) {
  write_src("{\n");
  write_src("imm_t b = POP();\n");
  write_src("imm_t a = POP();\n");
  write_src("PUSH(a<=b);\n");
  write_src("}\n");
}


x86 assembly (clang, -O0):
<leq_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedc(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee2(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee9(%rip),%rdi
call   1030 <write_src@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<leq_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <write_src@plt>
lea    0xedf(%rip),%rdi
call   1030 <write_src@plt>
lea    0xee5(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeeb(%rip),%rdi
call   1030 <write_src@plt>
lea    0xeec(%rip),%rdi
pop    %rax
jmp    1030 <write_src@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a<=b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @leq_handler() {
%1 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"{\0A\00"
@.str.1 = [18 x i8] c"imm_t b = POP();\0A\00"
@.str.2 = [18 x i8] c"imm_t a = POP();\0A\00"
@.str.3 = [13 x i8] c"PUSH(a<=b);\0A\00"
@.str.4 = [3 x i8] c"}\0A\00"
define void @leq_handler() {
%1 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @write_src(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @write_src(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @write_src(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}
void XtSuperclass() {}


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

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

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

LLVM IR (-O2):
define void @XtSuperclass() {
ret void
}
/* Variables and functions */
int printReply(int);
int sendRequest(int, char *, char *, int);
int deletef(int sd, char argv[]) {
  int status = sendRequest(sd, "DELETE", argv, 1);
  if (status > 0) {
    status = printReply(sd);
  }
  return status;
}


x86 assembly (clang, -O0):
<deletef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    0xec3(%rip),%rsi
mov    $0x1,%ecx
call   1040 <sendRequest@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    115f <deletef+0x3f>
mov    -0x4(%rbp),%edi
call   1030 <printReply@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deletef>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
lea    0xed3(%rip),%rsi
mov    $0x1,%ecx
call   1040 <sendRequest@plt>
test   %eax,%eax
jle    1143 <deletef+0x23>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <printReply@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"DELETE\00"
define i32 @deletef(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 i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @sendRequest(i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7, i32 1)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %3
%13 = call i32 @printReply(i32 %12)
store i32 %13, i32* %5
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [7 x i8] c"DELETE\00"
define i32 @deletef(i32 %0, i8* %1) {
%3 = tail call i32 @sendRequest(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1, i32 1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printReply(i32 %0)
br label %7
7: ; preds = %5, %2
%8 = phi i32 [ %6, %5 ], [ %3, %2 ]
ret i32 %8
}
main() {
  _Bool x = 1;
  assert(x == 1);
  x++;
  assert(x == 1);
  ++x;
  assert(x == 1);
  x += 1;
  assert(x == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movb   $0x1,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movb   $0x1,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 1, i8* %2
%3 = load i8, i8* %2
%4 = trunc i8 %3 to i1
%5 = zext i1 %4 to i32
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %7)
%9 = load i8, i8* %2
%10 = trunc i8 %9 to i1
store i8 1, i8* %2
%11 = load i8, i8* %2
%12 = trunc i8 %11 to i1
%13 = zext i1 %12 to i32
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %15)
%17 = load i8, i8* %2
%18 = trunc i8 %17 to i1
store i8 1, i8* %2
%19 = load i8, i8* %2
%20 = trunc i8 %19 to i1
%21 = zext i1 %20 to i32
%22 = icmp eq i32 %21, 1
%23 = zext i1 %22 to i32
%24 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %23)
%25 = load i8, i8* %2
%26 = trunc i8 %25 to i1
%27 = zext i1 %26 to i32
%28 = add nsw i32 %27, 1
%29 = icmp ne i32 %28, 0
%30 = zext i1 %29 to i8
store i8 %30, i8* %2
%31 = load i8, i8* %2
%32 = trunc i8 %31 to i1
%33 = zext i1 %32 to i32
%34 = icmp eq i32 %33, 1
%35 = zext i1 %34 to i32
%36 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %35)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ log_assert(char const *, char const *, int, char const *,
                              char *);
__attribute__((noreturn)) void log_assert_failed_unreachable(const char *text,
                                                             const char *file,
                                                             int line,
                                                             const char *func) {
  log_assert(
      text, file, line, func,
      "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
}


x86 assembly (clang, -O0):
<log_assert_failed_unreachable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xec3(%rip),%r8
call   1030 <log_assert@plt>

x86 assembly (clang, -O2):
<log_assert_failed_unreachable>:
push   %rax
lea    0xee8(%rip),%r8
call   1030 <log_assert@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"Code should not be reached '%s' at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed_unreachable(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i8*, i8** %8
%13 = call i32 @log_assert(i8* %9, i8* %10, i32 %11, i8* %12, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [67 x i8] c"Code should not be reached '%s' at %s:%u, function %s(). Aborting.\00"
define void @log_assert_failed_unreachable(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = tail call i32 @log_assert(i8* %0, i8* %1, i32 %2, i8* %3, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printUsage(char *);
int /*<<< orphan*/ printf(char *);
void printHelp(char *commandName) {
  printUsage(commandName);
  printf("\nThis program reads input array of numbers from stdin and writes "
         "output to stdout.\n"
         "The output consists of elements of given array and '?' signs.\n"
         "'?' signs are placed instead of given numbers with probability of "
         "[filling percentage]\n");
}


x86 assembly (clang, -O0):
<printHelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printUsage@plt>
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printHelp>:
push   %rax
call   1040 <printUsage@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [233 x i8] c"\0AThis program reads input array of numbers from stdin and writes output to stdout.\0AThe output consists of elements of given array and '?' signs.\0A'?' signs are placed instead of given numbers with probability of [filling percentage]\0A\00"
define void @printHelp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printUsage(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([233 x i8], [233 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [232 x i8] c"\0AThis program reads input array of numbers from stdin and writes output to stdout.\0AThe output consists of elements of given array and '?' signs.\0A'?' signs are placed instead of given numbers with probability of [filling percentage]\00"
define void @printHelp(i8* %0) {
%2 = tail call i32 @printUsage(i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([232 x i8], [232 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_resad_function_list();
void resad_init() { register_resad_function_list(); }


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

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

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

LLVM IR (-O2):
define void @resad_init() {
%1 = tail call i32 (...) @register_resad_function_list()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *getTime(void) {
  time_t rawtime;
  time(&rawtime);
  return localtime(&rawtime);
}


x86 assembly (clang, -O0):
<getTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <time@plt>
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTime>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @getTime() {
%1 = alloca i32
%2 = call i32 @time(i32* %1)
%3 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %3
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @getTime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int print(int i) { printf("%d\n", i); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @print(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
void set_integer(void *dest, int value, int length) {
  int tmp = value;
  __builtin_memcpy(dest, (void *)&tmp, length);
}


x86 assembly (clang, -O0):
<set_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rsi
movslq -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_integer>:
push   %rax
mov    %esi,0x4(%rsp)
movslq %edx,%rdx
lea    0x4(%rsp),%rsi
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @set_integer(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
store i32 %8, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i32* %7 to i8*
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
ret void
}

LLVM IR (-O2):
define void @set_integer(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 %1, i32* %4
%6 = sext i32 %2 to i64
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xb8() {
  Assert_real((isodigit(184) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              925, ("isodigit should be 0 for 0xb8"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xb8>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb8,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x39d,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xb8>:
push   %rax
mov    $0xb8,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x39d,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb8\00"
define void @t_isodigit_0xb8() {
%1 = call i64 @isodigit(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xb8\00"
define void @t_isodigit_0xb8() {
%1 = tail call i64 @isodigit(i32 184)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 925, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned int __bswapsi2(unsigned int u) {
  return (((u)&0xff000000) >> 24) | (((u)&0x00ff0000) >> 8) |
         (((u)&0x0000ff00) << 8) | (((u)&0x000000ff) << 24);
}


x86 assembly (clang, -O0):
<__bswapsi2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__bswapsi2>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @__bswapsi2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @__bswapsi2(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int strlen(char const *);
int dlg_count_wchars(const char *string) {
  int result;
  { result = strlen(string); }
  return result;
}


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

x86 assembly (clang, -O2):
<dlg_count_wchars>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @dlg_count_wchars(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
unsigned long long gccbugs_ulldiv(unsigned long long a, unsigned long long b) {
  return a / b;
}


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

x86 assembly (clang, -O2):
<gccbugs_ulldiv>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1115 <gccbugs_ulldiv+0x15>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @gccbugs_ulldiv(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = udiv i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @gccbugs_ulldiv(i64 %0, i64 %1) {
%3 = udiv i64 %0, %1
ret i64 %3
}
void fips_fail_notify(void) {}


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

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

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

LLVM IR (-O2):
define void @fips_fail_notify() {
ret void
}
void prune_alias_or_Ok(int x, int y) {
  int a[1];
  if (x != x || y != y) {
    a[1] = 0;
  }
}


x86 assembly (clang, -O0):
<prune_alias_or_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    1122 <prune_alias_or_Ok+0x22>
mov    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1129 <prune_alias_or_Ok+0x29>
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @prune_alias_or_Ok(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
size_t min_sz(size_t a, size_t b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<min_sz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <min_sz+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <min_sz+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_sz>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @min_sz(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
unsigned long nvh1a_hash(unsigned char *string, int len) {
  unsigned result = 0x811c9dc5, ch;
  for (ch = *string++; ch; ch = *string++) {
    result = (result ^ ch) * ((unsigned)0x01000193);
  }
  return (unsigned long)result;
}


x86 assembly (clang, -O0):
<nvh1a_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x811c9dc5,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     115a <nvh1a_hash+0x5a>
mov    -0x10(%rbp),%eax
xor    -0x14(%rbp),%eax
imul   $0x1000193,%eax,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <nvh1a_hash+0x27>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvh1a_hash>:
mov    (%rdi),%al
test   %al,%al
je     1129 <nvh1a_hash+0x29>
add    $0x1,%rdi
mov    $0x811c9dc5,%ecx
nop
movzbl %al,%eax
xor    %ecx,%eax
imul   $0x1000193,%eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <nvh1a_hash+0x10>
mov    %ecx,%eax
ret
mov    $0x811c9dc5,%eax
ret

LLVM IR (-O0):
define i64 @nvh1a_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 -2128831035, i32* %5
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
%10 = zext i8 %9 to i32
store i32 %10, i32* %6
br label %11
11: ; preds = %19, %2
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %11
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = xor i32 %15, %16
%18 = mul i32 %17, 16777619
store i32 %18, i32* %5
br label %19
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
%22 = load i8, i8* %20
%23 = zext i8 %22 to i32
store i32 %23, i32* %6
br label %11
24: ; preds = %11
%25 = load i32, i32* %5
%26 = zext i32 %25 to i64
ret i64 %26
}

LLVM IR (-O2):
define i64 @nvh1a_hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ -2128831035, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = zext i8 %6 to i32
%11 = xor i32 %8, %10
%12 = mul i32 %11, 16777619
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5
%16 = zext i32 %12 to i64
br label %17
17: ; preds = %15, %2
%18 = phi i64 [ 2166136261, %2 ], [ %16, %15 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ print_stack_on_segfault();
int main() {
  f();
  print_stack_on_segfault();
  char *p;
  *p = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1040 <print_stack_on_segfault@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1040 <print_stack_on_segfault@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @print_stack_on_segfault()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void __attribute__((constructor)) init(void) { write(1, "2", 1); }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
lea    0xee0(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"2\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"2\00"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @init, i8* null }]
define void @init() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int strlen(char *);
void chomp(char *str) {
  int l;
  if (str == NULL || *str == '\0')
    return;
  l = strlen(str);
  if (str[--l] == '\n')
    str[l] = '\0';
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1137 <chomp+0x27>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113c <chomp+0x2c>
jmp    1171 <chomp+0x61>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1171 <chomp+0x61>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
test   %rdi,%rdi
je     1134 <chomp+0x24>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     1134 <chomp+0x24>
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1134 <chomp+0x24>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %6
store i8 0, i8* %10
br label %14
14: ; preds = %6, %13, %1, %3
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ ntfs_log_perror(char *, long long);
void *ntfs_malloc(size_t size) {
  void *p;
  p = malloc(size);
  if (!p)
    ntfs_log_perror("Failed to malloc %lld bytes", (long long)size);
  return p;
}


x86 assembly (clang, -O0):
<ntfs_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <ntfs_malloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <ntfs_log_perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntfs_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <ntfs_malloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <ntfs_log_perror@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Failed to malloc %lld bytes\00"
define i8* @ntfs_malloc(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 ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @ntfs_log_perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [28 x i8] c"Failed to malloc %lld bytes\00"
define noalias i8* @ntfs_malloc(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 @ntfs_log_perror(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ c2_addr_write(int /*<<< orphan*/);
int /*<<< orphan*/ c2_data_read(int);
uint8_t reg_read(uint8_t addr) {
  c2_addr_write(addr);
  return c2_data_read(1);
}


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

x86 assembly (clang, -O2):
<reg_read>:
push   %rax
call   1030 <c2_addr_write@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <c2_data_read@plt>

LLVM IR (-O0):
define i32 @reg_read(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @c2_addr_write(i32 %3)
%5 = call i32 @c2_data_read(i32 1)
ret i32 %5
}

LLVM IR (-O2):
define i32 @reg_read(i32 %0) {
%2 = tail call i32 @c2_addr_write(i32 %0)
%3 = tail call i32 @c2_data_read(i32 1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sdio_read_byte(int);
uint8_t adns2080_revision_id_read(void) { return sdio_read_byte((0x01U)); }


x86 assembly (clang, -O0):
<adns2080_revision_id_read>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <sdio_read_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<adns2080_revision_id_read>:
mov    $0x1,%edi
jmp    1030 <sdio_read_byte@plt>

LLVM IR (-O0):
define i32 @adns2080_revision_id_read() {
%1 = call i32 @sdio_read_byte(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @adns2080_revision_id_read() {
%1 = tail call i32 @sdio_read_byte(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ load_gdt_ptr();
void gdt_flush() { load_gdt_ptr(); }


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

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

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

LLVM IR (-O2):
define void @gdt_flush() {
%1 = tail call i32 (...) @load_gdt_ptr()
ret void
}
void enable_lpc(int channel) {
  (*(volatile unsigned char *)(0xffff86)) &= ~(1 << 0);
}


x86 assembly (clang, -O0):
<enable_lpc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffff86,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0xfffffffe,%eax
mov    %al,%cl
mov    $0xffff86,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enable_lpc>:
andb   $0xfe,0xffff86
fe
ret

LLVM IR (-O0):
define void @enable_lpc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load volatile i8, i8* inttoptr (i64 16777094 to i8*)
%4 = zext i8 %3 to i32
%5 = and i32 %4, -2
%6 = trunc i32 %5 to i8
store volatile i8 %6, i8* inttoptr (i64 16777094 to i8*)
ret void
}

LLVM IR (-O2):
define void @enable_lpc(i32 %0) {
%2 = load volatile i8, i8* inttoptr (i64 16777094 to i8*)
%3 = and i8 %2, -2
store volatile i8 %3, i8* inttoptr (i64 16777094 to i8*)
ret void
}
int test_imm_2Euint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x2E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Euint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x2e,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Euint64_lowword_reg>:
test   $0x2e,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_2Euint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 46
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
bool isSeparator(int pos, char chr) {
  if (pos == 0) {
    switch (chr) {
    case ',':
      return true;
    default:
      return false;
    }
  } else
    return false;
}


x86 assembly (clang, -O0):
<isSeparator>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    113f <isSeparator+0x3f>
mov    -0x9(%rbp),%al
sub    $0x2c,%al
jne    1133 <isSeparator+0x33>
jmp    1127 <isSeparator+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1146 <isSeparator+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1146 <isSeparator+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSeparator>:
test   %edi,%edi
sete   %al
cmp    $0x2c,%sil
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isSeparator(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
switch i32 %10, label %12 [
i32 44, label %11
]
11: ; preds = %8
store i32 1, i32* %3
br label %14
12: ; preds = %8
store i32 0, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @isSeparator(i32 %0, i8 signext %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i8 %1, 44
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int fsl_deep_sleep(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fsl_deep_sleep() {
ret i32 0
}
extern int cpufreq_table_thermal_update(int freq, int vdd_arm) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cpufreq_table_thermal_update(i32 %0, i32 %1) {
ret i32 0
}
long align(long a, long b) {
  a += b - 1;
  return a - a % b;
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    (%rdi,%rsi,1),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     111e <align+0x1e>
mov    %rcx,%rax
cqto
idiv   %rsi
jmp    1124 <align+0x24>
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %rdx,%rcx
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @align(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 = sub nsw i64 %5, 1
%7 = load i64, i64* %3
%8 = add nsw i64 %7, %6
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = srem i64 %10, %11
%13 = sub nsw i64 %9, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @align(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = srem i64 %4, %1
%6 = sub nsw i64 %4, %5
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("How to Use:\n"
         "Insert one number(0 <= x >= 255)\n"
         "The desired operation(+, -, /, *)\n"
         "And the second number(0 <= x >= 255)\n\n");
}


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

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

LLVM IR (-O0):
@.str = [118 x i8] c"How to Use:\0AInsert one number(0 <= x >= 255)\0AThe desired operation(+, -, /, *)\0AAnd the second number(0 <= x >= 255)\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([118 x i8], [118 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [117 x i8] c"How to Use:\0AInsert one number(0 <= x >= 255)\0AThe desired operation(+, -, /, *)\0AAnd the second number(0 <= x >= 255)\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([117 x i8], [117 x i8]* @str, i64 0, i64 0))
ret void
}
int func1(struct Data1 *ptr1, struct Data1 *ptr2) { struct Data1 *ptr3 = ptr1; }


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.Data1 = type opaque
define i32 @func1(%struct.Data1* nocapture readnone %0, %struct.Data1* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int _get_uchar_hexvalue(char);
unsigned char _get_uchar(char a, char b) {
  return 16 * _get_uchar_hexvalue(a) + _get_uchar_hexvalue(b);
}


x86 assembly (clang, -O0):
<_get_uchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <_get_uchar_hexvalue@plt>
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x2(%rbp),%edi
call   1030 <_get_uchar_hexvalue@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_uchar>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1030 <_get_uchar_hexvalue@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
mov    %ebx,%edi
call   1030 <_get_uchar_hexvalue@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @_get_uchar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = call i32 @_get_uchar_hexvalue(i8 signext %5)
%7 = mul nsw i32 16, %6
%8 = load i8, i8* %4
%9 = call i32 @_get_uchar_hexvalue(i8 signext %8)
%10 = add nsw i32 %7, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define zeroext i8 @_get_uchar(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @_get_uchar_hexvalue(i8 signext %0)
%4 = shl nsw i32 %3, 4
%5 = tail call i32 @_get_uchar_hexvalue(i8 signext %1)
%6 = add nsw i32 %4, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
void socket_coproc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @socket_coproc_init() {
ret void
}
int sprintf(char *buf, char const *fmt, ...) {
  int a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @sprintf(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int find_or_insert(int);
void *process6(void *arg) {
  int val = 55;
  int found = find_or_insert(val);
  assert(found);
  return NULL;
}


x86 assembly (clang, -O0):
<process6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x37,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <find_or_insert@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process6>:
push   %rax
mov    $0x37,%edi
call   1040 <find_or_insert@plt>
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @process6(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 55, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @find_or_insert(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @assert(i32 %7)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @process6(i8* nocapture readnone %0) {
%2 = tail call i32 @find_or_insert(i32 55)
%3 = tail call i32 @assert(i32 %2)
ret i8* null
}
int foo(int t) {
  int result = 0;
  if (t != 0)
    result = t;
  return result;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111e <foo+0x1e>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
ret i32 %0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, World!\n");
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"Hello, World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = -1;
  i += -1 + 2;
  printf("%d", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
int backtrace(void **array, int size) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @backtrace(i8** nocapture readnone %0, i32 %1) {
ret i32 0
}