xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ bfill(char *, int, int);
void *memset(void *m, int c, int size) {
  bfill((char *)m, (int)size, c);
  return (m);
}


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

x86 assembly (clang, -O2):
<memset>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rbx
mov    %edx,%esi
mov    %eax,%edx
call   1030 <bfill@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned %0, i32 %1, i32 %2) {
%4 = tail call i32 @bfill(i8* %0, i32 %2, i32 %1)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ incorrect_password(char *);
int main(int argc, char *argv[]) { incorrect_password(argv[1]); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <incorrect_password@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @incorrect_password(i8* %7)
ret i32 0
}

LLVM IR (-O2):
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 @incorrect_password(i8* %4)
ret i32 0
}
int test_imm_3Buint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x3B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Buint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 59
%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_3Buint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3866624
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void wpas_dbus_signal_wps_event_m2d(struct wpa_supplicant *wpa_s,
                                    struct wps_event_m2d *m2d) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wps_event_m2d = type opaque
define void @wpas_dbus_signal_wps_event_m2d(%struct.wpa_supplicant* %0, %struct.wps_event_m2d* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wps_event_m2d*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wps_event_m2d* %1, %struct.wps_event_m2d** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wps_event_m2d = type opaque
define void @wpas_dbus_signal_wps_event_m2d(%struct.wpa_supplicant* nocapture %0, %struct.wps_event_m2d* nocapture %1) {
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_start(int);
void write_two_pages_start(void) {
  ssize_t n;
  init_test();
  n = log_write_start(8192);
  basic_test(n == 8192);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_two_pages_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x2000,%edi
call   1050 <log_write_start@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x2000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1040 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_two_pages_start>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x2000,%edi
call   1050 <log_write_start@plt>
xor    %edi,%edi
cmp    $0x2000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_two_pages_start() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_start(i32 8192)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 8192
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_two_pages_start() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_start(i32 8192)
%3 = icmp eq i32 %2, 8192
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Type definitions */
typedef int const int64_t;
typedef int const int32_t;

/* Variables and functions */
int32_t mul32(int32_t x, int32_t y, const int fractional_digits) {
  return (int32_t)(((int64_t)x * y) >> fractional_digits);
}


x86 assembly (clang, -O0):
<mul32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul32>:
mov    %edx,%ecx
mov    %edi,%eax
imul   %esi,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @mul32(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* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = ashr i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mul32(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %1, %0
%5 = ashr i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/, int, int, int /*<<< orphan*/, int, int);
void *msvd_map_extmem(int fd) {
  return mmap(0, (8 * 1024 * 1024), PROT_READ | PROT_WRITE, MAP_SHARED, fd,
              0x1000000);
}


x86 assembly (clang, -O0):
<msvd_map_extmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%edx
mov    0x2ea5(%rip),%rax
or     (%rax),%edx
mov    0x2eb4(%rip),%rax
mov    (%rax),%ecx
mov    -0x4(%rbp),%r8d
xor    %edi,%edi
mov    $0x800000,%esi
mov    $0x1000000,%r9d
call   1030 <mmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msvd_map_extmem>:
mov    %edi,%r8d
mov    0x2ede(%rip),%rax
mov    0x2eaf(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    $0x800000,%esi
mov    $0x1000000,%r9d
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @msvd_map_extmem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @PROT_WRITE
%5 = or i32 %3, %4
%6 = load i32, i32* @MAP_SHARED
%7 = load i32, i32* %2
%8 = call i8* @mmap(i32 0, i32 8388608, i32 %5, i32 %6, i32 %7, i32 16777216)
ret i8* %8
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
define i8* @msvd_map_extmem(i32 %0) {
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %3, %2
%5 = load i32, i32* @MAP_SHARED
%6 = tail call i8* @mmap(i32 0, i32 8388608, i32 %4, i32 %5, i32 %0, i32 16777216)
ret i8* %6
}
char *hash_plugin_summary(void) {
  return ("privkey \tSSH/SSL private key passphrase plugin");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"privkey \09SSH/SSL private key passphrase plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"privkey \09SSH/SSL private key passphrase plugin\00"
define i8* @hash_plugin_summary() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ itob(int, char *, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int n;
  char string[1000];
  n = 2803;
  printf("%d decimal represented in hex", n);
  itob(n, string, 16);
  printf(" is %s\n", string);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0xaf3,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x3f0(%rbp),%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xed1(%rip),%rdi
mov    $0xaf3,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    $0xaf3,%edi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1040 <itob@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"%d decimal represented in hex\00"
@.str.1 = [8 x i8] c" is %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 2803, i32* %1
%3 = load i32, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %1
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i32 @itob(i32 %5, i8* %6, i32 16)
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"%d decimal represented in hex\00"
@.str.1 = [8 x i8] c" is %s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 2803)
%4 = call i32 @itob(i32 2803, i8* %2, i32 16)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
uint64_t to_nanos(struct timespec t) {
  return (uint64_t)t.tv_sec * 1000000000 + t.tv_nsec;
}


x86 assembly (clang, -O0):
<to_nanos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,%eax,%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_nanos>:
imul   $0x3b9aca00,%esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @to_nanos(i32 %0, i64 %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { i32, i64 }*
%5 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 0
store i32 %0, i32* %5
%6 = getelementptr inbounds { i32, i64 }, { i32, i64 }* %4, i32 0, i32 1
store i64 %1, i64* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = mul nsw i32 %9, 1000000000
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%12 = load i32, i32* %11
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @to_nanos(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = mul nsw i32 %3, 1000000000
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ dst;

/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, int);
void memmove_good4() {
  int src[3];
  int dst[3];
  memmove(dst, src, sizeof(dst));
}


x86 assembly (clang, -O0):
<memmove_good4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0xc,%edx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove_good4>:
sub    $0x18,%rsp
mov    %rsp,%rdi
lea    0xc(%rsp),%rsi
mov    $0xc,%edx
call   1030 <memmove@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @memmove_good4() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i32 @memmove(i32* %3, i32* %4, i32 12)
ret void
}

LLVM IR (-O2):
define void @memmove_good4() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%7 = call i32 @memmove(i32* %5, i32* %6, i32 12)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ADI16RegRead(uint32_t ui32Base, uint32_t ui32Reg) {
  ;
  ;
  return ((*((volatile unsigned short *)(ui32Base + (ui32Reg & 0xFE)))));
}


x86 assembly (clang, -O0):
<ADI16RegRead>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    $0xfe,%ecx
add    %ecx,%eax
cltq
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADI16RegRead>:
and    $0xfe,%esi
movslq %edi,%rax
movzwl (%rsi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @ADI16RegRead(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 = and i32 %6, 254
%8 = add nsw i32 %5, %7
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i16*
%11 = load volatile i16, i16* %10
%12 = zext i16 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ADI16RegRead(i32 %0, i32 %1) {
%3 = and i32 %1, 254
%4 = add nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
%8 = zext i16 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ server_listen();
int /*<<< orphan*/ server_listener_setup();
int /*<<< orphan*/ server_talk();
void loop_server() {
  server_listener_setup();
  while (1) {
    server_talk();
    server_listen();
  }
}


x86 assembly (clang, -O0):
<loop_server>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <server_listener_setup@plt>
mov    $0x0,%al
call   1050 <server_talk@plt>
mov    $0x0,%al
call   1030 <server_listen@plt>
jmp    113b <loop_server+0xb>

x86 assembly (clang, -O2):
<loop_server>:
push   %rax
xor    %eax,%eax
call   1040 <server_listener_setup@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <server_talk@plt>
xor    %eax,%eax
call   1030 <server_listen@plt>
jmp    1140 <loop_server+0x10>

LLVM IR (-O0):
define void @loop_server() {
%1 = call i32 (...) @server_listener_setup()
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @server_talk()
%4 = call i32 (...) @server_listen()
br label %2
}

LLVM IR (-O2):
define void @loop_server() {
%1 = tail call i32 (...) @server_listener_setup()
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @server_talk()
%4 = tail call i32 (...) @server_listen()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void set_color(int c) {
  outb(0, 0x3ce);
  outb(c, 0x3cf);
}


x86 assembly (clang, -O0):
<set_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
mov    $0x3cf,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_color>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
mov    $0x3cf,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @set_color(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 0, i32 974)
%4 = load i32, i32* %2
%5 = call i32 @outb(i32 %4, i32 975)
ret void
}

LLVM IR (-O2):
define void @set_color(i32 %0) {
%2 = tail call i32 @outb(i32 0, i32 974)
%3 = tail call i32 @outb(i32 %0, i32 975)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void ct_endcolor(FILE *stream) { fputs("\033[0m", stream); }


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

x86 assembly (clang, -O2):
<ct_endcolor>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @ct_endcolor(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
ret void
}
int c40_id2fd(c40)
int c40;
{ return (c40); }


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

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

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

LLVM IR (-O2):
define i32 @c40_id2fd(i32 returned %0) {
ret i32 %0
}
void border_nw_ext_diagonal_special_sand_long_hori(unsigned char *pic,
                                                   unsigned char *mirr) {
  *pic = 0x30;
  *mirr = 0x01 | 0x02;
}


x86 assembly (clang, -O0):
<border_nw_ext_diagonal_special_sand_long_hori>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x30,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x3,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<border_nw_ext_diagonal_special_sand_long_hori>:
movb   $0x30,(%rdi)
movb   $0x3,(%rsi)
ret

LLVM IR (-O0):
define void @border_nw_ext_diagonal_special_sand_long_hori(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
store i8 48, i8* %5
%6 = load i8*, i8** %4
store i8 3, i8* %6
ret void
}

LLVM IR (-O2):
define void @border_nw_ext_diagonal_special_sand_long_hori(i8* nocapture writeonly %0, i8* nocapture writeonly %1) {
store i8 48, i8* %0
store i8 3, i8* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void OS_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<OS_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @OS_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void UI_get_input_flags(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_get_input_flags() {
ret void
}
int fun169() { return 169; }


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

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

LLVM IR (-O0):
define i32 @fun169() {
ret i32 169
}

LLVM IR (-O2):
define i32 @fun169() {
ret i32 169
}
/* Variables and functions */
int fcntl(int, int, long);
int qsfcntl(int s, int cmd, long arg) { return fcntl(s, cmd, arg); }


x86 assembly (clang, -O0):
<qsfcntl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsfcntl>:
jmp    1030 <fcntl@plt>

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

LLVM IR (-O2):
define i32 @qsfcntl(i32 %0, i32 %1, i64 %2) {
%4 = tail call i32 @fcntl(i32 %0, i32 %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *l_alloc(void *ud, void *ptr, size_t osize, size_t nsize) {
  (void)ud;
  (void)osize;
  if (nsize == 0) {
    free(ptr);
    return NULL;
  } else
    return realloc(ptr, nsize);
}


x86 assembly (clang, -O0):
<l_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1159 <l_alloc+0x39>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    116a <l_alloc+0x4a>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_alloc>:
mov    %rsi,%rdi
test   %rcx,%rcx
je     1130 <l_alloc+0x10>
mov    %rcx,%rsi
jmp    1040 <realloc@plt>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @l_alloc(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
%10 = load i8*, i8** %6
%11 = load i64, i64* %8
%12 = load i64, i64* %9
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %4
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
store i8* null, i8** %5
br label %21
17: ; preds = %4
%18 = load i8*, i8** %7
%19 = load i64, i64* %9
%20 = call i8* @realloc(i8* %18, i64 %19)
store i8* %20, i8** %5
br label %21
21: ; preds = %17, %14
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
define noalias i8* @l_alloc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %3, 0
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @free(i8* %1)
br label %10
8: ; preds = %4
%9 = tail call i8* @realloc(i8* %1, i64 %3)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ null, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myhandler(int signo __attribute__((unused))) {
  printf("handler does nothing useful.\n");
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"handler does nothing useful.\0A\00"
define void @myhandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"handler does nothing useful.\00"
define void @myhandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int outside_select(int n, fd_set *rfds, fd_set *wfds, fd_set *xfds,
                   struct timeval *tv) {
  return select(n, rfds, wfds, xfds, tv);
}


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

x86 assembly (clang, -O2):
<outside_select>:
jmp    1030 <select@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @outside_select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca %struct.timeval*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store %struct.timeval* %4, %struct.timeval** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = load i32*, i32** %9
%15 = load %struct.timeval*, %struct.timeval** %10
%16 = call i32 @select(i32 %11, i32* %12, i32* %13, i32* %14, %struct.timeval* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @outside_select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4) {
%6 = tail call i32 @select(i32 %0, i32* %1, i32* %2, i32* %3, %struct.timeval* %4)
ret i32 %6
}
/* Variables and functions */
void cbzero(void *b, size_t length) {
  char *p;
  for (p = b; length--;)
    *p++ = '\0';
}


x86 assembly (clang, -O0):
<cbzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <cbzero+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1114 <cbzero+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbzero>:
test   %rsi,%rsi
je     1124 <cbzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @cbzero(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
store i8* %6, i8** %5
br label %7
7: ; preds = %11, %2
%8 = load i64, i64* %4
%9 = add i64 %8, -1
store i64 %9, i64* %4
%10 = icmp ne i64 %8, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %5
store i8 0, i8* %12
br label %7
14: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @cbzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
extern __attribute__((__gnu___)) float _Complex __attribute__((__const__))
conjf(float _Complex _Z) {
  return __extension__ ~_Z;
}


x86 assembly (clang, -O0):
<conjf>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movaps 0xeeb(%rip),%xmm2
movss  -0xc(%rbp),%xmm0
pxor   %xmm2,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<conjf>:
movaps %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm1
xorps  0xef2(%rip),%xmm1
movlhps %xmm0,%xmm1
shufps $0xe2,%xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define <2 x float> @conjf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%8 = load float, float* %7
%9 = fneg float %8
%10 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%11 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %6, float* %10
store float %9, float* %11
%12 = bitcast { float, float }* %2 to <2 x float>*
%13 = load <2 x float>, <2 x float>* %12
ret <2 x float> %13
}

LLVM IR (-O2):
define <2 x float> @conjf(<2 x float> %0) {
%2 = extractelement <2 x float> %0, i64 1
%3 = fneg float %2
%4 = insertelement <2 x float> %0, float %3, i64 1
ret <2 x float> %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
FILE *tmpfile() { return fopen("utiltmp", "w+"); }


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

x86 assembly (clang, -O2):
<tmpfile>:
lea    0xee9(%rip),%rdi
lea    0xeea(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"utiltmp\00"
@.str.1 = [3 x i8] c"w+\00"
define i32* @tmpfile() {
%1 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"utiltmp\00"
@.str.1 = [3 x i8] c"w+\00"
define noalias i32* @tmpfile() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32* %1
}
unsigned long f2ul(float x) { return x; }


x86 assembly (clang, -O0):
<f2ul>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm2
movaps %xmm0,%xmm1
subss  %xmm2,%xmm1
cvttss2si %xmm1,%rcx
cvttss2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2ul>:
cvttss2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subss  0xeec(%rip),%xmm0
cvttss2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @f2ul(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptoui float %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @f2ul(float %0) {
%2 = fptoui float %0 to i64
ret i64 %2
}
void time_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @time_reset() {
ret void
}
void unregister_memory(void *host_p) {}


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

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

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

LLVM IR (-O2):
define void @unregister_memory(i8* nocapture %0) {
ret void
}
/* Variables and functions */
unsigned long gfx_ind(int);
int /*<<< orphan*/ gfx_outd(int, unsigned long);
void Dorado9211ClearCS(void) {
  unsigned long value;
  value = gfx_ind(0x6400 + 0x04);
  gfx_outd(0x6400 + 0x00, value & (~0x00000200));
}


x86 assembly (clang, -O0):
<Dorado9211ClearCS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
and    $0xfffffffffffffdff,%rsi
mov    $0x6400,%edi
call   1030 <gfx_outd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dorado9211ClearCS>:
push   %rax
mov    $0x6404,%edi
call   1040 <gfx_ind@plt>
and    $0xfffffffffffffdff,%rax
mov    $0x6400,%edi
mov    %rax,%rsi
pop    %rax
jmp    1030 <gfx_outd@plt>

LLVM IR (-O0):
define void @Dorado9211ClearCS() {
%1 = alloca i64
%2 = call i64 @gfx_ind(i32 25604)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = and i64 %3, -513
%5 = call i32 @gfx_outd(i32 25600, i64 %4)
ret void
}

LLVM IR (-O2):
define void @Dorado9211ClearCS() {
%1 = tail call i64 @gfx_ind(i32 25604)
%2 = and i64 %1, -513
%3 = tail call i32 @gfx_outd(i32 25600, i64 %2)
ret void
}
int test_check_null_numbers(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @test_check_null_numbers() {
ret i32 1
}

LLVM IR (-O2):
define i32 @test_check_null_numbers() {
ret i32 1
}
/* Variables and functions */
int PAPI_unregister_thread();
void PAPIF_UNREGSTER_THREAD(int *check) { *check = PAPI_unregister_thread(); }


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

x86 assembly (clang, -O2):
<PAPIF_UNREGSTER_THREAD>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_unregister_thread@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_UNREGSTER_THREAD(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_unregister_thread()
store i32 %2, i32* %0
ret void
}
int _write(int fd, const void *buf, int len) { return len; }


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @_write(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* %6
ret i32 %7
}

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

/* Variables and functions */
int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @SSL_set_session_ticket_ext(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
char translate_time(char time) { return (time & 0x0f) + (time >> 4) * 10; }


x86 assembly (clang, -O0):
<translate_time>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0xf,%eax
movsbl -0x1(%rbp),%ecx
sar    $0x4,%ecx
imul   $0xa,%ecx,%ecx
add    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<translate_time>:
mov    %edi,%ecx
and    $0xf,%cl
sar    $0x4,%dil
movzbl %dil,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
add    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @translate_time(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 15
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = ashr i32 %7, 4
%9 = mul nsw i32 %8, 10
%10 = add nsw i32 %5, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @translate_time(i8 signext %0) {
%2 = and i8 %0, 15
%3 = ashr i8 %0, 4
%4 = mul nsw i8 %3, 10
%5 = add nsw i8 %4, %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void begin_rtf_document() {
  printf("{\\rtf1\\ansi\\deff0\n");
  printf("{\\fonttbl{\\f0\\fmodern Courier;}}\n");
  printf("\\f0\\fs20\n");
}


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

x86 assembly (clang, -O2):
<begin_rtf_document>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"{\\rtf1\\ansi\\deff0\0A\00"
@.str.1 = [34 x i8] c"{\\fonttbl{\\f0\\fmodern Courier;}}\0A\00"
@.str.2 = [10 x i8] c"\\f0\\fs20\0A\00"
define void @begin_rtf_document() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"{\\rtf1\\ansi\\deff0\00"
@str.3 = [33 x i8] c"{\\fonttbl{\\f0\\fmodern Courier;}}\00"
@str.4 = [9 x i8] c"\\f0\\fs20\00"
define void @begin_rtf_document() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
ret void
}
void SV_RemoveOperatorCommands(void) {}


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

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

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

LLVM IR (-O2):
define void @SV_RemoveOperatorCommands() {
ret void
}
void test_mutually_exclusive_suggestions(void) {}


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

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

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

LLVM IR (-O2):
define void @test_mutually_exclusive_suggestions() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void test_file_path_free(char *path) {
  if (path != NULL)
    free(path);
}


x86 assembly (clang, -O0):
<test_file_path_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <test_file_path_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_file_path_free>:
test   %rdi,%rdi
je     111a <test_file_path_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @test_file_path_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @test_file_path_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t test_rpc_handler(uint8_t *buffer, unsigned int length,
                         uint8_t *out_buffer, unsigned int *out_length) {
  (void)buffer;
  (void)length;
  (void)out_buffer;
  (void)out_length;
  return 0;
}


x86 assembly (clang, -O0):
<test_rpc_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_rpc_handler(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
int open(const char *name, int flags, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @open(i8* nocapture readnone %0, i32 %1, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void php_free(void *ptr) { free((char *)ptr); }


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

x86 assembly (clang, -O2):
<php_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @php_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void __attribute__((weak)) _exit(int status) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

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

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

LLVM IR (-O2):
define weak void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
double O1_z(double, double, double, double);
double O3_x(double sign, double xi, double et, double qq) {
  return O1_z(sign, xi, et, qq);
}


x86 assembly (clang, -O0):
<O3_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <O1_z@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<O3_x>:
jmp    1030 <O1_z@plt>

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

LLVM IR (-O2):
define double @O3_x(double %0, double %1, double %2, double %3) {
%5 = tail call double @O1_z(double %0, double %1, double %2, double %3)
ret double %5
}
void RTSemEventMultiCreate(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSemEventMultiCreate() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *flash_get_PECR() { return mem_get_reg32(0x40023C00 + 0x04); }


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

x86 assembly (clang, -O2):
<flash_get_PECR>:
mov    $0x40023c04,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @flash_get_PECR() {
%1 = call i32* @mem_get_reg32(i32 1073888260)
ret i32* %1
}

LLVM IR (-O2):
define i32* @flash_get_PECR() {
%1 = tail call i32* @mem_get_reg32(i32 1073888260)
ret i32* %1
}
int sd_is_left_mergeable(struct reiserfs_key *key, unsigned long bsize) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.reiserfs_key = type opaque
define i32 @sd_is_left_mergeable(%struct.reiserfs_key* %0, i64 %1) {
%3 = alloca %struct.reiserfs_key*
%4 = alloca i64
store %struct.reiserfs_key* %0, %struct.reiserfs_key** %3
store i64 %1, i64* %4
ret i32 0
}

LLVM IR (-O2):
%struct.reiserfs_key = type opaque
define i32 @sd_is_left_mergeable(%struct.reiserfs_key* nocapture readnone %0, i64 %1) {
ret i32 0
}
void d(void) { char b[1025]; }


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

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

LLVM IR (-O0):
define void @d() {
%1 = alloca [1025 x i8]
ret void
}

LLVM IR (-O2):
define void @d() {
ret void
}
/* Variables and functions */
char *orig_getenv(char *);
char *crumbwarp_conf_var(char *name, char *def) {
  char *p = orig_getenv(name);
  if (p == NULL)
    return def;
  if (*p == '\0')
    return def;
  return p;
}


x86 assembly (clang, -O0):
<crumbwarp_conf_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <orig_getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1145 <crumbwarp_conf_var+0x35>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <crumbwarp_conf_var+0x5a>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1162 <crumbwarp_conf_var+0x52>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <crumbwarp_conf_var+0x5a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crumbwarp_conf_var>:
push   %rbx
mov    %rsi,%rbx
call   1030 <orig_getenv@plt>
test   %rax,%rax
je     1125 <crumbwarp_conf_var+0x15>
cmpb   $0x0,(%rax)
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @crumbwarp_conf_var(i8* %0, i8* readnone %1) {
%3 = tail call i8* @orig_getenv(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* %1, i8* %3
br label %9
9: ; preds = %5, %2
%10 = phi i8* [ %1, %2 ], [ %8, %5 ]
ret i8* %10
}