xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *pathname, mode_t mode) {
  return open(pathname, O_WRONLY | O_CREAT | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e9e(%rip),%rax
mov    (%rax),%esi
mov    0x2ec5(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2eb1(%rip),%rcx
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_WRONLY
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_WRONLY = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_WRONLY
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
void tosSecurity_init(void) {}


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

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

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

LLVM IR (-O2):
define void @tosSecurity_init() {
ret void
}
int v_box(V, lambda)
float *V, lambda;
{ return 0; }


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

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

LLVM IR (-O0):
define i32 @v_box(float* %0, double %1) {
%3 = alloca float*
%4 = alloca float
%5 = fptrunc double %1 to float
store float* %0, float** %3
store float %5, float* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @v_box(float* nocapture readnone %0, double %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ P_PID;
int /*<<< orphan*/ getpid();
int waitid(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/ *,
           int /*<<< orphan*/);
int main(void) {
  siginfo_t info;
  return waitid(P_PID, getpid(), &info, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
lea    -0x8(%rbp),%rdx
xor    %ecx,%ecx
call   1040 <waitid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xc(%rsp),%rdx
mov    %ebx,%edi
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <waitid@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@P_PID = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @P_PID
%4 = tail call i32 (...) @getpid()
%5 = call i32 @waitid(i32 %3, i32 %4, i32* %1, i32 0)
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcolormap_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xcolormap.serial = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xcolormap_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcolormap_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
#pragma xmp reflect(b)
#pragma xmp task on p(1, 1)
  { printf("PASS\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 = [6 x i8] c"PASS\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int f0(int (*fn)(int *), int *p) { return (*fn)(p); }


x86 assembly (clang, -O0):
<f0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f0>:
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax

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

LLVM IR (-O2):
define i32 @f0(i32 (i32*)* nocapture %0, i32* %1) {
%3 = tail call i32 %0(i32* %1)
ret i32 %3
}
__attribute__((noipa, optimize("Ofast"))) int f5(float x) {
  return __builtin_sqrtf(x) > 0x1.5642e6p+54f;
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
movss  0xed1(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111f <f5+0xf>
sqrtss %xmm0,%xmm0
jmp    1124 <f5+0x14>
call   1030 <sqrtf@plt>
xor    %eax,%eax
ucomiss 0xed3(%rip),%xmm0
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f5(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @sqrtf(float %3)
%5 = fcmp ogt float %4, 0x4355642E60000000
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f5(float %0) {
%2 = tail call float @sqrtf(float %0)
%3 = fcmp ogt float %2, 0x4355642E60000000
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MonitorParentProcessDead();
int main(int argc, char **argv) {
  MonitorParentProcessDead();
  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 <MonitorParentProcessDead@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <MonitorParentProcessDead@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 (...) @MonitorParentProcessDead()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @MonitorParentProcessDead()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ OledDriverUpdateDisplay();
void OledUpdate(void) { OledDriverUpdateDisplay(); }


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

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

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

LLVM IR (-O2):
define void @OledUpdate() {
%1 = tail call i32 (...) @OledDriverUpdateDisplay()
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
__attribute__((always_)) uint64_t clamp_uint64_t(uint64_t a, uint64_t b,
                                                 uint64_t c) {
  return a < b ? b : a > c ? c : a;
}


x86 assembly (clang, -O0):
<clamp_uint64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <clamp_uint64_t+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1156 <clamp_uint64_t+0x56>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1146 <clamp_uint64_t+0x46>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    114e <clamp_uint64_t+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp_uint64_t>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

LLVM IR (-O0):
define i64 @clamp_uint64_t(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp slt i64 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i64, i64* %5
br label %22
12: ; preds = %3
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i64, i64* %6
br label %20
18: ; preds = %12
%19 = load i64, i64* %4
br label %20
20: ; preds = %18, %16
%21 = phi i64 [ %17, %16 ], [ %19, %18 ]
br label %22
22: ; preds = %20, %10
%23 = phi i64 [ %11, %10 ], [ %21, %20 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @clamp_uint64_t(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
void XSharpSendWakeup(void *dpy, unsigned long window) {}


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

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

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

LLVM IR (-O2):
define void @XSharpSendWakeup(i8* nocapture %0, i64 %1) {
ret void
}
int main() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
int HsSprintf(char *buf, char *fmt, ...) {
  int a;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @HsSprintf(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *exe) {
  printf("tochar - turns numbers into characters\n");
  printf("usage: %s <number>\n", exe);
  printf("\twhere <number> is the numeric ascii value of the character you "
         "want.\n");
  printf("\taccepts decimal (NNN), hexidecimal (0xNN), or octal (0NNN)\n");
  return;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"tochar - turns numbers into characters\0A\00"
@.str.1 = [20 x i8] c"usage: %s <number>\0A\00"
@.str.2 = [71 x i8] c"\09where <number> is the numeric ascii value of the character you want.\0A\00"
@.str.3 = [61 x i8] c"\09accepts decimal (NNN), hexidecimal (0xNN), or octal (0NNN)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"usage: %s <number>\0A\00"
@str = [39 x i8] c"tochar - turns numbers into characters\00"
@str.4 = [70 x i8] c"\09where <number> is the numeric ascii value of the character you want.\00"
@str.5 = [60 x i8] c"\09accepts decimal (NNN), hexidecimal (0xNN), or octal (0NNN)\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_power_of_2(const uint32_t x) { return ((x != 0) && !(x & (x - 1))); }


x86 assembly (clang, -O0):
<is_power_of_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112c <is_power_of_2+0x2c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_2>:
test   %edi,%edi
je     110f <is_power_of_2+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %5, %1
%13 = phi i1 [ false, %1 ], [ %11, %5 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_power_of_2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
int f19() {
  return ({
    3;
    ;
    4;
    ;
  });
}


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

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

LLVM IR (-O0):
define i32 @f19() {
%1 = alloca i32
store i32 4, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @f19() {
ret i32 4
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *somePath(struct sqlConnection *, int, char *);
char *visiGeneFullSizePath(struct sqlConnection *conn, int id) {
  return somePath(conn, id, "fullLocation");
}


x86 assembly (clang, -O0):
<visiGeneFullSizePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdx
call   1030 <somePath@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<visiGeneFullSizePath>:
lea    0xee9(%rip),%rdx
jmp    1030 <somePath@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"fullLocation\00"
define i8* @visiGeneFullSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = alloca %struct.sqlConnection*
%4 = alloca i32
store %struct.sqlConnection* %0, %struct.sqlConnection** %3
store i32 %1, i32* %4
%5 = load %struct.sqlConnection*, %struct.sqlConnection** %3
%6 = load i32, i32* %4
%7 = call i8* @somePath(%struct.sqlConnection* %5, i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %7
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [13 x i8] c"fullLocation\00"
define i8* @visiGeneFullSizePath(%struct.sqlConnection* %0, i32 %1) {
%3 = tail call i8* @somePath(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}
void *test_anti_range_100(short n) {
  extern void *alloc_anti_range_100(short) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 2)
    n = 0 - 1;
  return alloc_anti_range_100(n);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1140 <test_anti_range_100+0x30>
movswl -0x2(%rbp),%eax
cmp    $0x2,%eax
jg     1140 <test_anti_range_100+0x30>
movw   $0xffff,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <alloc_anti_range_100@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
cmp    $0x3,%di
mov    $0xffff,%eax
cmovae %edi,%eax
movswl %ax,%edi
jmp    1030 <alloc_anti_range_100@plt>

LLVM IR (-O0):
define i8* @test_anti_range_100(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i16, i16* %2
%8 = sext i16 %7 to i32
%9 = icmp sle i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %6
store i16 -1, i16* %2
br label %11
11: ; preds = %10, %6, %1
%12 = load i16, i16* %2
%13 = call i8* @alloc_anti_range_100(i16 signext %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @test_anti_range_100(i16 signext %0) {
%2 = icmp ult i16 %0, 3
%3 = select i1 %2, i16 -1, i16 %0
%4 = tail call i8* @alloc_anti_range_100(i16 signext %3)
ret i8* %4
}
void *_hzdptr_setv(void volatile *ptr_, void *hzd_) {
  void *volatile *ptr = (void *volatile *)ptr_;
  void *volatile *hzd = (void *volatile *)hzd_;
  void *val = *ptr;
  void *tmp;
  do {
    *hzd = val;
    tmp = val;
    __sync_synchronize();
    val = *ptr;
  } while (val != tmp);
  return val;
}


x86 assembly (clang, -O0):
<_hzdptr_setv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mfence
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x30(%rbp),%rax
jne    1127 <_hzdptr_setv+0x27>
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hzdptr_setv>:
mov    (%rdi),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%rax
mov    %rcx,(%rsi)
mfence
mov    (%rdi),%rcx
cmp    %rax,%rcx
jne    1110 <_hzdptr_setv+0x10>
ret

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

LLVM IR (-O2):
define i8* @_hzdptr_setv(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load volatile i8*, i8** %3
br label %6
6: ; preds = %6, %2
%7 = phi i8* [ %5, %2 ], [ %8, %6 ]
store volatile i8* %7, i8** %4
fence seq_cst
%8 = load volatile i8*, i8** %3
%9 = icmp eq i8* %8, %7
br i1 %9, label %10, label %6
10: ; preds = %6
ret i8* %7
}
/* Variables and functions */
double _asinh(double);
double asinh(double x) { return _asinh(x); }


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

x86 assembly (clang, -O2):
<asinh>:
jmp    1030 <_asinh@plt>

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

LLVM IR (-O2):
define double @asinh(double %0) {
%2 = tail call double @_asinh(double %0)
ret double %2
}
void *d1cp(void *key) {
  double *newkey = malloc(sizeof(double));
  *newkey = *(double *)key;
  return newkey;
}


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

x86 assembly (clang, -O2):
<d1cp>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
movsd  (%rbx),%xmm0
movsd  %xmm0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @d1cp(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = call i8* @malloc(i64 8)
%5 = bitcast i8* %4 to double*
store double* %5, double** %3
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to double*
%8 = load double, double* %7
%9 = load double*, double** %3
store double %8, double* %9
%10 = load double*, double** %3
%11 = bitcast double* %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @d1cp(i8* nocapture %0) {
%2 = tail call dereferenceable_or_null(8) i8* @malloc(i64 8)
%3 = bitcast i8* %2 to double*
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
store double %5, double* %3
ret i8* %2
}
int xbits(unsigned short x) {
  int bt = x & 0x3ff;
  if (x & (1 << 10))
    bt = bt << 6;
  return bt;
}


x86 assembly (clang, -O0):
<xbits>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x3ff,%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x400,%eax
cmp    $0x0,%eax
je     1132 <xbits+0x32>
mov    -0x8(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xbits>:
mov    %edi,%ecx
and    $0x3ff,%ecx
mov    %ecx,%eax
shl    $0x6,%eax
test   $0x400,%edi
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xbits(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i32
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = and i32 %5, 1023
store i32 %6, i32* %3
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = and i32 %8, 1024
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = shl i32 %12, 6
store i32 %13, i32* %3
br label %14
14: ; preds = %11, %1
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @xbits(i16 zeroext %0) {
%2 = zext i16 %0 to i32
%3 = and i32 %2, 1023
%4 = and i32 %2, 1024
%5 = icmp eq i32 %4, 0
%6 = shl nuw nsw i32 %3, 6
%7 = select i1 %5, i32 %3, i32 %6
ret i32 %7
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR75_get(void) { return U_WMRCORENONE_get("U_WMR75"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR75\00"
define i32 @U_WMR75_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR75\00"
define i32 @U_WMR75_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_setr_epi32(int, int, int, int);
__m128i test_mm_setr_epi32(int A, int B, int C, int D) {
  return _mm_setr_epi32(A, B, C, D);
}


x86 assembly (clang, -O0):
<test_mm_setr_epi32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <_mm_setr_epi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_setr_epi32>:
jmp    1030 <_mm_setr_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_setr_epi32(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @_mm_setr_epi32(i32 %0, i32 %1, i32 %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
scalar_t__ san_is_file(char const);
scalar_t__ san_is_rank(char const);
bool san_is_square(const char *SAN) {
  return san_is_file(SAN[0]) && san_is_rank(SAN[1]);
}


x86 assembly (clang, -O0):
<san_is_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <san_is_file@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1161 <san_is_square+0x41>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1040 <san_is_rank@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<san_is_square>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <san_is_file@plt>
test   %rax,%rax
je     1147 <san_is_square+0x27>
movsbl 0x1(%rbx),%edi
call   1040 <san_is_rank@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @san_is_square(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = call i64 @san_is_file(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = call i64 @san_is_rank(i8 signext %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @san_is_square(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @san_is_file(i8 signext %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = tail call i64 @san_is_rank(i8 signext %7)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %5, %1
%12 = phi i32 [ 0, %1 ], [ %10, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ FH_DU();
int /*<<< orphan*/ init();
int /*<<< orphan*/ interface();
int main(void) {
  unsigned int i;
  for (i = 0; i < 135; i++) {
    init();
    interface();
    FH_DU();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x87,-0x8(%rbp)
jae    1176 <main+0x46>
mov    $0x0,%al
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <interface@plt>
mov    $0x0,%al
call   1050 <FH_DU@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x87,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <interface@plt>
xor    %eax,%eax
call   1050 <FH_DU@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp ult i32 %4, 135
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = call i32 (...) @init()
%8 = call i32 (...) @interface()
%9 = call i32 (...) @FH_DU()
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i32 (...) @init()
%4 = tail call i32 (...) @interface()
%5 = tail call i32 (...) @FH_DU()
%6 = add nuw nsw i32 %2, 1
%7 = icmp eq i32 %6, 135
br i1 %7, label %8, label %1
8: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int luhn_digit(char *);
int /*<<< orphan*/ printf(char *, char *, int, int);
void expectDigit(char *a, int digit) {
  int d = luhn_digit(a);
  if (d != digit) {
    printf("`%s` expected digit %d but got %d instead\n\n", a, digit, d);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<expectDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <luhn_digit@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     117b <expectDigit+0x4b>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expectDigit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <luhn_digit@plt>
cmp    %ebp,%eax
jne    1148 <expectDigit+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"`%s` expected digit %d but got %d instead\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @expectDigit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @luhn_digit(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13, i32 %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"`%s` expected digit %d but got %d instead\0A\0A\00"
@EXIT_FAILURE = global i32 0
define void @expectDigit(i8* %0, i32 %1) {
%3 = tail call i32 @luhn_digit(i8* %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %3)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
void object_pool_noop() {}


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

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

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

LLVM IR (-O2):
define void @object_pool_noop() {
ret void
}
int is_weekday(int day_index) {
  return ((day_index + 1) % 7 < 6 && (day_index + 1) % 7 > 0);
}


x86 assembly (clang, -O0):
<is_weekday>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x6,%edx
mov    %al,-0x5(%rbp)
jge    113a <is_weekday+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setg   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_weekday>:
mov    %edi,%eax
add    $0x1,%eax
cltq
imul   $0xffffffff92492493,%rax,%rax
shr    $0x20,%rax
add    %edi,%eax
add    $0x1,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0x2,%eax
add    %ecx,%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
not    %ecx
add    %edi,%ecx
add    $0x1,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_weekday(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 7
%4 = add nsw i32 %3, -1
%5 = icmp ult i32 %4, 5
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char EOF;
char getchar();
void clear_buffer() {
  char c;
  while ((c = getchar()) != EOF && c != '\n')
    ;
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
mov    0x2ebc(%rip),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x2(%rbp)
je     1149 <clear_buffer+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1159 <clear_buffer+0x49>
jmp    115e <clear_buffer+0x4e>
jmp    1118 <clear_buffer+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     112f <clear_buffer+0x1f>
cmp    (%rbx),%al
jne    1120 <clear_buffer+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @clear_buffer() {
%1 = alloca i8
br label %2
2: ; preds = %14, %0
%3 = call signext i8 (...) @getchar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = load i8, i8* @EOF
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %4, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i8, i8* %1
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %8, %2
%13 = phi i1 [ false, %2 ], [ %11, %8 ]
br i1 %13, label %14, label %15
14: ; preds = %12
br label %2
15: ; preds = %12
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @clear_buffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = load i8, i8* @EOF
%4 = icmp ne i8 %2, %3
%5 = icmp ne i8 %2, 10
%6 = and i1 %5, %4
br i1 %6, label %1, label %7
7: ; preds = %1
ret void
}
int doit(int x) {
  __label__ lbl1;
  __label__ lbl2;
  static int jtab_init = 0;
  static void *jtab[2];
  if (!jtab_init) {
    jtab[0] = &&lbl1;
    jtab[1] = &&lbl2;
    jtab_init = 1;
  }
  goto *jtab[x];
lbl1:
  return 1;
lbl2:
  return 2;
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,0x2f22(%rip)
jne    113a <doit+0x3a>
lea    0x37(%rip),%rax
mov    %rax,0x2f1e(%rip)
lea    0x35(%rip),%rax
mov    %rax,0x2f18(%rip)
movl   $0x1,0x2ef6(%rip)
movslq -0x8(%rbp),%rcx
lea    0x2efb(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x10(%rbp)
jmp    116a <doit+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    1165 <doit+0x65>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret
mov    -0x10(%rbp),%rax
jmp    *%rax

x86 assembly (clang, -O2):
<doit>:
cmpb   $0x0,0x2f29(%rip)
jne    1134 <doit+0x34>
lea    0x37(%rip),%rax
movq   %rax,%xmm0
lea    0x25(%rip),%rax
movq   %rax,%xmm1
punpcklqdq %xmm0,%xmm1
movdqa %xmm1,0x2f13(%rip)
movb   $0x1,0x2efc(%rip)
movslq %edi,%rax
lea    0x2f02(%rip),%rcx
jmp    *(%rcx,%rax,8)
mov    $0x1,%eax
ret
mov    $0x2,%eax
ret

LLVM IR (-O0):
@doit.jtab_init = internal global i32 0
@doit.jtab = internal global [2 x i8*] zeroinitializer
define i32 @doit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* @doit.jtab_init
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* blockaddress(@doit, %12), i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @doit.jtab, i64 0, i64 0)
store i8* blockaddress(@doit, %13), i8** getelementptr inbounds ([2 x i8*], [2 x i8*]* @doit.jtab, i64 0, i64 1)
store i32 1, i32* @doit.jtab_init
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [2 x i8*], [2 x i8*]* @doit.jtab, i64 0, i64 %9
%11 = load i8*, i8** %10
br label %16
12: ; preds = %16
store i32 1, i32* %2
br label %14
13: ; preds = %16
store i32 2, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
16: ; preds = %7
%17 = phi i8* [ %11, %7 ]
indirectbr i8* %17, [label %12, label %13]
}

LLVM IR (-O2):
@doit.jtab_init = internal unnamed_addr global i1 false
@doit.jtab = internal unnamed_addr global [2 x i8*] zeroinitializer
define i32 @doit(i32 %0) {
%2 = load i1, i1* @doit.jtab_init
br i1 %2, label %4, label %3
3: ; preds = %1
store <2 x i8*> <i8* blockaddress(@doit, %9), i8* blockaddress(@doit, %8)>, <2 x i8*>* bitcast ([2 x i8*]* @doit.jtab to <2 x i8*>*)
store i1 true, i1* @doit.jtab_init
br label %4
4: ; preds = %3, %1
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* @doit.jtab, i64 0, i64 %5
%7 = load i8*, i8** %6
indirectbr i8* %7, [label %9, label %8]
8: ; preds = %4
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 2, %8 ], [ 1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ gameplay_cleanup();
int /*<<< orphan*/ graphics_sprites_cleanup();
void core_cleanup(void) {
  graphics_sprites_cleanup();
  gameplay_cleanup();
  endwin();
}


x86 assembly (clang, -O0):
<core_cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <graphics_sprites_cleanup@plt>
mov    $0x0,%al
call   1040 <gameplay_cleanup@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<core_cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <graphics_sprites_cleanup@plt>
xor    %eax,%eax
call   1040 <gameplay_cleanup@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <endwin@plt>

LLVM IR (-O0):
define void @core_cleanup() {
%1 = call i32 (...) @graphics_sprites_cleanup()
%2 = call i32 (...) @gameplay_cleanup()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @core_cleanup() {
%1 = tail call i32 (...) @graphics_sprites_cleanup()
%2 = tail call i32 (...) @gameplay_cleanup()
%3 = tail call i32 (...) @endwin()
ret void
}
void _Block_object_assign() {}


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

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

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

LLVM IR (-O2):
define void @_Block_object_assign(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *);
int can_toggle_setting(char *path) {
  FILE *f = fopen(path, "w");
  if (f == NULL) {
    printf("Error opening file! Do you have root powers and is this kernel "
           "mptcp capable?\n");
    return 0;
  }
  fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<can_toggle_setting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1173 <can_toggle_setting+0x43>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1183 <can_toggle_setting+0x53>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_toggle_setting>:
push   %rax
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1151 <can_toggle_setting+0x21>
mov    %rax,%rdi
call   1040 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [79 x i8] c"Error opening file! Do you have root powers and is this kernel mptcp capable?\0A\00"
define i32 @can_toggle_setting(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %14
11: ; preds = %1
%12 = load i32*, i32** %4
%13 = call i32 @fclose(i32* %12)
store i32 1, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@str = [78 x i8] c"Error opening file! Do you have root powers and is this kernel mptcp capable?\00"
define i32 @can_toggle_setting(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
br label %8
6: ; preds = %1
%7 = tail call i32 @fclose(i32* %2)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 0, %4 ], [ 1, %6 ]
ret i32 %9
}
int main() {
  unsigned char arg = 0x80;
  unsigned char out = 0;
  __asm__("rolb $1, %%al;" : "=a"(out) : "a"(arg));
  return (out == 0x01);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x80,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
mov    -0x5(%rbp),%al
rol    %al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x80,%al
rol    %al
xor    %ecx,%ecx
cmp    $0x1,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 -128, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = call i8 asm "rolb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 1
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "rolb $$1, %al;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i8 -128)
%2 = icmp eq i8 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int x(b) { return 4294967295U / (unsigned long)b; }


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    $0xffffffff,%eax
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
movslq %edi,%rax
shr    $0x20,%rax
jne    1113 <x+0x13>
mov    $0xffffffff,%eax
xor    %edx,%edx
div    %edi
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @x(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = udiv i64 4294967295, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @x(i32 %0) {
%2 = sext i32 %0 to i64
%3 = udiv i64 4294967295, %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int sweep_get_standard_start(int n, double *c) {
  int fail, ptos[2];
  ptos[0] = 0;
  ptos[1] = 0;
  fail = _ada_use_c2phc4c(619, ptos, &n, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<sweep_get_standard_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
lea    -0x1c(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x26b,%edi
lea    -0x4(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sweep_get_standard_start>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,0xc(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    $0x26b,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sweep_get_standard_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
%6 = alloca [2 x i32]
store i32 %0, i32* %3
store double* %1, double** %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
store i32 0, i32* %8
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 0
%10 = load double*, double** %4
%11 = call i32 @_ada_use_c2phc4c(i32 619, i32* %9, i32* %3, double* %10, i32 0)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @sweep_get_standard_start(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 0, i32* %7
%8 = call i32 @_ada_use_c2phc4c(i32 619, i32* %6, i32* %3, double* %1, i32 0)
ret i32 %8
}