xunge/DecIR huggingface dataset:
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ inet_aton(char const *, struct in_addr *);
int /*<<< orphan*/ perror(char *);
void std_inet_aton(const char *dst_addr, struct in_addr *inp) {
  if (inet_aton(dst_addr, inp) == 0) {
    perror("inet_aton");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_inet_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <inet_aton@plt>
cmp    $0x0,%rax
jne    116d <std_inet_aton+0x3d>
lea    0xea2(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_inet_aton>:
push   %rax
call   1030 <inet_aton@plt>
test   %rax,%rax
je     113d <std_inet_aton+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@.str = [10 x i8] c"inet_aton\00"
define void @std_inet_aton(i8* %0, %struct.in_addr* %1) {
%3 = tail call i64 @inet_aton(i8* %0, %struct.in_addr* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
/* Type definitions */
struct cl_rhash {
  int dummy;
};

/* Variables and functions */
scalar_t__ cl_rhash_should_shrink(struct cl_rhash *);
int /*<<< orphan*/ cl_rhash_shrink(struct cl_rhash *);
void cl_rhash_check_shrink(struct cl_rhash *hash) {
  if (cl_rhash_should_shrink(hash))
    cl_rhash_shrink(hash);
}


x86 assembly (clang, -O0):
<cl_rhash_check_shrink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <cl_rhash_should_shrink@plt>
cmp    $0x0,%rax
je     1148 <cl_rhash_check_shrink+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <cl_rhash_shrink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cl_rhash_check_shrink>:
push   %rbx
mov    %rdi,%rbx
call   1040 <cl_rhash_should_shrink@plt>
test   %rax,%rax
je     1137 <cl_rhash_check_shrink+0x17>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <cl_rhash_shrink@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.cl_rhash = type { i32 }
define void @cl_rhash_check_shrink(%struct.cl_rhash* %0) {
%2 = alloca %struct.cl_rhash*
store %struct.cl_rhash* %0, %struct.cl_rhash** %2
%3 = load %struct.cl_rhash*, %struct.cl_rhash** %2
%4 = call i64 @cl_rhash_should_shrink(%struct.cl_rhash* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load %struct.cl_rhash*, %struct.cl_rhash** %2
%8 = call i32 @cl_rhash_shrink(%struct.cl_rhash* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.cl_rhash = type { i32 }
define void @cl_rhash_check_shrink(%struct.cl_rhash* %0) {
%2 = tail call i64 @cl_rhash_should_shrink(%struct.cl_rhash* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @cl_rhash_shrink(%struct.cl_rhash* %0)
br label %6
6: ; preds = %4, %1
ret void
}
nulldev() { return -5; }


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

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

LLVM IR (-O0):
define i32 @nulldev() {
ret i32 -5
}

LLVM IR (-O2):
define i32 @nulldev() {
ret i32 -5
}
/* Variables and functions */
int /*<<< orphan*/ smd(char const *, size_t, int, double *);
void scvd(const char *description, size_t length, double *v) {
  smd(description, length, 1, v);
}


x86 assembly (clang, -O0):
<scvd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <smd@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @scvd(i8* %0, i64 %1, double* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca double*
store i8* %0, i8** %4
store i64 %1, i64* %5
store double* %2, double** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load double*, double** %6
%10 = call i32 @smd(i8* %7, i64 %8, i32 1, double* %9)
ret void
}

LLVM IR (-O2):
define void @scvd(i8* %0, i64 %1, double* %2) {
%4 = tail call i32 @smd(i8* %0, i64 %1, i32 1, double* %2)
ret void
}
int addd(int a, int b) { return a + b + 5; }


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

x86 assembly (clang, -O2):
<addd>:
lea    (%rdi,%rsi,1),%eax
add    $0x5,%eax
ret

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

LLVM IR (-O2):
define i32 @addd(i32 %0, i32 %1) {
%3 = add i32 %0, 5
%4 = add i32 %3, %1
ret i32 %4
}
void clear_bit(unsigned char *bitmap, int bit) {
  bitmap[3 >> bit] &= ~(1 << (bit & 7));
}


x86 assembly (clang, -O0):
<clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
mov    $0x1,%esi
shl    %cl,%esi
xor    $0xffffffff,%esi
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x3,%edx
sar    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edx
and    %esi,%edx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_bit>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
mov    $0x3,%edx
mov    %esi,%ecx
shr    %cl,%rdx
not    %al
and    %al,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @clear_bit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 7
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = ashr i32 3, %10
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %15, %8
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
ret void
}

LLVM IR (-O2):
define void @clear_bit(i8* nocapture %0, i32 %1) {
%3 = and i32 %1, 7
%4 = shl nuw nsw i32 1, %3
%5 = lshr i32 3, %1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = trunc i32 %4 to i8
%10 = xor i8 %9, -1
%11 = and i8 %8, %10
store i8 %11, i8* %7
ret void
}
int test_imm_B9int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xB9 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B9int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12124160
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ OpenSSL_config(char const *);
void OPENSSL_config(const char *config_name) {
  (void)OpenSSL_config(config_name);
}


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

x86 assembly (clang, -O2):
<OPENSSL_config>:
jmp    1030 <OpenSSL_config@plt>

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

LLVM IR (-O2):
define void @OPENSSL_config(i8* %0) {
%2 = tail call i32 @OpenSSL_config(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ slipperySymbol();
int main(int argc, const char *argv[]) {
  slipperySymbol();
  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 <slipperySymbol@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @slipperySymbol()
ret i32 0
}
int *f(int *i) {
  (*i)++;
  return i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
addl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define i32* @f(i32* returned %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 1
store i32 %3, i32* %0
ret i32* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_PCTX;

/* Variables and functions */
int print_gost_01(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, int,
                  int /*<<< orphan*/ *, int);
int pub_print_gost01(BIO *out, const EVP_PKEY *pkey, int indent,
                     ASN1_PCTX *pctx) {
  return print_gost_01(out, pkey, indent, pctx, 1);
}


x86 assembly (clang, -O0):
<pub_print_gost01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <print_gost_01@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pub_print_gost01>:
mov    $0x1,%r8d
jmp    1030 <print_gost_01@plt>

LLVM IR (-O0):
define i32 @pub_print_gost01(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 @print_gost_01(i32* %9, i32* %10, i32 %11, i32* %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
define i32 @pub_print_gost01(i32* %0, i32* %1, i32 %2, i32* %3) {
%5 = tail call i32 @print_gost_01(i32* %0, i32* %1, i32 %2, i32* %3, i32 1)
ret i32 %5
}
void EC_KEY_set_enc_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @EC_KEY_set_enc_flags() {
ret void
}
void mvOsPrefetch(const void *ptr) { return; }


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

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

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

LLVM IR (-O2):
define void @mvOsPrefetch(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void func(const char *name) {
  char buf[4];
  gets(buf);
  printf("%p %s\n", buf, buf);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <gets@plt>
lea    -0xc(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%p %s\0A\00"
define void @func(i8* nocapture readnone %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x27_setup() {
  char cmd[256];
  sprintf(cmd,
          "iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x27_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x27_setup>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x27_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -A INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x27_setup() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
char *cpApgCopyright() {
  return "Copyright (C) 2005 - 2012 Lowell D. Thomas, all rights reserved";
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"Copyright (C) 2005 - 2012 Lowell D. Thomas, all rights reserved\00"
define i8* @cpApgCopyright() {
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [64 x i8] c"Copyright (C) 2005 - 2012 Lowell D. Thomas, all rights reserved\00"
define i8* @cpApgCopyright() {
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int read(int, char *, int);
int sio_read(int fd, char *buf, int len) { return (read(fd, buf, len)); }


x86 assembly (clang, -O0):
<sio_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sio_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @sio_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @read(i32 %7, i8* %8, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @sio_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int getdtablesize() { return 65536; }


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

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

LLVM IR (-O0):
define i32 @getdtablesize() {
ret i32 65536
}

LLVM IR (-O2):
define i32 @getdtablesize() {
ret i32 65536
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void op0xCF(void) { rst(0x08); }


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

x86 assembly (clang, -O2):
<op0xCF>:
mov    $0x8,%edi
jmp    1030 <rst@plt>

LLVM IR (-O0):
define void @op0xCF() {
%1 = call i32 @rst(i32 8)
ret void
}

LLVM IR (-O2):
define void @op0xCF() {
%1 = tail call i32 @rst(i32 8)
ret void
}
/* Variables and functions */
int dhcp_client_start(char *);
int handle_connect_specific(char *, char *);
char *is_specific();
int handle_connect(char *device) {
  char *id = is_specific();
  if (!id)
    return dhcp_client_start(device);
  return handle_connect_specific(device, id);
}


x86 assembly (clang, -O0):
<handle_connect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <is_specific@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1163 <handle_connect+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <dhcp_client_start@plt>
mov    %eax,-0x4(%rbp)
jmp    1173 <handle_connect+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <handle_connect_specific@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_connect>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <is_specific@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     114c <handle_connect+0x1c>
mov    %rax,%rsi
pop    %rbx
jmp    1040 <handle_connect_specific@plt>
pop    %rbx
jmp    1030 <dhcp_client_start@plt>

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

LLVM IR (-O2):
define i32 @handle_connect(i8* %0) {
%2 = tail call i8* (...) @is_specific()
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dhcp_client_start(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @handle_connect_specific(i8* %0, i8* %2)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %7, %6 ], [ %5, %4 ]
ret i32 %9
}
void _ZN11OSMetaClassdlEPvm(__attribute__((__unused__)) void *mem,
                            __attribute__((__unused__)) unsigned long size) {}


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

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

LLVM IR (-O0):
define void @_ZN11OSMetaClassdlEPvm(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 @_ZN11OSMetaClassdlEPvm(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
size_t align_size(size_t num) { return (num + 1023) / 1024 * 1024; }


x86 assembly (clang, -O0):
<align_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3ff,%rax
shr    $0xa,%rax
shl    $0xa,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align_size>:
lea    0x3ff(%rdi),%rax
and    $0xfffffffffffffc00,%rax
ret

LLVM IR (-O0):
define i64 @align_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 1023
%5 = udiv i64 %4, 1024
%6 = mul i64 %5, 1024
ret i64 %6
}

LLVM IR (-O2):
define i64 @align_size(i64 %0) {
%2 = add i64 %0, 1023
%3 = and i64 %2, -1024
ret i64 %3
}
/* Type definitions */
struct list_elem {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
struct list_elem *list_front(struct list *);
struct list_elem *list_begin(struct list *list) {
  return list_front(list);
}


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

x86 assembly (clang, -O2):
<list_begin>:
jmp    1030 <list_front@plt>

LLVM IR (-O0):
%struct.list_elem = type { i32 }
%struct.list = type { i32 }
define %struct.list_elem* @list_begin(%struct.list* %0) {
%2 = alloca %struct.list*
store %struct.list* %0, %struct.list** %2
%3 = load %struct.list*, %struct.list** %2
%4 = call %struct.list_elem* @list_front(%struct.list* %3)
ret %struct.list_elem* %4
}

LLVM IR (-O2):
%struct.list_elem = type { i32 }
%struct.list = type { i32 }
define %struct.list_elem* @list_begin(%struct.list* %0) {
%2 = tail call %struct.list_elem* @list_front(%struct.list* %0)
ret %struct.list_elem* %2
}
void cucF(unsigned char *x) {
  char *y;
  y = x;
}


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

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

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

LLVM IR (-O2):
define void @cucF(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char const *_k_sym_intern(char const *, int);
const char *k_syminstt(const char *string) { return _k_sym_intern(string, 1); }


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

x86 assembly (clang, -O2):
<k_syminstt>:
mov    $0x1,%esi
jmp    1030 <_k_sym_intern@plt>

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

LLVM IR (-O2):
define i8* @k_syminstt(i8* %0) {
%2 = tail call i8* @_k_sym_intern(i8* %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
void ShowPauseProg(void) {
  printf("Press return to continue.\n");
  getchar();
}


x86 assembly (clang, -O0):
<ShowPauseProg>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowPauseProg>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Press return to continue.\0A\00"
define void @ShowPauseProg() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@str = [26 x i8] c"Press return to continue.\00"
define void @ShowPauseProg() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
unsigned xrop3_253_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_253_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_253_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %edi,%esi
lea    -0x100(%rsi),%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_253_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = xor i32 %23, -1
store i32 %24, i32* %10
%25 = load i32, i32* %6
%26 = load i32, i32* %10
%27 = or i32 %25, %26
store i32 %27, i32* %9
%28 = load i32, i32* %7
%29 = load i32, i32* %9
%30 = or i32 %28, %29
store i32 %30, i32* %8
%31 = load i32, i32* %8
%32 = load i32, i32* %6
%33 = xor i32 %32, -1
%34 = and i32 %31, %33
%35 = load i32, i32* %5
%36 = load i32, i32* %6
%37 = and i32 %35, %36
%38 = or i32 %34, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @xrop3_253_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = or i8 %1, %0
%6 = zext i8 %5 to i32
%7 = or i32 %6, -256
%8 = xor i32 %4, -1
%9 = and i32 %7, %8
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ *sbfile(char *, char *);
char *bfile(char name[]) {
  static char fulname[512];
  if (sbfile(fulname, name) == NULL) {
    return NULL;
  }
  return fulname;
}


x86 assembly (clang, -O0):
<bfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0x2f19(%rip),%rdi
call   1030 <sbfile@plt>
cmp    $0x0,%rax
jne    1143 <bfile+0x33>
movq   $0x0,-0x8(%rbp)
jmp    114e <bfile+0x3e>
lea    0x2ef6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bfile>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f25(%rip),%rbx
mov    %rbx,%rdi
call   1030 <sbfile@plt>
test   %rax,%rax
cmovne %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@bfile.fulname = internal global [512 x i8] zeroinitializer
define i8* @bfile(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @sbfile(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @bfile.fulname, i64 0, i64 0), i8* %4)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([512 x i8], [512 x i8]* @bfile.fulname, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@bfile.fulname = internal global [512 x i8] zeroinitializer
define i8* @bfile(i8* %0) {
%2 = tail call i32* @sbfile(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @bfile.fulname, i64 0, i64 0), i8* %0)
%3 = icmp eq i32* %2, null
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @bfile.fulname, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
scalar_t__ isxdigit(char const);
int is_escaped(const char *in) {
  if ((in[0] == '%') && (isxdigit(in[1])) && isxdigit(in[2])) {
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<is_escaped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    1166 <is_escaped+0x56>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
je     1166 <is_escaped+0x56>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
je     1166 <is_escaped+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <is_escaped+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_escaped>:
push   %rbx
cmpb   $0x25,(%rdi)
jne    113f <is_escaped+0x2f>
mov    %rdi,%rbx
movsbl 0x1(%rdi),%edi
call   1030 <isxdigit@plt>
test   %rax,%rax
je     113f <is_escaped+0x2f>
movsbl 0x2(%rbx),%edi
call   1030 <isxdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     113f <is_escaped+0x2f>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_escaped(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 37
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = tail call i64 @isxdigit(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = tail call i64 @isxdigit(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9, %4, %1
br label %15
15: ; preds = %9, %14
%16 = phi i32 [ 0, %14 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ fp_f(float);
fp_d(double d) {
  float f = d;
  fp_f(f);
}


x86 assembly (clang, -O0):
<fp_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <fp_f@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fp_d>:
cvtsd2ss %xmm0,%xmm0
jmp    1030 <fp_f@plt>

LLVM IR (-O0):
define i32 @fp_d(double %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca float
store double %0, double* %3
%5 = load double, double* %3
%6 = fptrunc double %5 to float
store float %6, float* %4
%7 = load float, float* %4
%8 = call i32 @fp_f(float %7)
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @fp_d(double %0) {
%2 = fptrunc double %0 to float
%3 = tail call i32 @fp_f(float %2)
ret i32 undef
}
int __sys_istty(int handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__sys_istty(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int /*<<< orphan*/, int /*<<< orphan*/, long long);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) {
  bar(0, 0, 16LL);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %esi,%esi
mov    $0x10,%edx
mov    %esi,%edi
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x10,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bar(i32 0, i32 0, i64 16)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @bar(i32 0, i32 0, i64 16)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
ne() {
  ol("CMP  BX,AX");
  ol("MOV  AX,1");
  ol("JNZ  $+5");
  ol("MOV  AX,0");
}


x86 assembly (clang, -O0):
<ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ol@plt>
lea    0xee0(%rip),%rdi
call   1030 <ol@plt>
lea    0xede(%rip),%rdi
call   1030 <ol@plt>
lea    0xedb(%rip),%rdi
call   1030 <ol@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <ol@plt>
lea    0xee7(%rip),%rdi
call   1030 <ol@plt>
lea    0xee5(%rip),%rdi
call   1030 <ol@plt>
lea    0xee2(%rip),%rdi
pop    %rax
jmp    1030 <ol@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JNZ $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @ne() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"CMP BX,AX\00"
@.str.1 = [10 x i8] c"MOV AX,1\00"
@.str.2 = [9 x i8] c"JNZ $+5\00"
@.str.3 = [10 x i8] c"MOV AX,0\00"
define i32 @ne() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @ol(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @ol(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ m5_gpu(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ usage();
void do_gpu(int argc, char *argv[]) {
  if (argc < 1)
    usage();
  uint64_t *callno = (uint64_t *)argv[0];
  m5_gpu(*callno, NULL);
}


x86 assembly (clang, -O0):
<do_gpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    1140 <do_gpu+0x20>
mov    $0x0,%al
call   1040 <usage@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <m5_gpu@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_gpu>:
push   %rbx
mov    %rsi,%rbx
test   %edi,%edi
jg     112f <do_gpu+0xf>
xor    %eax,%eax
call   1040 <usage@plt>
mov    (%rbx),%rax
mov    (%rax),%edi
xor    %esi,%esi
pop    %rbx
jmp    1030 <m5_gpu@plt>

LLVM IR (-O0):
define void @do_gpu(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @usage()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %4
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = bitcast i8* %13 to i32*
store i32* %14, i32** %5
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = call i32 @m5_gpu(i32 %16, i32* null)
ret void
}

LLVM IR (-O2):
define void @do_gpu(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = bitcast i8** %1 to i32**
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = tail call i32 @m5_gpu(i32 %9, i32* null)
ret void
}
/* Variables and functions */
float floorf(float);
float *vec2_floor(float *result, float *a) {
  result[0] = floorf(a[0]);
  result[1] = floorf(a[1]);
  return result;
}


x86 assembly (clang, -O0):
<vec2_floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
call   1030 <floorf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
call   1030 <floorf@plt>
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec2_floor>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movss  (%rsi),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,(%rbx)
movss  0x4(%r14),%xmm0
call   1030 <floorf@plt>
movss  %xmm0,0x4(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float* @vec2_floor(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = call float @llvm.floor.f32(float %7)
%9 = load float*, float** %3
%10 = getelementptr inbounds float, float* %9, i64 0
store float %8, float* %10
%11 = load float*, float** %4
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = call float @llvm.floor.f32(float %13)
%15 = load float*, float** %3
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %3
ret float* %17
}

LLVM IR (-O2):
define float* @vec2_floor(float* returned writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @llvm.floor.f32(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @llvm.floor.f32(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
ret float* %0
}
int lockdep_internal(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @lockdep_internal() {
ret i32 0
}
/* Variables and functions */
int SIGUSR1;
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void thread_cancel_signal_handler(int sig_num) {
  if (sig_num == SIGUSR1) {
    pthread_exit(0);
  }
}


x86 assembly (clang, -O0):
<thread_cancel_signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1134 <thread_cancel_signal_handler+0x24>
xor    %edi,%edi
call   1030 <pthread_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_cancel_signal_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1122 <thread_cancel_signal_handler+0x12>
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>
ret

LLVM IR (-O0):
@SIGUSR1 = global i32 0
define void @thread_cancel_signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGUSR1
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @pthread_exit(i32 0)
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGUSR1 = global i32 0
define void @thread_cancel_signal_handler(i32 %0) {
%2 = load i32, i32* @SIGUSR1
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pthread_exit(i32 0)
br label %6
6: ; preds = %4, %1
ret void
}
void t2() {
  int ok = 1;
  int val = 2;
#pragma acc data copy(val)
  {
#pragma acc parallel present(val)
    { val = 7; }
#pragma acc parallel firstprivate(val) copy(ok)
    {
      ok = val == 7;
      val = 9;
    }
  }
  if (!ok)
    __builtin_abort();
  if (val != 7)
    __builtin_abort();
}


x86 assembly (clang, -O0):
<t2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0x7,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1152 <t2+0x42>
call   1030 <abort@plt>
cmpl   $0x7,-0x8(%rbp)
je     1161 <t2+0x51>
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t2>:
push   %rax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @t2() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 7, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 7
%5 = zext i1 %4 to i32
store i32 %5, i32* %1
store i32 9, i32* %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %0
unreachable
9: ; preds = %0
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 7
br i1 %11, label %12, label %13
12: ; preds = %9
unreachable
13: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @t2() {
tail call void @abort()
unreachable
}
char *toStr1() {
  char *s = "abcdefghijkl";
  return s;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"abcdefghijkl\00"
define i8* @toStr1() {
%1 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
@.str = [13 x i8] c"abcdefghijkl\00"
define i8* @toStr1() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ init_uart(int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *);
main() {
  init_uart(0, 1);
  printf("Hello world!");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <init_uart@plt>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @init_uart(i32 0, i32 1)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void console_fgcolour(int colour) { printf("%c[;%dm", 0x1B, colour); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%c[;%dm\00"
define void @console_fgcolour(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ register_indad_function_list();
void indad_init() { register_indad_function_list(); }


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

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

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

LLVM IR (-O2):
define void @indad_init() {
%1 = tail call i32 (...) @register_indad_function_list()
ret void
}
int f255(int x) {
  if (x & 255)
    return 1;
  return x;
}


x86 assembly (clang, -O0):
<f255>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
je     1124 <f255+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112a <f255+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f255>:
test   %dil,%dil
mov    $0x1,%eax
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f255(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 %0, i32 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushinteger8array_(void *x, unsigned int *n) {
  pushNarray((char *)x, (*n * 8));
}


x86 assembly (clang, -O0):
<pushinteger8array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x3,%esi
call   1030 <pushNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushinteger8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushinteger8array_(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** %4
%7 = load i32, i32* %6
%8 = mul i32 %7, 8
%9 = call i32 @pushNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @pushinteger8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @pushNarray(i8* %0, i32 %4)
ret void
}