xunge/DecIR huggingface dataset:
unsigned long gpio_pad_to_dpin(unsigned long pad) {
  static const unsigned long g_ulPadToPinMap[] = {
      49, 54, 56, 57, 58, 59,  60,  61,  62,  63,  0,   1,   2,   3,
      4,  5,  6,  7,  10, 11,  12,  13,  14,  15,  16,  20,  255, 255,
      18, 19, 52, 44, 51, 255, 255, 255, 255, 255, 255, 255, 17,
  };
  return g_ulPadToPinMap[pad];
}


x86 assembly (clang, -O0):
<gpio_pad_to_dpin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xeed(%rip),%rax
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_pad_to_dpin>:
lea    0xef9(%rip),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
@gpio_pad_to_dpin.g_ulPadToPinMap = internal constant [41 x i64] [i64 49, i64 54, i64 56, i64 57, i64 58, i64 59, i64 60, i64 61, i64 62, i64 63, i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 20, i64 255, i64 255, i64 18, i64 19, i64 52, i64 44, i64 51, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 17]
define i64 @gpio_pad_to_dpin(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = getelementptr inbounds [41 x i64], [41 x i64]* @gpio_pad_to_dpin.g_ulPadToPinMap, i64 0, i64 %3
%5 = load i64, i64* %4
ret i64 %5
}

LLVM IR (-O2):
@gpio_pad_to_dpin.g_ulPadToPinMap = internal unnamed_addr constant [41 x i64] [i64 49, i64 54, i64 56, i64 57, i64 58, i64 59, i64 60, i64 61, i64 62, i64 63, i64 0, i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 20, i64 255, i64 255, i64 18, i64 19, i64 52, i64 44, i64 51, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 255, i64 17]
define i64 @gpio_pad_to_dpin(i64 %0) {
%2 = getelementptr inbounds [41 x i64], [41 x i64]* @gpio_pad_to_dpin.g_ulPadToPinMap, i64 0, i64 %0
%3 = load i64, i64* %2
ret i64 %3
}
int cmp_double(const void *p1, const void *p2) {
  double r = *(const double *)p1 - *(const double *)p2;
  if (r < 0)
    return -1;
  else if (r > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<cmp_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    113b <cmp_double+0x3b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <cmp_double+0x60>
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1159 <cmp_double+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1160 <cmp_double+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_double>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_double(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to double*
%9 = load double, double* %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
%12 = load double, double* %11
%13 = fsub double %9, %12
store double %13, double* %6
%14 = load double, double* %6
%15 = fcmp olt double %14, 0.000000e+00
br i1 %15, label %16, label %17
16: ; preds = %2
store i32 -1, i32* %3
br label %22
17: ; preds = %2
%18 = load double, double* %6
%19 = fcmp ogt double %18, 0.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1, i32* %3
br label %22
21: ; preds = %17
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %16
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @cmp_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fcmp olt double %7, 0.000000e+00
%9 = fcmp ogt double %7, 0.000000e+00
%10 = zext i1 %9 to i32
%11 = select i1 %8, i32 -1, i32 %10
ret i32 %11
}
void av_find_default_stream_index() {}


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

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

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

LLVM IR (-O2):
define void @av_find_default_stream_index() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFD;
int /*<<< orphan*/ F_SETFD;
int fcntl(int, int /*<<< orphan*/, ...);
int lbs_posix_del_fd(int fd, int fdflags) {
  int orgfd = fcntl(fd, F_GETFD);
  if (orgfd < 0) {
    return -1;
  }
  return fcntl(fd, F_SETFD, orgfd & ~(fdflags));
}


x86 assembly (clang, -O0):
<lbs_posix_del_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114a <lbs_posix_del_fd+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <lbs_posix_del_fd+0x5b>
mov    -0x8(%rbp),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbs_posix_del_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1149 <lbs_posix_del_fd+0x39>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
not    %ebp
and    %ebp,%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
define i32 @lbs_posix_del_fd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @F_GETFD
%9 = call i32 (i32, i32, ...) @fcntl(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %21
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* @F_SETFD
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
%20 = call i32 (i32, i32, ...) @fcntl(i32 %14, i32 %15, i32 %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@F_GETFD = global i32 0
@F_SETFD = global i32 0
define i32 @lbs_posix_del_fd(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFD
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @F_SETFD
%8 = xor i32 %1, -1
%9 = and i32 %4, %8
%10 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %7, i32 %9)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ listifaces();
int main(int argc, char **argv) {
  listifaces();
  return 0;
}


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

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

LLVM IR (-O0):
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 (...) @listifaces()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @listifaces()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *prog) {
  printf("usage: %s filename\n", prog);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"usage: %s filename\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *my_malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *my_strdup(const char *str) {
  char *new_str;
  new_str = my_malloc(strlen(str) + 1);
  strcpy(new_str, str);
  return new_str;
}


x86 assembly (clang, -O0):
<my_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <my_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1030 <my_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @my_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @my_malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @my_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @my_malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
zcall(sname) char *sname;
{
  debug_ol("; zcall");
  ot("jsr	");
  outname(sname);
  nl();
}


x86 assembly (clang, -O0):
<zcall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1060 <debug_ol@plt>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <ot@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outname@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zcall>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1060 <debug_ol@plt>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <ot@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <outname@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"; zcall\00"
@.str.1 = [5 x i8] c"jsr\09\00"
define i32 @zcall(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %6)
%8 = call i32 (...) @nl()
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"; zcall\00"
@.str.1 = [5 x i8] c"jsr\09\00"
define i32 @zcall(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @outname to i32 (i8*, ...)*)(i8* %0)
%5 = tail call i32 (...) @nl()
ret i32 undef
}
long long f5(void) {
  long long a = 0x80000000LL;
  return (a & 0x80000000) ? 0x80000000LL : 0LL;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000000,%eax
mov    %rax,-0x8(%rbp)
movabs $0x80000000,%rdx
and    -0x8(%rbp),%rdx
xor    %eax,%eax
mov    $0x80000000,%ecx
cmp    $0x0,%rdx
cmovne %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    $0x80000000,%eax
ret

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

LLVM IR (-O2):
define i64 @f5() {
ret i64 2147483648
}
/* Variables and functions */
int /*<<< orphan*/ fatalerror(char *);
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *copy(char *s) {
  char *p;
  p = malloc(strlen(s) + 1);
  if (p == NULL)
    fatalerror("Ran out of memory.");
  (void)strcpy(p, s);
  return (p);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117c <copy+0x3c>
lea    0xe89(%rip),%rdi
call   1060 <fatalerror@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1169 <copy+0x29>
lea    0xe9c(%rip),%rdi
call   1060 <fatalerror@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Ran out of memory.\00"
define i8* @copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @fatalerror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i8*, i8** %3
%14 = load i8*, i8** %2
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"Ran out of memory.\00"
define i8* @copy(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @fatalerror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
%9 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
void save_atags(struct tag *tags) {}


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

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

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

LLVM IR (-O2):
%struct.tag = type opaque
define void @save_atags(%struct.tag* nocapture %0) {
ret void
}
/* Variables and functions */
int fact(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d\n", fact(num));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <fact@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fact@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @fact(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime_r(int /*<<< orphan*/ const *, struct tm *);
struct tm *localtime(const time_t *timer) {
  static struct tm tmbuf;
  return localtime_r(timer, &tmbuf);
}


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

x86 assembly (clang, -O2):
<localtime>:
lea    0x2f15(%rip),%rsi
jmp    1030 <localtime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@localtime.tmbuf = internal global %struct.tm zeroinitializer
define %struct.tm* @localtime(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call %struct.tm* @localtime_r(i32* %3, %struct.tm* @localtime.tmbuf)
ret %struct.tm* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@localtime.tmbuf = internal global %struct.tm zeroinitializer
define %struct.tm* @localtime(i32* %0) {
%2 = tail call %struct.tm* @localtime_r(i32* %0, %struct.tm* @localtime.tmbuf)
ret %struct.tm* %2
}
/* Variables and functions */
long double cubic(int /*<<< orphan*/, long double, long double);
long double ref_catrom(long double x) { return cubic(0, 0.5l, x); }


x86 assembly (clang, -O0):
<ref_catrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
flds   0xed3(%rip)
fstpt  (%rax)
xor    %edi,%edi
call   1030 <cubic@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ref_catrom>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fstpt  0x10(%rsp)
flds   0xede(%rip)
fstpt  (%rsp)
xor    %edi,%edi
call   1030 <cubic@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @ref_catrom(x86_fp80 %0) {
%2 = tail call x86_fp80 @cubic(i32 0, x86_fp80 0xK3FFE8000000000000000, x86_fp80 %0)
ret x86_fp80 %2
}
/* Variables and functions */
int /*<<< orphan*/ op_mkdir(int /*<<< orphan*/);
int /*<<< orphan*/ op_rmdir(int /*<<< orphan*/);
int /*<<< orphan*/ op_sync();
int /*<<< orphan*/ writeemptyfile(int);
void wl_rmdir(void) {
  op_mkdir(0);
  writeemptyfile(1);
  op_sync();
  op_rmdir(0);
}


x86 assembly (clang, -O0):
<wl_rmdir>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <op_mkdir@plt>
mov    $0x1,%edi
call   1030 <writeemptyfile@plt>
mov    $0x0,%al
call   1060 <op_sync@plt>
xor    %edi,%edi
call   1050 <op_rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wl_rmdir>:
push   %rax
xor    %edi,%edi
call   1040 <op_mkdir@plt>
mov    $0x1,%edi
call   1030 <writeemptyfile@plt>
xor    %eax,%eax
call   1060 <op_sync@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <op_rmdir@plt>

LLVM IR (-O0):
define void @wl_rmdir() {
%1 = call i32 @op_mkdir(i32 0)
%2 = call i32 @writeemptyfile(i32 1)
%3 = call i32 (...) @op_sync()
%4 = call i32 @op_rmdir(i32 0)
ret void
}

LLVM IR (-O2):
define void @wl_rmdir() {
%1 = tail call i32 @op_mkdir(i32 0)
%2 = tail call i32 @writeemptyfile(i32 1)
%3 = tail call i32 (...) @op_sync()
%4 = tail call i32 @op_rmdir(i32 0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int numberOfSetBits(int);
int numberOfSetBitsBelow(uint32_t bits, uint32_t i) {
  return numberOfSetBits(bits & ((1 << i) - 1));
}


x86 assembly (clang, -O0):
<numberOfSetBitsBelow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
and    %eax,%edi
call   1030 <numberOfSetBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfSetBitsBelow>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
and    %eax,%edi
jmp    1030 <numberOfSetBits@plt>

LLVM IR (-O0):
define i32 @numberOfSetBitsBelow(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sub nsw i32 %7, 1
%9 = and i32 %5, %8
%10 = call i32 @numberOfSetBits(i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @numberOfSetBitsBelow(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
%6 = tail call i32 @numberOfSetBits(i32 %5)
ret i32 %6
}
/* Variables and functions */
scalar_t__ floor(long double);
int ifloorl(long double a) { return (int)floor(a); }


x86 assembly (clang, -O0):
<ifloorl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <floor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ifloorl>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @ifloorl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @floor(x86_fp80 %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @ifloorl(x86_fp80 %0) {
%2 = tail call i64 @floor(x86_fp80 %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
long get_num(char *, char *);
char *long2str(char *, int /*<<< orphan*/);
int /*<<< orphan*/ tt_nexternal(int, long);
char *macttNExternal(char *arg) {
  int tbl;
  long top;
  top = get_num("ttExternal", arg);
  tbl = (int)get_num("ttExternal", arg);
  return (long2str(arg, tt_nexternal(tbl, top)));
}


x86 assembly (clang, -O0):
<macttNExternal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <get_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <get_num@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <tt_nexternal@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1050 <long2str@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<macttNExternal>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec1(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_num@plt>
mov    %eax,%edi
mov    %r15,%rsi
call   1040 <tt_nexternal@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <long2str@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"ttExternal\00"
define i8* @macttNExternal(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @get_num(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = call i64 @get_num(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = call i32 @tt_nexternal(i32 %11, i64 %12)
%14 = call i8* @long2str(i8* %10, i32 %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [11 x i8] c"ttExternal\00"
define i8* @macttNExternal(i8* %0) {
%2 = tail call i64 @get_num(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @get_num(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @tt_nexternal(i32 %4, i64 %2)
%6 = tail call i8* @long2str(i8* %0, i32 %5)
ret i8* %6
}
int Monitor_process() {
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<Monitor_process>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Monitor_process+0x9>
jmp    1109 <Monitor_process+0x9>

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

LLVM IR (-O0):
define i32 @Monitor_process() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define i32 @Monitor_process() {
br label %1
1: ; preds = %0, %1
br label %1
}
long hash31(long long a, long long b, long long x) {
  long long result;
  long lresult;
  result = (a * x) + b;
  result = ((result >> 31) + result) & 2147483647;
  lresult = (long)result;
  return (lresult);
}


x86 assembly (clang, -O0):
<hash31>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sar    $0x1f,%rax
add    -0x20(%rbp),%rax
and    $0x7fffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash31>:
imul   %rdx,%rdi
lea    (%rdi,%rsi,1),%rcx
mov    %rcx,%rax
shr    $0x1f,%rax
add    %ecx,%eax
and    $0x7fffffff,%eax
ret

LLVM IR (-O0):
define i64 @hash31(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%9 = load i64, i64* %4
%10 = load i64, i64* %6
%11 = mul nsw i64 %9, %10
%12 = load i64, i64* %5
%13 = add nsw i64 %11, %12
store i64 %13, i64* %7
%14 = load i64, i64* %7
%15 = ashr i64 %14, 31
%16 = load i64, i64* %7
%17 = add nsw i64 %15, %16
%18 = and i64 %17, 2147483647
store i64 %18, i64* %7
%19 = load i64, i64* %7
store i64 %19, i64* %8
%20 = load i64, i64* %8
ret i64 %20
}

LLVM IR (-O2):
define i64 @hash31(i64 %0, i64 %1, i64 %2) {
%4 = mul nsw i64 %2, %0
%5 = add nsw i64 %4, %1
%6 = lshr i64 %5, 31
%7 = add i64 %6, %5
%8 = and i64 %7, 2147483647
ret i64 %8
}
/* Variables and functions */
double __ocml_log10_f64(double);
double log10(double x) { return __ocml_log10_f64(x); }


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

x86 assembly (clang, -O2):
<log10>:
jmp    1030 <__ocml_log10_f64@plt>

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

LLVM IR (-O2):
define double @log10(double %0) {
%2 = tail call double @__ocml_log10_f64(double %0)
ret double %2
}
/* Variables and functions */
int get_data_int();
int /*<<< orphan*/ send_int_to_srv(int);
int get_mixer_value() {
  send_int_to_srv(0x1a);
  return get_data_int();
}


x86 assembly (clang, -O0):
<get_mixer_value>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
call   1030 <send_int_to_srv@plt>
mov    $0x0,%al
call   1040 <get_data_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mixer_value>:
push   %rax
mov    $0x1a,%edi
call   1030 <send_int_to_srv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <get_data_int@plt>

LLVM IR (-O0):
define i32 @get_mixer_value() {
%1 = call i32 @send_int_to_srv(i32 26)
%2 = call i32 (...) @get_data_int()
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_mixer_value() {
%1 = tail call i32 @send_int_to_srv(i32 26)
%2 = tail call i32 (...) @get_data_int()
ret i32 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ font;
};
typedef TYPE_1__ XTextItem16;

/* Variables and functions */
unsigned long get_XTextItem16_font(void *_p) {
  return (unsigned long)((XTextItem16 *)_p)->font;
}


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

x86 assembly (clang, -O2):
<get_XTextItem16_font>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XTextItem16_font(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XTextItem16_font(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ error_general(char *);
void assert_one(size_t size, size_t *ptr) {
  if (*ptr >= size) {
    error_general("Expected argument (1 more token) in inline bytecode!");
  }
}


x86 assembly (clang, -O0):
<assert_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x8(%rbp),%rax
jb     113d <assert_one+0x2d>
lea    0xec8(%rip),%rdi
call   1030 <error_general@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_one>:
cmp    %rdi,(%rsi)
jae    1116 <assert_one+0x6>
ret
lea    0xee3(%rip),%rdi
jmp    1030 <error_general@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Expected argument (1 more token) in inline bytecode!\00"
define void @assert_one(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 = load i64, i64* %5
%7 = load i64, i64* %3
%8 = icmp uge i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @error_general(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Expected argument (1 more token) in inline bytecode!\00"
define void @assert_one(i64 %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = icmp ult i64 %3, %0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @error_general(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bigMacCall();
int /*<<< orphan*/ cleanup();
void Specification2(void) {
  {
    {
      bigMacCall();
      cleanup();
    }
    return;
  }
}


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

x86 assembly (clang, -O2):
<Specification2>:
push   %rax
xor    %eax,%eax
call   1030 <bigMacCall@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup@plt>

LLVM IR (-O0):
define void @Specification2() {
%1 = call i32 (...) @bigMacCall()
%2 = call i32 (...) @cleanup()
ret void
}

LLVM IR (-O2):
define void @Specification2() {
%1 = tail call i32 (...) @bigMacCall()
%2 = tail call i32 (...) @cleanup()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ phone_book(char *);
void main() { phone_book("724"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"724\00"
define void @main() {
%1 = call i32 @phone_book(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"724\00"
define void @main() {
%1 = tail call i32 @phone_book(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
struct internal_ibv_mr *ibv_mr_to_internal(struct ibv_mr *mr) {
  return (struct internal_ibv_mr *)mr;
}


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

x86 assembly (clang, -O2):
<ibv_mr_to_internal>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.internal_ibv_mr = type opaque
%struct.ibv_mr = type opaque
define %struct.internal_ibv_mr* @ibv_mr_to_internal(%struct.ibv_mr* %0) {
%2 = alloca %struct.ibv_mr*
store %struct.ibv_mr* %0, %struct.ibv_mr** %2
%3 = load %struct.ibv_mr*, %struct.ibv_mr** %2
%4 = bitcast %struct.ibv_mr* %3 to %struct.internal_ibv_mr*
ret %struct.internal_ibv_mr* %4
}

LLVM IR (-O2):
%struct.internal_ibv_mr = type opaque
%struct.ibv_mr = type opaque
define %struct.internal_ibv_mr* @ibv_mr_to_internal(%struct.ibv_mr* readnone %0) {
%2 = bitcast %struct.ibv_mr* %0 to %struct.internal_ibv_mr*
ret %struct.internal_ibv_mr* %2
}
__attribute__((hotpatch(-1, 0))) int main(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int /*<<< orphan*/ *);
void input_Pi_N(int32_t *p) { scanf("%d", p); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @input_Pi_N(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %0)
ret void
}
void f(int x) { x++; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ foo(int, char *, char *);
int /*<<< orphan*/ memset(char *, int, int);
int main() {
  char s[100];
  memset(s, 42, 50);
  memset(s + 50, 69, 50);
  foo(50, s, s + 50);
  assert(s[50] == 42);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x2a,%esi
mov    $0x32,%edx
call   1030 <memset@plt>
lea    -0x70(%rbp),%rdi
add    $0x32,%rdi
mov    $0x45,%esi
mov    $0x32,%edx
call   1030 <memset@plt>
lea    -0x70(%rbp),%rsi
lea    -0x70(%rbp),%rdx
add    $0x32,%rdx
mov    $0x32,%edi
call   1050 <foo@plt>
movsbl -0x3e(%rbp),%eax
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x2a,%esi
mov    $0x32,%edx
call   1030 <memset@plt>
lea    0x32(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x45,%esi
mov    $0x32,%edx
call   1030 <memset@plt>
mov    $0x32,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <foo@plt>
xor    %edi,%edi
cmpb   $0x2a,0x32(%rsp)
sete   %dil
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 42, i32 50)
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds i8, i8* %5, i64 50
%7 = call i32 @memset(i8* %6, i32 69, i32 50)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds i8, i8* %9, i64 50
%11 = call i32 @foo(i32 50, i8* %8, i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 50
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 42
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @memset(i8* %2, i32 42, i32 50)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 50
%5 = call i32 @memset(i8* %4, i32 69, i32 50)
%6 = call i32 @foo(i32 50, i8* %2, i8* %4)
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 42
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nondet_int();
int main() { nondet_int(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @nondet_int()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @nondet_int()
ret i32 0
}
void adc_init(void) {
  *(unsigned char *)0x5401 = 0x70;
  *(unsigned char *)0x5402 = 0x08;
  *(unsigned char *)0x5403 = 0x00;
  *(unsigned char *)0x5400 = 0x00;
  *(unsigned char *)0x5407 = 0x0F;
  *(unsigned char *)0x5401 |= 0x01;
}


x86 assembly (clang, -O0):
<adc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5401,%eax
movb   $0x70,(%rax)
mov    $0x5402,%eax
movb   $0x8,(%rax)
mov    $0x5403,%eax
movb   $0x0,(%rax)
mov    $0x5400,%eax
movb   $0x0,(%rax)
mov    $0x5407,%eax
movb   $0xf,(%rax)
mov    $0x5401,%eax
movzbl (%rax),%eax
or     $0x1,%eax
mov    %al,%cl
mov    $0x5401,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adc_init>:
movb   $0x70,0x5401
70
movb   $0x8,0x5402
08
movb   $0x0,0x5403
movb   $0x0,0x5400
movb   $0xf,0x5407
0f
orb    $0x1,0x5401
01
ret

LLVM IR (-O0):
define void @adc_init() {
store i8 112, i8* inttoptr (i64 21505 to i8*)
store i8 8, i8* inttoptr (i64 21506 to i8*)
store i8 0, i8* inttoptr (i64 21507 to i8*)
store i8 0, i8* inttoptr (i64 21504 to i8*)
store i8 15, i8* inttoptr (i64 21511 to i8*)
%1 = load i8, i8* inttoptr (i64 21505 to i8*)
%2 = zext i8 %1 to i32
%3 = or i32 %2, 1
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 21505 to i8*)
ret void
}

LLVM IR (-O2):
define void @adc_init() {
store i8 112, i8* inttoptr (i64 21505 to i8*)
store i8 8, i8* inttoptr (i64 21506 to i8*)
store i8 0, i8* inttoptr (i64 21507 to i8*)
store i8 0, i8* inttoptr (i64 21504 to i8*)
store i8 15, i8* inttoptr (i64 21511 to i8*)
%1 = load i8, i8* inttoptr (i64 21505 to i8*)
%2 = or i8 %1, 1
store i8 %2, i8* inttoptr (i64 21505 to i8*)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint16_t load16(const void *src) {
  const uint8_t *p = (const uint8_t *)src;
  return (uint16_t)(((uint32_t)(p[0]) << 0) | ((uint32_t)(p[1]) << 8));
}


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

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

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

LLVM IR (-O2):
define i32 @load16(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %9, %4
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void PrintNBar(int width, char c, char left, char right) {
  int i;
  putchar(left);
  for (i = 1; i <= width; i++)
    putchar(c);
  putchar(right);
  printf("\n");
}


x86 assembly (clang, -O0):
<PrintNBar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %edi,-0x4(%rbp)
mov    %dl,-0x5(%rbp)
mov    %cl,-0x6(%rbp)
mov    %al,-0x7(%rbp)
movsbl -0x6(%rbp),%edi
call   1030 <putchar@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     116e <PrintNBar+0x4e>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114b <PrintNBar+0x2b>
movsbl -0x7(%rbp),%edi
call   1030 <putchar@plt>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintNBar>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,%edi
call   1030 <putchar@plt>
test   %ebp,%ebp
jle    113c <PrintNBar+0x2c>
movsbl %bl,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1130 <PrintNBar+0x20>
movsbl %r14b,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @PrintNBar(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i32 %0, i32* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8, i8* %7
%11 = call i32 @putchar(i8 signext %10)
store i32 1, i32* %9
br label %12
12: ; preds = %19, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %5
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %6
%18 = call i32 @putchar(i8 signext %17)
br label %19
19: ; preds = %16
%20 = load i32, i32* %9
%21 = add nsw i32 %20, 1
store i32 %21, i32* %9
br label %12
22: ; preds = %12
%23 = load i8, i8* %8
%24 = call i32 @putchar(i8 signext %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @PrintNBar(i32 %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = tail call i32 @putchar(i8 signext %2)
%6 = icmp slt i32 %0, 1
br i1 %6, label %12, label %7
7: ; preds = %4, %7
%8 = phi i32 [ %10, %7 ], [ 1, %4 ]
%9 = tail call i32 @putchar(i8 signext %1)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %8, %0
br i1 %11, label %12, label %7
12: ; preds = %7, %4
%13 = tail call i32 @putchar(i8 signext %3)
%14 = tail call i32 bitcast (i32 (i8)* @putchar to i32 (i32)*)(i32 10)
ret void
}
void set_bold(int flag) { flag = flag; }


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

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

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

LLVM IR (-O2):
define void @set_bold(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_hex(unsigned char *s, int len) {
  for (int i = 0; i < len; i++) {
    printf("%02X", 0xff & s[i]);
  }
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <print_hex+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
and    $0xff,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_hex+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <print_hex+0x36>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_hex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%02X\00"
define void @print_hex(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = and i32 255, %16
%18 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%02X\00"
define void @print_hex(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("hello, Greg!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"hello, Greg!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void ptr_set_to_zero(int *x) { *x = 0; }


x86 assembly (clang, -O0):
<ptr_set_to_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_set_to_zero>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @ptr_set_to_zero(i32* nocapture writeonly %0) {
store i32 0, i32* %0
ret void
}