xunge/DecIR huggingface dataset:
squash(p, maxp) struct tnode **p, **maxp;
{
  register struct tnode **np;
  for (np = p; np < maxp; np++)
    *np = *(np + 1);
}


x86 assembly (clang, -O0):
<squash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jae    1145 <squash+0x45>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1114 <squash+0x14>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squash>:
cmp    %rsi,%rdi
jae    113f <squash+0x2f>
push   %rax
lea    0x8(%rdi),%rax
cmp    %rax,%rsi
cmovbe %rax,%rsi
mov    %rdi,%rcx
not    %rcx
lea    (%rsi,%rcx,1),%rdx
add    $0x8,%rdx
and    $0xfffffffffffffff8,%rdx
mov    %rax,%rsi
call   1030 <memmove@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
%struct.tnode = type opaque
define i32 @squash(%struct.tnode** %0, %struct.tnode** readnone %1) {
%3 = ptrtoint %struct.tnode** %0 to i64
%4 = icmp ult %struct.tnode** %0, %1
br i1 %4, label %5, label %16
5: ; preds = %2
%6 = ptrtoint %struct.tnode** %1 to i64
%7 = bitcast %struct.tnode** %0 to i8*
%8 = getelementptr %struct.tnode*, %struct.tnode** %0, i64 1
%9 = bitcast %struct.tnode** %8 to i8*
%10 = add i64 %3, 8
%11 = call i64 @llvm.umax.i64(i64 %6, i64 %10)
%12 = xor i64 %3, -1
%13 = add i64 %11, %12
%14 = add i64 %13, 8
%15 = and i64 %14, -8
br label %16
16: ; preds = %5, %2
ret i32 undef
}
float modff(float x, float *y) { return 0.0; }


x86 assembly (clang, -O0):
<modff>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modff>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @modff(float %0, float* %1) {
%3 = alloca float
%4 = alloca float*
store float %0, float* %3
store float* %1, float** %4
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @modff(float %0, float* nocapture readnone %1) {
ret float 0.000000e+00
}
__attribute__((patchable_function_entry(5, 2))) void f52() {}


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

x86 assembly (clang, -O2):
<f52>:
nopl   (%rax)
ret

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

LLVM IR (-O2):
define void @f52() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool pes_validate_header(const uint8_t *p_pes) {
  return ((p_pes[6] & 0xc0) == 0x80);
}


x86 assembly (clang, -O0):
<pes_validate_header>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pes_validate_header>:
mov    $0xc0,%ecx
and    0x18(%rdi),%ecx
xor    %eax,%eax
cmp    $0x80,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @pes_validate_header(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = icmp eq i32 %6, 128
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pes_validate_header(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = and i32 %3, 192
%5 = icmp eq i32 %4, 128
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void memory_error_and_abort(const char *fname) {
  fprintf(stderr, "%s: Out of virtual memory!\n", fname);
  abort();
}


x86 assembly (clang, -O0):
<memory_error_and_abort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<memory_error_and_abort>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"%s: Out of virtual memory!\0A\00"
define void @memory_error_and_abort(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"%s: Out of virtual memory!\0A\00"
define void @memory_error_and_abort(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @abort()
unreachable
}
const char *get_wimax_version() { return "0.0.3rc4"; }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"0.0.3rc4\00"
define i8* @get_wimax_version() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"0.0.3rc4\00"
define i8* @get_wimax_version() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ foo1();
int /*<<< orphan*/ foo2();
int main(void) {
  foo1();
  foo2();
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <foo1@plt>
mov    $0x0,%al
call   1030 <foo2@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <foo1@plt>
xor    %eax,%eax
call   1030 <foo2@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @foo1()
%3 = call i32 (...) @foo2()
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo1()
%2 = tail call i32 (...) @foo2()
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
};
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
void set_signal(int signo, void (*handler)(int)) {
  struct sigaction sa;
  memset(&sa, 0, sizeof(sa));
  sa.sa_handler = (void (*)(int))handler;
  sigaction(signo, &sa, NULL);
}


x86 assembly (clang, -O0):
<set_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_signal>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %rbx,0x8(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)* }
define void @set_signal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = call i32 @memset(%struct.sigaction* %5, i32 0, i32 8)
%7 = load void (i32)*, void (i32)** %4
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %7, void (i32)** %8
%9 = load i32, i32* %3
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %5, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)* }
define void @set_signal(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = call i32 @memset(%struct.sigaction* %3, i32 0, i32 8)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %6
%7 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32* null)
ret void
}
unsigned short inw(int port) {
  unsigned short value;
  __asm__ __volatile__("in"
                       "w"
                       " %w1, %"
                       "w"
                       "0"
                       : "=a"(value)
                       : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inw>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @inw(i32 %0) {
%2 = alloca i32
%3 = alloca i16
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i16 asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @inw(i32 %0) {
%2 = tail call i16 asm sideeffect "inw ${1:w}, ${0:w}", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i16 %2
}
int cashIn(int value) {}


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

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

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

LLVM IR (-O2):
define i32 @cashIn(i32 %0) {
ret i32 undef
}
long long uzss() { return 0x7fff0000ffffffffLL; }


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

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

LLVM IR (-O0):
define i64 @uzss() {
ret i64 9223090566173032447
}

LLVM IR (-O2):
define i64 @uzss() {
ret i64 9223090566173032447
}
int test_imm_0Fint64_lowword_mem(long long *val) {
  return ((*val) & (0x0F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Fint64_lowword_mem>:
testb  $0xf,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Fint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 15
%6 = icmp ne i64 %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_0Fint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 15
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timespec {
  double tv_sec;
  int tv_nsec;
};

/* Variables and functions */
double to_seconds(struct timespec a) { return a.tv_sec + a.tv_nsec * 1e-9; }


x86 assembly (clang, -O0):
<to_seconds>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_seconds>:
cvtsi2sd %edi,%xmm1
mulsd  0xef4(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, i32 }
define double @to_seconds(double %0, i32 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { double, i32 }*
%5 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, i32 }, { double, i32 }* %4, i32 0, i32 1
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to double
%12 = call double @llvm.fmuladd.f64(double %11, double 1.000000e-09, double %8)
ret double %12
}

LLVM IR (-O2):
define double @to_seconds(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = tail call double @llvm.fmuladd.f64(double %3, double 1.000000e-09, double %0)
ret double %4
}
void g_relation_exists() {}


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

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

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

LLVM IR (-O2):
define void @g_relation_exists() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ resolver_shutdown();
void sock_shutdown(void) { resolver_shutdown(); }


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

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

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

LLVM IR (-O2):
define void @sock_shutdown() {
%1 = tail call i32 (...) @resolver_shutdown()
ret void
}
int tls13_server_key_update_recv(struct tls13_ctx *ctx) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.tls13_ctx = type opaque
define i32 @tls13_server_key_update_recv(%struct.tls13_ctx* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int const AF_INET;
int const AF_INET6;
int /*<<< orphan*/ assert(int);
const char *addrfam(const int fam) {
  assert(fam == AF_INET || fam == AF_INET6);
  return fam == AF_INET ? "IPv4" : "IPv6";
}


x86 assembly (clang, -O0):
<addrfam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%al
mov    0x2ec1(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1144 <addrfam+0x34>
mov    -0x4(%rbp),%eax
mov    0x2ea4(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%edx
mov    0x2e8d(%rip),%rax
mov    (%rax),%esi
lea    0xea9(%rip),%rax
lea    0xe9d(%rip),%rcx
cmp    %esi,%edx
cmove  %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addrfam>:
push   %rbx
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    0xee9(%rip),%rcx
lea    0xee7(%rip),%rbx
cmove  %rcx,%rbx
mov    %eax,%edi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = constant i32 0
@AF_INET6 = constant i32 0
@.str = [5 x i8] c"IPv4\00"
@.str.1 = [5 x i8] c"IPv6\00"
define i8* @addrfam(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @AF_INET
%5 = icmp eq i32 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @AF_INET6
%9 = icmp eq i32 %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %2
%15 = load i32, i32* @AF_INET
%16 = icmp eq i32 %14, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
ret i8* %18
}

LLVM IR (-O2):
@AF_INET = constant i32 0
@AF_INET6 = constant i32 0
@.str = [5 x i8] c"IPv4\00"
@.str.1 = [5 x i8] c"IPv6\00"
define i8* @addrfam(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ _TIFFsetByteArray(void **, void *, long);
scalar_t__ strlen(char *);
void _TIFFsetString(char **cpp, char *cp) {
  _TIFFsetByteArray((void **)cpp, (void *)cp, (long)(strlen(cp) + 1));
}


x86 assembly (clang, -O0):
<_TIFFsetString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1040 <_TIFFsetByteArray@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_TIFFsetString>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_TIFFsetByteArray@plt>

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

LLVM IR (-O2):
define void @_TIFFsetString(i8** %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @_TIFFsetByteArray(i8** %0, i8* %1, i64 %4)
ret void
}
void key_3_handler(void) {
  if ((*(volatile unsigned int *)(0x7F008824)) & 4) {
    (*(volatile unsigned int *)(0x7F008824)) &= ~4;
  } else {
    (*(volatile unsigned int *)(0x7F008824)) |= 4;
  }
  return;
}


x86 assembly (clang, -O0):
<key_3_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008824,%eax
mov    (%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     112d <key_3_handler+0x2d>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
jmp    113e <key_3_handler+0x3e>
mov    $0x7f008824,%eax
mov    (%rax),%ecx
or     $0x4,%ecx
mov    $0x7f008824,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_3_handler>:
mov    0x7f008824,%eax
and    $0x4,%eax
mov    0x7f008824,%ecx
and    $0xfffffffb,%ecx
or     %eax,%ecx
xor    $0x4,%ecx
mov    %ecx,0x7f008824
ret

LLVM IR (-O0):
define void @key_3_handler() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, 4
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%6 = and i32 %5, -5
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
br label %10
7: ; preds = %0
%8 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%9 = or i32 %8, 4
store volatile i32 %9, i32* inttoptr (i64 2130741284 to i32*)
br label %10
10: ; preds = %7, %4
ret void
}

LLVM IR (-O2):
define void @key_3_handler() {
%1 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%2 = and i32 %1, 4
%3 = load volatile i32, i32* inttoptr (i64 2130741284 to i32*)
%4 = and i32 %3, -5
%5 = or i32 %2, %4
%6 = xor i32 %5, 4
store volatile i32 %6, i32* inttoptr (i64 2130741284 to i32*)
ret void
}
long long largefooinv(long long a) { return a ? 25089992 : ~25089992; }


x86 assembly (clang, -O0):
<largefooinv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xfe812837,%eax
mov    $0x17ed7c8,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<largefooinv>:
test   %rdi,%rdi
mov    $0xfffffffffe812837,%rcx
mov    $0x17ed7c8,%eax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @largefooinv(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 25089992, i32 -25089993
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @largefooinv(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 -25089993, i64 25089992
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite_repr(char *, int, int /*<<< orphan*/ *);
int set_val(void *ctx, char *val, int vallen) {
  FILE *fp = ctx;
  fwrite_repr(val, vallen, fp);
  fputc(',', fp);
  return 0;
}


x86 assembly (clang, -O0):
<set_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <fwrite_repr@plt>
mov    -0x20(%rbp),%rsi
mov    $0x2c,%edi
call   1030 <fputc@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_val>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %edx,%esi
mov    %rbx,%rdx
call   1040 <fwrite_repr@plt>
mov    $0x2c,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @set_val(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %7
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32 @fwrite_repr(i8* %10, i32 %11, i32* %12)
%14 = load i32*, i32** %7
%15 = call i32 @fputc(i8 signext 44, i32* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @set_val(i8* %0, i8* %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fwrite_repr(i8* %1, i32 %2, i32* %4)
%6 = tail call i32 @fputc(i8 signext 44, i32* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ isboundary(int);
int /*<<< orphan*/ isfluid(int);
int isempty(int flag) { return !isfluid(flag) && !isboundary(flag); }


x86 assembly (clang, -O0):
<isempty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isfluid@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1156 <isempty+0x36>
mov    -0x4(%rbp),%edi
call   1040 <isboundary@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isempty>:
push   %rbx
mov    %edi,%ebx
call   1030 <isfluid@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1132 <isempty+0x12>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <isboundary@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @isempty(i32 %0) {
%2 = tail call i32 @isfluid(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @isboundary(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ aesni_crypt_ecb(int, unsigned char *, int,
                                   unsigned char const *, unsigned char *);
void aeshw_encrypt_ecb(int nr, unsigned char *rk, const unsigned char input[16],
                       unsigned char output[16]) {
  aesni_crypt_ecb(nr, rk, 1, input, output);
}


x86 assembly (clang, -O0):
<aeshw_encrypt_ecb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%edx
call   1030 <aesni_crypt_ecb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeshw_encrypt_ecb>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    $0x1,%edx
jmp    1030 <aesni_crypt_ecb@plt>

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

LLVM IR (-O2):
define void @aeshw_encrypt_ecb(i32 %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @aesni_crypt_ecb(i32 %0, i8* %1, i32 1, i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int log(double);
long idfGeometric(double p, double u) {
  return ((long)(log(1.0 - u) / log(p)));
}


x86 assembly (clang, -O0):
<idfGeometric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cltd
idiv   %ecx
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<idfGeometric>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xedd(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <log@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
cltq
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @idfGeometric(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = fsub double 1.000000e+00, %5
%7 = call i32 @log(double %6)
%8 = load double, double* %3
%9 = call i32 @log(double %8)
%10 = sdiv i32 %7, %9
%11 = sext i32 %10 to i64
ret i64 %11
}

LLVM IR (-O2):
define i64 @idfGeometric(double %0, double %1) {
%3 = fsub double 1.000000e+00, %1
%4 = tail call i32 @log(double %3)
%5 = tail call i32 @log(double %0)
%6 = sdiv i32 %4, %5
%7 = sext i32 %6 to i64
ret i64 %7
}
void test00(char *dstb) { __builtin_memset(dstb, 0, 15); }


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

x86 assembly (clang, -O2):
movq   $0x0,0x7(%rdi)
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @test00(i8* nocapture writeonly %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(15) %0, i8 0, i64 15, i1 false)
ret void
}
OP(dd, d1) { op_d1(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <op_d1@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_d1()
ret i32 undef
}
unsigned int foo(int n) { return ~((unsigned int)~n); }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int reverse_number(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  printf("%d", reverse_number(num));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <reverse_number@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @reverse_number(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int inc(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int x, n;
  x = atoi(argv[1]);
  n = inc(x);
  printf("%d\n", n);
  return 0;
}


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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <inc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1050 <inc@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i8**, i8*** %5
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoi(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @inc(i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @inc(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char);
void putCharXY(int _x, int _y, int _iOut) {
  printf("\x01B[%d;%dH%c", _y, _x, (char)_iOut);
}


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

x86 assembly (clang, -O2):
<putCharXY>:
mov    %edi,%eax
movsbl %dl,%ecx
lea    0xee4(%rip),%rdi
mov    %eax,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[%d;%dH%c\00"
define void @putCharXY(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = trunc i32 %9 to i8
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[%d;%dH%c\00"
define void @putCharXY(i32 %0, i32 %1, i32 %2) {
%4 = trunc i32 %2 to i8
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0, i8 signext %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void failx(const char *test, const char *note) {
  fprintf(stderr, "%s - %s: FAIL\n", test, note);
  exit(1);
}


x86 assembly (clang, -O0):
<failx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<failx>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"%s - %s: FAIL\0A\00"
define void @failx(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"%s - %s: FAIL\0A\00"
define void @failx(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
void f(int a) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
int func(int /*<<< orphan*/);
int main() { return func(fork()); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <func@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fork()
%3 = call i32 @func(i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @func(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_tail(char *tail[], int tail_length) {
  int element = 0;
  while (element < tail_length)
    printf("%s", tail[element++]);
}


x86 assembly (clang, -O0):
<print_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_tail+0x49>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
jmp    1126 <print_tail+0x16>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_tail(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = icmp eq i64 %8, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
int fun697() { return 697; }


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

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

LLVM IR (-O0):
define i32 @fun697() {
ret i32 697
}

LLVM IR (-O2):
define i32 @fun697() {
ret i32 697
}
/* Variables and functions */
int /*<<< orphan*/ die_oom(size_t);
void *realloc(void *, size_t);
void *mem_realloc(void *ptr, size_t size) {
  void *newptr = realloc(ptr, size);
  if (!newptr)
    die_oom(size);
  return newptr;
}


x86 assembly (clang, -O0):
<mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1155 <mem_realloc+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <die_oom@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <mem_realloc+0x1c>
mov    %r14,%rdi
call   1030 <die_oom@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @mem_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die_oom(i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void glMemoryBarrier(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glMemoryBarrier() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
void stop_logging(void) { closelog(); }


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

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

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

LLVM IR (-O2):
define void @stop_logging() {
%1 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
void *dss_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
__attribute__((warn_unused_result)) __attribute__((malloc)) void *
dss_calloc(size_t size) {
  void *ret = dss_malloc(size);
  memset(ret, 0, size);
  return ret;
}


x86 assembly (clang, -O0):
<dss_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dss_malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dss_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <dss_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define noalias i8* @dss_calloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @dss_malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @dss_calloc(i64 %0) {
%2 = tail call i8* @dss_malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
int sys_pipe(tcp)
struct tcb *tcp;
{
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.tcb = type opaque
define i32 @sys_pipe(%struct.tcb* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
scalar_t__ mu_badv_if_up(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (mu_badv_if_up("not_default", NULL)) {
    printf("TRUE");
  } else {
    printf("FALSE");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <mu_badv_if_up@plt>
cmp    $0x0,%rax
je     115a <main+0x3a>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
jmp    1166 <main+0x46>
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"not_default\00"
@.str.1 = [5 x i8] c"TRUE\00"
@.str.2 = [6 x i8] c"FALSE\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @mu_badv_if_up(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* null)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [12 x i8] c"not_default\00"
@.str.1 = [5 x i8] c"TRUE\00"
@.str.2 = [6 x i8] c"FALSE\00"
define i32 @main() {
%1 = tail call i64 @mu_badv_if_up(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* null)
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void toggle_dummy(uint8_t pos) {}


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

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

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

LLVM IR (-O2):
define void @toggle_dummy(i32 %0) {
ret void
}
int get(short *a, int idx) { return a[idx]; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
movslq %esi,%rax
movswl (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @get(i16* %0, i32 %1) {
%3 = alloca i16*
%4 = alloca i32
store i16* %0, i16** %3
store i32 %1, i32* %4
%5 = load i16*, i16** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @get(i16* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i16, i16* %0, i64 %3
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
ret i32 %6
}