xunge/DecIR huggingface dataset:
int fn1(int a, int b) {
  int tem1 = a + b;
  int tem2 = a | b;
  return tem1 - tem2;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fn1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn1(i32 %0, i32 %1) {
%3 = and i32 %1, %0
ret i32 %3
}
int test_imm_E1uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xE1 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_E1uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 225
%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_E1uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 966367641600
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ netcode_init();
int /*<<< orphan*/ netcode_term();
int /*<<< orphan*/ netcode_test();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  printf("\n");
  netcode_init();
  netcode_test();
  netcode_term();
  printf("\n*** ALL TESTS PASSED ***\n\n");
  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)
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <netcode_init@plt>
mov    $0x0,%al
call   1050 <netcode_test@plt>
mov    $0x0,%al
call   1060 <netcode_term@plt>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <netcode_init@plt>
xor    %eax,%eax
call   1060 <netcode_test@plt>
xor    %eax,%eax
call   1070 <netcode_term@plt>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [28 x i8] c"\0A*** ALL TESTS PASSED ***\0A\0A\00"
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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @netcode_init()
%10 = call i32 (...) @netcode_test()
%11 = call i32 (...) @netcode_term()
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"\0A*** ALL TESTS PASSED ***\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (...) @netcode_init()
%5 = tail call i32 (...) @netcode_test()
%6 = tail call i32 (...) @netcode_term()
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endelse(char *, char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void test2(void) {
  char ord1[] = "program";
  char ord2[] = "diagram";
  char out[10];
  endelse(ord1, ord2, out);
  printf("%s\n", out);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1a(%rbp),%rdx
call   1040 <endelse@plt>
lea    -0x1a(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbx
sub    $0x20,%rsp
movabs $0x6d617267616964,%rax
lea    0xe090c(%rax),%rcx
mov    %rcx,0x8(%rsp)
mov    %rax,(%rsp)
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
lea    0x16(%rsp),%rbx
mov    %rbx,%rdx
call   1040 <endelse@plt>
lea    0xea5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test2.ord1 = [8 x i8] c"program\00"
@__const.test2.ord2 = [8 x i8] c"diagram\00"
@.str = [4 x i8] c"%s\0A\00"
define void @test2() {
%1 = alloca [8 x i8]
%2 = alloca [8 x i8]
%3 = alloca [10 x i8]
%4 = bitcast [8 x i8]* %1 to i8*
%5 = bitcast [8 x i8]* %2 to i8*
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @endelse(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @test2() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca [10 x i8]
%4 = bitcast i64* %1 to i8*
store i64 30787916450984560, i64* %1
%5 = bitcast i64* %2 to i8*
store i64 30787916450064740, i64* %2
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = call i32 @endelse(i8* %4, i8* %5, i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
scalar_t__ tcp_wait_for_socket(int, int, int /*<<< orphan*/);
int write(int, char *, int);
int smtp_send_command(int fd, char *command, int len) {
  if (tcp_wait_for_socket(fd, 5, 0) <= 0)
    return (-1);
  return (write(fd, command, len));
}


x86 assembly (clang, -O0):
<smtp_send_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <tcp_wait_for_socket@plt>
cmp    $0x0,%rax
jg     1157 <smtp_send_command+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <smtp_send_command+0x49>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_send_command>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x5,%esi
xor    %edx,%edx
call   1040 <tcp_wait_for_socket@plt>
test   %rax,%rax
jle    114e <smtp_send_command+0x2e>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>
mov    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @smtp_send_command(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = call i64 @tcp_wait_for_socket(i32 %8, i32 5, i32 0)
%10 = icmp sle i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 -1, i32* %4
br label %17
12: ; preds = %3
%13 = load i32, i32* %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = call i32 @write(i32 %13, i8* %14, i32 %15)
store i32 %16, i32* %4
br label %17
17: ; preds = %12, %11
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @smtp_send_command(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @tcp_wait_for_socket(i32 %0, i32 5, i32 0)
%5 = icmp slt i64 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -1, %3 ]
ret i32 %9
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
alphasort(const struct dirent **d1, const struct dirent **d2) {
  return (strcmp((*d1)->d_name, (*d2)->d_name));
}


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

x86 assembly (clang, -O2):
<alphasort>:
mov    (%rdi),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rax),%esi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** %0, %struct.dirent** %1) {
%3 = alloca %struct.dirent**
%4 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %3
store %struct.dirent** %1, %struct.dirent*** %4
%5 = load %struct.dirent**, %struct.dirent*** %3
%6 = load %struct.dirent*, %struct.dirent** %5
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.dirent**, %struct.dirent*** %4
%10 = load %struct.dirent*, %struct.dirent** %9
%11 = getelementptr inbounds %struct.dirent, %struct.dirent* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @strcmp(i32 %8, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @alphasort(%struct.dirent** nocapture %0, %struct.dirent** nocapture %1) {
%3 = load %struct.dirent*, %struct.dirent** %0
%4 = getelementptr inbounds %struct.dirent, %struct.dirent* %3, i64 0, i32 0
%5 = load i32, i32* %4
%6 = load %struct.dirent*, %struct.dirent** %1
%7 = getelementptr inbounds %struct.dirent, %struct.dirent* %6, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @strcmp(i32 %5, i32 %8)
ret i32 %9
}
void pcibios_add_platform_entries(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pcibios_add_platform_entries(%struct.pci_dev* nocapture %0) {
ret void
}
void pthread_rwlock_destroy() {}


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

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

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

LLVM IR (-O2):
define void @pthread_rwlock_destroy() {
ret void
}
/* Variables and functions */
int O_CLOEXEC;
int O_RDWR;
int dmabuf_heap_alloc_fdflags(int, size_t, int, unsigned int, int *);
int dmabuf_heap_alloc(int fd, size_t len, unsigned int flags, int *dmabuf_fd) {
  return dmabuf_heap_alloc_fdflags(fd, len, O_RDWR | O_CLOEXEC, flags,
                                   dmabuf_fd);
}


x86 assembly (clang, -O0):
<dmabuf_heap_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    0x2eb4(%rip),%rax
mov    (%rax),%edx
mov    0x2e93(%rip),%rax
or     (%rax),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
call   1030 <dmabuf_heap_alloc_fdflags@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmabuf_heap_alloc>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    0x2ecc(%rip),%rax
mov    0x2ead(%rip),%rdx
mov    (%rdx),%edx
or     (%rax),%edx
jmp    1030 <dmabuf_heap_alloc_fdflags@plt>

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_CLOEXEC = global i32 0
define i32 @dmabuf_heap_alloc(i32 %0, i64 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i64, i64* %6
%11 = load i32, i32* @O_RDWR
%12 = load i32, i32* @O_CLOEXEC
%13 = or i32 %11, %12
%14 = load i32, i32* %7
%15 = load i32*, i32** %8
%16 = call i32 @dmabuf_heap_alloc_fdflags(i32 %9, i64 %10, i32 %13, i32 %14, i32* %15)
ret i32 %16
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_CLOEXEC = global i32 0
define i32 @dmabuf_heap_alloc(i32 %0, i64 %1, i32 %2, i32* %3) {
%5 = load i32, i32* @O_RDWR
%6 = load i32, i32* @O_CLOEXEC
%7 = or i32 %6, %5
%8 = tail call i32 @dmabuf_heap_alloc_fdflags(i32 %0, i64 %1, i32 %7, i32 %2, i32* %3)
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int qrcodegen_getSize(const uint8_t qrcode[]) {
  assert(qrcode != NULL);
  int result = qrcode[0];
  assert((1 * 4 + 17) <= result && result <= (40 * 4 + 17));
  return result;
}


x86 assembly (clang, -O0):
<qrcodegen_getSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
mov    $0x15,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
jg     1157 <qrcodegen_getSize+0x47>
cmpl   $0xb1,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qrcodegen_getSize>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%ebx
lea    -0x15(%rbx),%eax
xor    %edi,%edi
cmp    $0x9d,%eax
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @qrcodegen_getSize(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
store i32 %10, i32* %3
%11 = load i32, i32* %3
%12 = icmp sle i32 21, %11
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 177
br label %16
16: ; preds = %13, %1
%17 = phi i1 [ false, %1 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @qrcodegen_getSize(i32* %0) {
%2 = icmp ne i32* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i32, i32* %0
%6 = add i32 %5, -21
%7 = icmp ult i32 %6, 157
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i32 %5
}
/* Variables and functions */
int CHAR_BIT;
int min(int x, int y) {
  return y + ((x - y) & ((x - y) >> (sizeof(int) * CHAR_BIT - 1)));
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,-0xc(%rbp)
mov    -0x4(%rbp),%edx
sub    -0x8(%rbp),%edx
mov    0x2ebd(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
sub    $0x1,%rcx
sar    %cl,%edx
mov    -0xc(%rbp),%ecx
and    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
sub    %esi,%edi
mov    0x2ed7(%rip),%rax
mov    (%rax),%cl
shl    $0x2,%cl
add    $0xff,%cl
mov    %edi,%eax
sar    %cl,%eax
and    %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @min(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* @CHAR_BIT
%13 = sext i32 %12 to i64
%14 = mul i64 4, %13
%15 = sub i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = ashr i32 %11, %16
%18 = and i32 %8, %17
%19 = add nsw i32 %5, %18
ret i32 %19
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @min(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = load i32, i32* @CHAR_BIT
%5 = shl i32 %4, 2
%6 = add i32 %5, -1
%7 = ashr i32 %3, %6
%8 = and i32 %7, %3
%9 = add nsw i32 %8, %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ line_reversal(void *, int, int, int);
void rgbx8888_line_reversal(void *p8888, int w, int h) {
  line_reversal(p8888, w, h, 32);
}


x86 assembly (clang, -O0):
<rgbx8888_line_reversal>:
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    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x20,%ecx
call   1030 <line_reversal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgbx8888_line_reversal>:
mov    $0x20,%ecx
jmp    1030 <line_reversal@plt>

LLVM IR (-O0):
define void @rgbx8888_line_reversal(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* %5
%9 = load i32, i32* %6
%10 = call i32 @line_reversal(i8* %7, i32 %8, i32 %9, i32 32)
ret void
}

LLVM IR (-O2):
define void @rgbx8888_line_reversal(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @line_reversal(i8* %0, i32 %1, i32 %2, i32 32)
ret void
}
float maths_soft_zone(float x, float soft_zone_width) {
  if (soft_zone_width < 0.0000001f) {
    return x;
  } else {
    return x * x * x / (((soft_zone_width) * (soft_zone_width)) + ((x) * (x)));
  }
}


x86 assembly (clang, -O0):
<maths_soft_zone>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  0xeea(%rip),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    112f <maths_soft_zone+0x2f>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <maths_soft_zone+0x63>
movss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm3
movss  -0x8(%rbp),%xmm2
mulss  -0x8(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maths_soft_zone>:
movss  0xef8(%rip),%xmm2
ucomiss %xmm1,%xmm2
ja     1124 <maths_soft_zone+0x24>
movaps %xmm0,%xmm2
mulss  %xmm0,%xmm2
mulss  %xmm2,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @maths_soft_zone(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp olt float %6, 0x3E7AD7F2A0000000
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %4
store float %9, float* %3
br label %23
10: ; preds = %2
%11 = load float, float* %4
%12 = load float, float* %4
%13 = fmul float %11, %12
%14 = load float, float* %4
%15 = fmul float %13, %14
%16 = load float, float* %5
%17 = load float, float* %5
%18 = load float, float* %4
%19 = load float, float* %4
%20 = fmul float %18, %19
%21 = call float @llvm.fmuladd.f32(float %16, float %17, float %20)
%22 = fdiv float %15, %21
store float %22, float* %3
br label %23
23: ; preds = %10, %8
%24 = load float, float* %3
ret float %24
}

LLVM IR (-O2):
define float @maths_soft_zone(float %0, float %1) {
%3 = fcmp olt float %1, 0x3E7AD7F2A0000000
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fmul float %0, %0
%6 = fmul float %5, %0
%7 = tail call float @llvm.fmuladd.f32(float %1, float %1, float %5)
%8 = fdiv float %6, %7
br label %9
9: ; preds = %2, %4
%10 = phi float [ %8, %4 ], [ %0, %2 ]
ret float %10
}
/* Variables and functions */
int _InterlockedExchangeAdd(int volatile *, int);
int test_InterlockedExchangeAdd(int volatile *value, int mask) {
  return _InterlockedExchangeAdd(value, mask);
}


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

x86 assembly (clang, -O2):
<test_InterlockedExchangeAdd>:
jmp    1030 <_InterlockedExchangeAdd@plt>

LLVM IR (-O0):
define i32 @test_InterlockedExchangeAdd(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 = call i32 @_InterlockedExchangeAdd(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_InterlockedExchangeAdd(i32* %0, i32 %1) {
%3 = tail call i32 @_InterlockedExchangeAdd(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ via_raise_interrupt(int, int /*<<< orphan*/);
void scsi_raise_drq() { via_raise_interrupt(2, 0); }


x86 assembly (clang, -O0):
<scsi_raise_drq>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <via_raise_interrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scsi_raise_drq>:
mov    $0x2,%edi
xor    %esi,%esi
jmp    1030 <via_raise_interrupt@plt>

LLVM IR (-O0):
define void @scsi_raise_drq() {
%1 = call i32 @via_raise_interrupt(i32 2, i32 0)
ret void
}

LLVM IR (-O2):
define void @scsi_raise_drq() {
%1 = tail call i32 @via_raise_interrupt(i32 2, i32 0)
ret void
}
int maze_same_tids(struct maze *mp, int r1, int c1, int r2, int c2) {
  return 1;
}


x86 assembly (clang, -O0):
<maze_same_tids>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.maze = type opaque
define i32 @maze_same_tids(%struct.maze* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.maze*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.maze* %0, %struct.maze** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 1
}

LLVM IR (-O2):
%struct.maze = type opaque
define i32 @maze_same_tids(%struct.maze* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_usage(int argc, char **argv) {
  printf("Usage: %s <input_dir> <output_file>\n", argv[0]);
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    (%rsi),%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Usage: %s <input_dir> <output_file>\0A\00"
define void @print_usage(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 0
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Usage: %s <input_dir> <output_file>\0A\00"
define void @print_usage(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, struct iovec const *,
                           unsigned long, struct iovec const *, unsigned long,
                           unsigned long);
ssize_t process_vm_writev(pid_t pid, const struct iovec *lvec,
                          unsigned long liovcnt, const struct iovec *rvec,
                          unsigned long riovcnt, unsigned long flags) {
  return syscall(377, pid, lvec, liovcnt, rvec, riovcnt, flags);
}


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

x86 assembly (clang, -O2):
<process_vm_writev>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    %r9,(%rsp)
mov    $0x179,%edi
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
define i32 @process_vm_writev(i32 %0, %struct.iovec* %1, i64 %2, %struct.iovec* %3, i64 %4, i64 %5) {
%7 = alloca i32
%8 = alloca %struct.iovec*
%9 = alloca i64
%10 = alloca %struct.iovec*
%11 = alloca i64
%12 = alloca i64
store i32 %0, i32* %7
store %struct.iovec* %1, %struct.iovec** %8
store i64 %2, i64* %9
store %struct.iovec* %3, %struct.iovec** %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i32, i32* %7
%14 = load %struct.iovec*, %struct.iovec** %8
%15 = load i64, i64* %9
%16 = load %struct.iovec*, %struct.iovec** %10
%17 = load i64, i64* %11
%18 = load i64, i64* %12
%19 = call i32 @syscall(i32 377, i32 %13, %struct.iovec* %14, i64 %15, %struct.iovec* %16, i64 %17, i64 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @process_vm_writev(i32 %0, %struct.iovec* %1, i64 %2, %struct.iovec* %3, i64 %4, i64 %5) {
%7 = tail call i32 @syscall(i32 377, i32 %0, %struct.iovec* %1, i64 %2, %struct.iovec* %3, i64 %4, i64 %5)
ret i32 %7
}
/* Type definitions */
struct yahoo_input_data {
  int dummy;
};

/* Variables and functions */
struct yahoo_input_data *find_input_by_id_and_webcam_user(int, char const *);
int /*<<< orphan*/ yahoo_input_close(struct yahoo_input_data *);
void yahoo_webcam_close_feed(int id, const char *who) {
  struct yahoo_input_data *yid = find_input_by_id_and_webcam_user(id, who);
  if (yid)
    yahoo_input_close(yid);
}


x86 assembly (clang, -O0):
<yahoo_webcam_close_feed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <find_input_by_id_and_webcam_user@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1153 <yahoo_webcam_close_feed+0x33>
mov    -0x18(%rbp),%rdi
call   1040 <yahoo_input_close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_webcam_close_feed>:
push   %rax
call   1030 <find_input_by_id_and_webcam_user@plt>
test   %rax,%rax
je     1134 <yahoo_webcam_close_feed+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1040 <yahoo_input_close@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.yahoo_input_data = type { i32 }
define void @yahoo_webcam_close_feed(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.yahoo_input_data*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call %struct.yahoo_input_data* @find_input_by_id_and_webcam_user(i32 %6, i8* %7)
store %struct.yahoo_input_data* %8, %struct.yahoo_input_data** %5
%9 = load %struct.yahoo_input_data*, %struct.yahoo_input_data** %5
%10 = icmp ne %struct.yahoo_input_data* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load %struct.yahoo_input_data*, %struct.yahoo_input_data** %5
%13 = call i32 @yahoo_input_close(%struct.yahoo_input_data* %12)
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.yahoo_input_data = type { i32 }
define void @yahoo_webcam_close_feed(i32 %0, i8* %1) {
%3 = tail call %struct.yahoo_input_data* @find_input_by_id_and_webcam_user(i32 %0, i8* %1)
%4 = icmp eq %struct.yahoo_input_data* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @yahoo_input_close(%struct.yahoo_input_data* %3)
br label %7
7: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void chip_gpio_direction_out(uint8_t which, uint8_t value) {}


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

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

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

LLVM IR (-O2):
define void @chip_gpio_direction_out(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int random() {
  int x = __VERIFIER_nondet_int();
  if (x < 0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1139 <random+0x29>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113f <random+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ecx
neg    %ecx
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = sub nsw i32 0, %7
store i32 %8, i32* %1
br label %11
9: ; preds = %0
%10 = load i32, i32* %2
store i32 %10, i32* %1
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @random() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ baz();
void foo(void) { baz(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @baz()
ret void
}
void *mem_calloc(u)
unsigned u;
{
  return mem_calloc_debug(
      u,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/"
      "master/CodeFix5/Code/MEM/mem.c",
      277);
}


x86 assembly (clang, -O0):
<mem_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
mov    $0x115,%edx
mov    $0x0,%al
call   1030 <mem_calloc_debug@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_calloc>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x115,%edx
xor    %eax,%eax
call   1030 <mem_calloc_debug@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define i8* @mem_calloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mem_calloc_debug to i32 (i32, i8*, i32, ...)*)(i32 %3, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 277)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
@.str = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/JoshuaSBrown/OPV_MonteCarloCode/refs/heads/master/CodeFix5/Code/MEM/mem.c\00"
define i8* @mem_calloc(i32 %0) {
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @mem_calloc_debug to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str, i64 0, i64 0), i32 277)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int test_imm_ACint32_reg(int val) { return ((val) & (0xAC << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_ACint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xac,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ACint32_reg>:
test   $0xac,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ACint32_reg(i32 %0) {
%2 = and i32 %0, 172
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void *atomic_ptr_cas_gcc(void *volatile *ptr, void *oldval, void *newval) {
  return __sync_val_compare_and_swap(ptr, oldval, newval);
}


x86 assembly (clang, -O0):
<atomic_ptr_cas_gcc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_ptr_cas_gcc>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @atomic_ptr_cas_gcc(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = bitcast i8** %7 to i64*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = cmpxchg i64* %8, i64 %10, i64 %12 seq_cst seq_cst
%14 = extractvalue { i64, i1 } %13, 0
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @atomic_ptr_cas_gcc(i8** nocapture %0, i8* %1, i8* %2) {
%4 = bitcast i8** %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = cmpxchg i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 0
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ serial_byte_tx(int /*<<< orphan*/);
void serial_tx(char *str) {
  while (*str) {
    serial_byte_tx(*str++);
  }
}


x86 assembly (clang, -O0):
<serial_tx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <serial_tx+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <serial_byte_tx@plt>
jmp    111c <serial_tx+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_tx>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <serial_tx+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <serial_byte_tx@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <serial_tx+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @serial_tx(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @serial_byte_tx(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *strdup_n(const char *str, int size) {
  char *m = (char *)malloc(size + 1);
  memcpy(m, str, size);
  m[size] = 0;
  return m;
}


x86 assembly (clang, -O0):
<strdup_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup_n>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    0x1(%r15),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1030 <memcpy@plt>
movslq %r15d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup_n(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %5
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %5
ret i8* %18
}

LLVM IR (-O2):
define i8* @strdup_n(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char str_a[20];
  char *pointer;
  char *pointer2;
  strcpy(str_a, "Hello world!\n");
  pointer = str_a;
  printf(pointer);
  pointer2 = pointer + 2;
  printf(pointer2);
  strcpy(pointer2, "y you guys!\n");
  printf(pointer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x20(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xea5(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
lea    0x2(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0xeb9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [13 x i8] c"y you guys!\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %2)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 2
%6 = call i32 @printf(i8* %5)
%7 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* %2)
ret i32 0
}
void genbltz_out() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ _mm_mask_fpclass_sd_mask(int /*<<< orphan*/,
                                            int /*<<< orphan*/, int);
__mmask8 test_mm_mask_fpclass_sd_mask(__mmask8 __U, __m128 __A) {
  return _mm_mask_fpclass_sd_mask(__U, __A, 2);
}


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

x86 assembly (clang, -O2):
<test_mm_mask_fpclass_sd_mask>:
mov    $0x2,%edx
jmp    1030 <_mm_mask_fpclass_sd_mask@plt>

LLVM IR (-O0):
define i32 @test_mm_mask_fpclass_sd_mask(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 = call i32 @_mm_mask_fpclass_sd_mask(i32 %5, i32 %6, i32 2)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_mask_fpclass_sd_mask(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_mask_fpclass_sd_mask(i32 %0, i32 %1, i32 2)
ret i32 %3
}
const char *LZ4_versionString(void) { return "1.9.2"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"1.9.2\00"
define i8* @LZ4_versionString() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, unsigned char const *, int);
int get_headers(const unsigned char *buf, char *source_id, char *dest_id) {
  memcpy(source_id, buf, 20);
  memcpy(dest_id, buf + 20, 20);
  return 0;
}


x86 assembly (clang, -O0):
<get_headers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x14,%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_headers>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rbx,%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
add    $0x14,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x14,%edx
call   1030 <memcpy@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @get_headers(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @memcpy(i8* %7, i8* %8, i32 20)
%10 = load i8*, i8** %6
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 20
%13 = call i32 @memcpy(i8* %10, i8* %12, i32 20)
ret i32 0
}

LLVM IR (-O2):
define i32 @get_headers(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @memcpy(i8* %1, i8* %0, i32 20)
%5 = getelementptr inbounds i8, i8* %0, i64 20
%6 = tail call i32 @memcpy(i8* %2, i8* %5, i32 20)
ret i32 0
}
int mock_int_return(void *user_data) { return *((int *)user_data); }


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

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

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

LLVM IR (-O2):
define i32 @mock_int_return(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello, world!\n");
  printf("Who doesn't love C?\n");
  printf("ME. RUBY 4 LIFE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Hello, world!\0A\00"
@.str.1 = [21 x i8] c"Who doesn't love C?\0A\00"
@.str.2 = [16 x i8] c"ME. RUBY 4 LIFE\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"ME. RUBY 4 LIFE\00"
@str = [14 x i8] c"Hello, world!\00"
@str.3 = [20 x i8] c"Who doesn't love C?\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ procline(char *);
int main(int argc, char *argv[]) { procline(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 <procline@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <procline@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 @procline(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 @procline(i8* %4)
ret i32 0
}