xunge/DecIR huggingface dataset:
void QEIVelocityDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) &= ~(0x00000020);
}


x86 assembly (clang, -O0):
<QEIVelocityDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0xffffffffffffffdf,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<QEIVelocityDisable>:
andq   $0xffffffffffffffdf,(%rdi)
ret

LLVM IR (-O0):
define void @QEIVelocityDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -33
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @QEIVelocityDisable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = and i64 %3, -33
store volatile i64 %4, i64* %2
ret void
}
void c() {
  char b[5];
  int *ret;
  ret = (int *)(b + 24);
  (*ret) -= 70;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
lea    -0x5(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x46,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @c() {
%1 = alloca [5 x i8]
%2 = alloca i32*
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %3, i64 24
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = sub nsw i32 %7, 70
store i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @c() {
ret void
}
double f4_sum_pre_int_int_int_int_float(int v0, int v1, int v2, int v3,
                                        float v) {
  return (double)v0 + (double)v1 + (double)v2 + (double)v3 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_int_int_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsi2sdl -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_int_int_float>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
cvtsi2sd %ecx,%xmm3
addsd  %xmm2,%xmm1
addsd  %xmm1,%xmm3
cvtss2sd %xmm0,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_int_int_float(i32 %0, i32 %1, i32 %2, i32 %3, float %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store float %4, float* %10
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to double
%13 = load i32, i32* %7
%14 = sitofp i32 %13 to double
%15 = fadd double %12, %14
%16 = load i32, i32* %8
%17 = sitofp i32 %16 to double
%18 = fadd double %15, %17
%19 = load i32, i32* %9
%20 = sitofp i32 %19 to double
%21 = fadd double %18, %20
%22 = load float, float* %10
%23 = fpext float %22 to double
%24 = fadd double %21, %23
ret double %24
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_int_int_float(i32 %0, i32 %1, i32 %2, i32 %3, float %4) {
%6 = sitofp i32 %0 to double
%7 = sitofp i32 %1 to double
%8 = fadd double %6, %7
%9 = sitofp i32 %2 to double
%10 = fadd double %8, %9
%11 = sitofp i32 %3 to double
%12 = fadd double %10, %11
%13 = fpext float %4 to double
%14 = fadd double %12, %13
ret double %14
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  int ret = c;
  if (islower(c))
    ret = c + 0x20;
  return ret;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113c <toupper+0x2c>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i64 @islower(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int /*<<< orphan*/);
int /*<<< orphan*/ doupdate();
int /*<<< orphan*/ endwin();
void refresh_screen(void) {
  endwin();
  doupdate();
  curs_set(0);
}


x86 assembly (clang, -O0):
<refresh_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
mov    $0x0,%al
call   1040 <doupdate@plt>
xor    %edi,%edi
call   1050 <curs_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<refresh_screen>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %eax,%eax
call   1040 <doupdate@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <curs_set@plt>

LLVM IR (-O0):
define void @refresh_screen() {
%1 = call i32 (...) @endwin()
%2 = call i32 (...) @doupdate()
%3 = call i32 @curs_set(i32 0)
ret void
}

LLVM IR (-O2):
define void @refresh_screen() {
%1 = tail call i32 (...) @endwin()
%2 = tail call i32 (...) @doupdate()
%3 = tail call i32 @curs_set(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void clear_line() { fputs("\033[2K", stdout); }


x86 assembly (clang, -O0):
<clear_line>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_line>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2K\00"
@stdout = global i32 0
define void @clear_line() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2K\00"
@stdout = global i32 0
define void @clear_line() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
struct target_ops {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EIO;
int /*<<< orphan*/ errno;
int nomemory(unsigned long long memaddr, char *myaddr, int len, int write,
             struct target_ops *t) {
  errno = EIO;
  return 0;
}


x86 assembly (clang, -O0):
<nomemory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb2(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nomemory>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.target_ops = type { i32 }
@EIO = global i32 0
@errno = global i32 0
define i32 @nomemory(i64 %0, i8* %1, i32 %2, i32 %3, %struct.target_ops* %4) {
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.target_ops*
store i64 %0, i64* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.target_ops* %4, %struct.target_ops** %10
%11 = load i32, i32* @EIO
store i32 %11, i32* @errno
ret i32 0
}

LLVM IR (-O2):
%struct.target_ops = type { i32 }
@EIO = global i32 0
@errno = global i32 0
define i32 @nomemory(i64 %0, i8* nocapture readnone %1, i32 %2, i32 %3, %struct.target_ops* nocapture readnone %4) {
%6 = load i32, i32* @EIO
store i32 %6, i32* @errno
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ setenv(char *, char const *, int);
char *strdup(char *);
int /*<<< orphan*/ tzset();
char *tz_push(const char *tz) {
  char *oldtz = getenv("TZ");
  if (oldtz)
    oldtz = strdup(oldtz);
  setenv("TZ", tz, 1);
  tzset();
  return oldtz;
}


x86 assembly (clang, -O0):
<tz_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1174 <tz_push+0x34>
mov    -0x10(%rbp),%rdi
call   1060 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe81(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
mov    $0x0,%al
call   1050 <tzset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tz_push>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeb2(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1165 <tz_push+0x25>
mov    %rax,%rdi
call   1060 <strdup@plt>
mov    %rax,%rbx
jmp    1167 <tz_push+0x27>
xor    %ebx,%ebx
lea    0xe92(%rip),%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
xor    %eax,%eax
call   1050 <tzset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"TZ\00"
define i8* @tz_push(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %3
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %2
%12 = call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11, i32 1)
%13 = call i32 (...) @tzset()
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"TZ\00"
define noalias i8* @tz_push(i8* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @strdup(i8* %2)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
%8 = tail call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0, i32 1)
%9 = tail call i32 (...) @tzset()
ret i8* %7
}
const char *Format_Description(void) {
  return "Format abstracts the class of operations such as `scanf`, `sprintf` "
         "and "
         "`fprintf` with matching semantics. It provides general `printf` and "
         "`scanf` functionality for several different types objects in a "
         "uniform way. This class is essentially an in-between class, used by "
         "the "
         "`Show` class to read and write output."
         "\n\n"
         "It is important to note that the semantics of these operations match "
         "`printf` and not the newly defined `Show` class. For example it is "
         "perfectly valid to pass a C `int` to these functions, while the "
         "`println` "
         "function from `Show` must be passed only `var` objects.";
}


x86 assembly (clang, -O0):
<Format_Description>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Format_Description>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [581 x i8] c"Format abstracts the class of operations such as `scanf`, `sprintf` and `fprintf` with matching semantics. It provides general `printf` and `scanf` functionality for several different types objects in a uniform way. This class is essentially an in-between class, used by the `Show` class to read and write output.\0A\0AIt is important to note that the semantics of these operations match `printf` and not the newly defined `Show` class. For example it is perfectly valid to pass a C `int` to these functions, while the `println` function from `Show` must be passed only `var` objects.\00"
define i8* @Format_Description() {
ret i8* getelementptr inbounds ([581 x i8], [581 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [581 x i8] c"Format abstracts the class of operations such as `scanf`, `sprintf` and `fprintf` with matching semantics. It provides general `printf` and `scanf` functionality for several different types objects in a uniform way. This class is essentially an in-between class, used by the `Show` class to read and write output.\0A\0AIt is important to note that the semantics of these operations match `printf` and not the newly defined `Show` class. For example it is perfectly valid to pass a C `int` to these functions, while the `println` function from `Show` must be passed only `var` objects.\00"
define i8* @Format_Description() {
ret i8* getelementptr inbounds ([581 x i8], [581 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ d2i_of_void;
typedef int /*<<< orphan*/ X509;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *PEM_ASN1_read(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int /*<<< orphan*/ *, void **,
                                  int /*<<< orphan*/ *, void *);
int /*<<< orphan*/ PEM_STRING_X509;
scalar_t__ d2i_X509;
X509 *PEM_read_X509(FILE *fp, X509 **x, pem_password_cb *cb, void *u) {
  return PEM_ASN1_read((d2i_of_void *)d2i_X509, PEM_STRING_X509, fp, (void **)x,
                       cb, u);
}


x86 assembly (clang, -O0):
<PEM_read_X509>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1030 <PEM_ASN1_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_read_X509>:
mov    %rcx,%r9
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebd(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
jmp    1030 <PEM_ASN1_read@plt>

LLVM IR (-O0):
@d2i_X509 = global i64 0
@PEM_STRING_X509 = global i32 0
define i32* @PEM_read_X509(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i8*
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i8* %3, i8** %8
%9 = load i64, i64* @d2i_X509
%10 = inttoptr i64 %9 to i32*
%11 = load i32, i32* @PEM_STRING_X509
%12 = load i32*, i32** %5
%13 = load i32**, i32*** %6
%14 = bitcast i32** %13 to i8**
%15 = load i32*, i32** %7
%16 = load i8*, i8** %8
%17 = call i32* @PEM_ASN1_read(i32* %10, i32 %11, i32* %12, i8** %14, i32* %15, i8* %16)
ret i32* %17
}

LLVM IR (-O2):
@d2i_X509 = global i64 0
@PEM_STRING_X509 = global i32 0
define i32* @PEM_read_X509(i32* %0, i32** %1, i32* %2, i8* %3) {
%5 = load i64, i64* @d2i_X509
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509
%8 = bitcast i32** %1 to i8**
%9 = tail call i32* @PEM_ASN1_read(i32* %6, i32 %7, i32* %0, i8** %8, i32* %2, i8* %3)
ret i32* %9
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv, char **envp) {
  printf("Hello World!\n");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
add    $0x20,%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 = [14 x i8] c"Hello World!\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
void hleftjustify_(i) int *i;
{ hleftjustify(*i); }


x86 assembly (clang, -O0):
<hleftjustify_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x0,%al
call   1030 <hleftjustify@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hleftjustify_>:
mov    (%rdi),%edi
xor    %eax,%eax
jmp    1030 <hleftjustify@plt>

LLVM IR (-O0):
define void @hleftjustify_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = call i32 (i32, ...) bitcast (i32 (...)* @hleftjustify to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @hleftjustify_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @hleftjustify to i32 (i32, ...)*)(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int main() {
  char str[10];
  snprintf(str, 10, "%s", "abc");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    $0xa,%esi
lea    0xed1(%rip),%rdx
lea    0xecd(%rip),%rcx
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdx
lea    0xee1(%rip),%rcx
lea    0xe(%rsp),%rdi
mov    $0xa,%esi
call   1030 <snprintf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"abc\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ output_check(int);
int /*<<< orphan*/ output_orbits(char *);
int /*<<< orphan*/ output_timing();
void problem_output() {
  output_timing();
  if (output_check(2. * 3.14159265358979323846)) {
    output_orbits("orbit.txt");
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <output_timing@plt>
mov    $0x6,%edi
call   1050 <output_check@plt>
cmp    $0x0,%rax
je     115b <problem_output+0x2b>
lea    0xeaa(%rip),%rdi
call   1040 <output_orbits@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
xor    %eax,%eax
call   1030 <output_timing@plt>
mov    $0x6,%edi
call   1050 <output_check@plt>
test   %rax,%rax
je     1154 <problem_output+0x24>
lea    0xeb2(%rip),%rdi
pop    %rax
jmp    1040 <output_orbits@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"orbit.txt\00"
define void @problem_output() {
%1 = call i32 (...) @output_timing()
%2 = call i64 @output_check(i32 6)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @output_orbits(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"orbit.txt\00"
define void @problem_output() {
%1 = tail call i32 (...) @output_timing()
%2 = tail call i64 @output_check(i32 6)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @output_orbits(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit() { exit(0); }


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @quit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int try_module_get(struct module *x) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define i32 @try_module_get(%struct.module* nocapture readnone %0) {
ret i32 1
}
unsigned long guessReasonableMaxmemory(void) {
  unsigned long const dosDefaultMaxMem = 256u;
  return dosDefaultMaxMem;
}


x86 assembly (clang, -O0):
<guessReasonableMaxmemory>:
push   %rbp
mov    %rsp,%rbp
movq   $0x100,-0x8(%rbp)
mov    $0x100,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @guessReasonableMaxmemory() {
%1 = alloca i64
store i64 256, i64* %1
ret i64 256
}

LLVM IR (-O2):
define i64 @guessReasonableMaxmemory() {
ret i64 256
}
void do_software_interrupt() {}


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

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

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

LLVM IR (-O2):
define void @do_software_interrupt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("rubicSolver ...\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 = [17 x i8] c"rubicSolver ...\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"rubicSolver ...\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
long long bit35() { return 0x0000000800000000LL; }


x86 assembly (clang, -O0):
<bit35>:
push   %rbp
mov    %rsp,%rbp
movabs $0x800000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit35>:
movabs $0x800000000,%rax
ret

LLVM IR (-O0):
define i64 @bit35() {
ret i64 34359738368
}

LLVM IR (-O2):
define i64 @bit35() {
ret i64 34359738368
}
/* Type definitions */
struct task {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int task_print(struct task *);
int good(struct task *t) {
  int status;
  assert(t);
  status = task_print(t);
  assert(status == 0);
  return 0;
}


x86 assembly (clang, -O0):
<good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <task_print@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<good>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <task_print@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.task = type { i32 }
define i32 @good(%struct.task* %0) {
%2 = alloca %struct.task*
%3 = alloca i32
store %struct.task* %0, %struct.task** %2
%4 = load %struct.task*, %struct.task** %2
%5 = ptrtoint %struct.task* %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.task*, %struct.task** %2
%8 = call i32 @task_print(%struct.task* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
%struct.task = type { i32 }
define i32 @good(%struct.task* %0) {
%2 = ptrtoint %struct.task* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @task_print(%struct.task* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
ret i32 0
}
double max(int a, int b) { return a > b ? a : b; }


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

x86 assembly (clang, -O2):
<max>:
cmp    %esi,%edi
cmovg  %edi,%esi
cvtsi2sd %esi,%xmm0
ret

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

LLVM IR (-O2):
define double @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = sitofp i32 %4 to double
ret double %5
}
/* Type definitions */
struct frame {
  int dummy;
};
struct fcgi {
  int dummy;
};

/* Variables and functions */
int process_stdout(struct frame *f, struct fcgi *fcgi, const char *str,
                   size_t num) {
  return 1;
}


x86 assembly (clang, -O0):
<process_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.frame = type { i32 }
%struct.fcgi = type { i32 }
define i32 @process_stdout(%struct.frame* %0, %struct.fcgi* %1, i8* %2, i64 %3) {
%5 = alloca %struct.frame*
%6 = alloca %struct.fcgi*
%7 = alloca i8*
%8 = alloca i64
store %struct.frame* %0, %struct.frame** %5
store %struct.fcgi* %1, %struct.fcgi** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
ret i32 1
}

LLVM IR (-O2):
%struct.frame = type { i32 }
%struct.fcgi = type { i32 }
define i32 @process_stdout(%struct.frame* nocapture readnone %0, %struct.fcgi* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
ret i32 1
}
int process_update(struct process *proc) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.process = type opaque
define i32 @process_update(%struct.process* nocapture readnone %0) {
ret i32 0
}
int get_st3_prop(void) { return 3; }


x86 assembly (clang, -O0):
<get_st3_prop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_st3_prop() {
ret i32 3
}

LLVM IR (-O2):
define i32 @get_st3_prop() {
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ Emit1(int);
void emit_ret(void) { Emit1(0xC3); }


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

x86 assembly (clang, -O2):
<emit_ret>:
mov    $0xc3,%edi
jmp    1030 <Emit1@plt>

LLVM IR (-O0):
define void @emit_ret() {
%1 = call i32 @Emit1(i32 195)
ret void
}

LLVM IR (-O2):
define void @emit_ret() {
%1 = tail call i32 @Emit1(i32 195)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void decimalToBinary(int number) {
  if (number == 0) {
    return;
  } else {
    decimalToBinary(number / 2);
    printf("%d", number % 2);
  }
}


x86 assembly (clang, -O0):
<decimalToBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <decimalToBinary+0x1a>
jmp    1165 <decimalToBinary+0x45>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <decimalToBinary@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalToBinary>:
test   %edi,%edi
je     1152 <decimalToBinary+0x32>
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%ebp
shr    $0x1f,%ebp
add    %edi,%ebp
mov    %ebp,%edi
sar    %edi
call   1040 <decimalToBinary@plt>
and    $0xfffffffe,%ebp
sub    %ebp,%ebx
lea    0xebb(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @decimalToBinary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %12
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sdiv i32 %7, 2
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %12
12: ; preds = %5, %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @decimalToBinary(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = sdiv i32 %0, 2
tail call void @decimalToBinary(i32 %5)
%6 = srem i32 %0, 2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ CRYPTO_cleanup_all_ex_data();
int /*<<< orphan*/ ERR_free_strings();
int /*<<< orphan*/ EVP_cleanup();
int /*<<< orphan*/ SSL_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
void destroySSL(SSL *cSSL, SSL_CTX *ctx) {
  ERR_free_strings();
  EVP_cleanup();
  CRYPTO_cleanup_all_ex_data();
  if (cSSL) {
    SSL_free(cSSL);
  }
  if (ctx) {
    SSL_CTX_free(ctx);
  }
}


x86 assembly (clang, -O0):
<destroySSL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <ERR_free_strings@plt>
mov    $0x0,%al
call   1050 <EVP_cleanup@plt>
mov    $0x0,%al
call   1040 <CRYPTO_cleanup_all_ex_data@plt>
cmpq   $0x0,-0x8(%rbp)
je     1189 <destroySSL+0x39>
mov    -0x8(%rbp),%rdi
call   1030 <SSL_free@plt>
cmpq   $0x0,-0x10(%rbp)
je     119d <destroySSL+0x4d>
mov    -0x10(%rbp),%rdi
call   1070 <SSL_CTX_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroySSL>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <ERR_free_strings@plt>
xor    %eax,%eax
call   1050 <EVP_cleanup@plt>
xor    %eax,%eax
call   1040 <CRYPTO_cleanup_all_ex_data@plt>
test   %rbx,%rbx
je     117c <destroySSL+0x2c>
mov    %rbx,%rdi
call   1030 <SSL_free@plt>
test   %r14,%r14
je     1190 <destroySSL+0x40>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <SSL_CTX_free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @destroySSL(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = call i32 (...) @ERR_free_strings()
%6 = call i32 (...) @EVP_cleanup()
%7 = call i32 (...) @CRYPTO_cleanup_all_ex_data()
%8 = load i32*, i32** %3
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = call i32 @SSL_free(i32* %11)
br label %13
13: ; preds = %10, %2
%14 = load i32*, i32** %4
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i32*, i32** %4
%18 = call i32 @SSL_CTX_free(i32* %17)
br label %19
19: ; preds = %16, %13
ret void
}

LLVM IR (-O2):
define void @destroySSL(i32* %0, i32* %1) {
%3 = tail call i32 (...) @ERR_free_strings()
%4 = tail call i32 (...) @EVP_cleanup()
%5 = tail call i32 (...) @CRYPTO_cleanup_all_ex_data()
%6 = icmp eq i32* %0, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @SSL_free(i32* %0)
br label %9
9: ; preds = %7, %2
%10 = icmp eq i32* %1, null
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 @SSL_CTX_free(i32* %1)
br label %13
13: ; preds = %11, %9
ret void
}
/* Variables and functions */
int /*<<< orphan*/ second(double *);
double cpusec() {
  double t;
  second(&t);
  return t;
}


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

x86 assembly (clang, -O2):
<cpusec>:
push   %rax
mov    %rsp,%rdi
call   1030 <second@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cpusec() {
%1 = alloca double
%2 = call i32 @second(double* %1)
%3 = load double, double* %1
ret double %3
}

LLVM IR (-O2):
define double @cpusec() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @second(double* %1)
%4 = load double, double* %1
ret double %4
}
int test_imm_41int16_reg(short val) {
  return ((val) & (-0x41 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_41int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffbf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_41int16_reg>:
test   $0xffbf,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_41int16_reg(i16 signext %0) {
%2 = and i16 %0, -65
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int myatoi(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char a[] = "12345";
  printf("a[]=%s, a=%d\n", a, myatoi(a));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <myatoi@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x35,0xc(%rsp)
movl   $0x34333231,0x8(%rsp)
34
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <myatoi@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [6 x i8] c"12345\00"
@.str = [14 x i8] c"a[]=%s, a=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%6 = call i32 @myatoi(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [6 x i8] c"12345\00"
@.str = [14 x i8] c"a[]=%s, a=%d\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @myatoi(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_6812(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_6812() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
unsigned bar(unsigned x, unsigned y) {
  if (y >= 32)
    return x;
  else
    return x >> y;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jb     111f <bar+0x1f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <bar+0x2a>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
xor    %ecx,%ecx
cmp    $0x20,%esi
cmovb  %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 31
%4 = select i1 %3, i32 0, i32 %1
%5 = lshr i32 %0, %4
ret i32 %5
}
int main() {
  int x;
  x = 1;
  printf(x);
  if (x == 1) {
    int x;
    x = 2;
    printf("This should execute!");
    printf(x);
  } else {
    printf("This should not!");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1160 <main+0x50>
movl   $0x2,-0xc(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0xc(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116e <main+0x5e>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"This should execute!\00"
@.str.1 = [17 x i8] c"This should not!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = call i32 (i8*, ...) @printf(i8* %6)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %16
10: ; preds = %0
store i32 2, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
%15 = call i32 (i8*, ...) @printf(i8* %14)
br label %18
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %10
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [21 x i8] c"This should execute!\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 1 to i8*))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* inttoptr (i64 2 to i8*))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int get_char(int /*<<< orphan*/ *);
scalar_t__ isspace(int);
int getc_nospace(uint8_t *f) {
  int c;
  while (isspace(c = get_char(f)))
    ;
  return c;
}


x86 assembly (clang, -O0):
<getc_nospace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <get_char@plt>
mov    %eax,%edi
mov    %edi,-0xc(%rbp)
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     114e <getc_nospace+0x2e>
jmp    112c <getc_nospace+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc_nospace>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <get_char@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1130 <getc_nospace+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getc_nospace(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @get_char(i32* %0)
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
scalar_t__ utf8_first_byte_length_hint(unsigned char);
int utf8_first_byte_valid(unsigned char ch) {
  return 0 != utf8_first_byte_length_hint(ch);
}


x86 assembly (clang, -O0):
<utf8_first_byte_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <utf8_first_byte_length_hint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_first_byte_valid>:
push   %rax
call   1030 <utf8_first_byte_length_hint@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @utf8_first_byte_valid(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @utf8_first_byte_length_hint(i8 zeroext %3)
%5 = icmp ne i64 0, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @utf8_first_byte_valid(i8 zeroext %0) {
%2 = tail call i64 @utf8_first_byte_length_hint(i8 zeroext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
regx0reg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((p0[x0]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0xc(%rbp),%eax
jg     1138 <regx0reg1+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <regx0reg1+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0reg1>:
movslq %edx,%rcx
xor    %eax,%eax
cmp    %esi,(%r8,%rcx,4)
setle  %al
ret

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

LLVM IR (-O2):
define i32 @regx0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = icmp sle i32 %9, %1
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ insert(struct Node **, unsigned int);
void insert_data(struct Node **root, unsigned int *data, size_t length) {
  for (size_t i = 0; i < length; ++i) {
    insert(root, data[i]);
  }
}


x86 assembly (clang, -O0):
<insert_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115f <insert_data+0x4f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <insert@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112c <insert_data+0x1c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_data>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1145 <insert_data+0x35>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <insert@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <insert_data+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
define void @insert_data(%struct.Node** %0, i32* %1, i64 %2) {
%4 = alloca %struct.Node**
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
store %struct.Node** %0, %struct.Node*** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
store i64 0, i64* %7
br label %8
8: ; preds = %19, %3
%9 = load i64, i64* %7
%10 = load i64, i64* %6
%11 = icmp ult i64 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load %struct.Node**, %struct.Node*** %4
%14 = load i32*, i32** %5
%15 = load i64, i64* %7
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @insert(%struct.Node** %13, i32 %17)
br label %19
19: ; preds = %12
%20 = load i64, i64* %7
%21 = add i64 %20, 1
store i64 %21, i64* %7
br label %8
22: ; preds = %8
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @insert_data(%struct.Node** %0, i32* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %6
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i64 [ %11, %6 ], [ 0, %3 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @insert(%struct.Node** %0, i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %2
br i1 %12, label %5, label %6
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t gap_event_dedicated_bonding_completed_get_status(const uint8_t *event) {
  return event[2];
}


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

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

LLVM IR (-O0):
define i32 @gap_event_dedicated_bonding_completed_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @gap_event_dedicated_bonding_completed_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
ret i32 %3
}