xunge/DecIR huggingface dataset:
void gtk_radio_action_get_group() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_action_get_group() {
ret void
}
int blk_rq_map_user(struct request_queue *q, struct request *rq, void *ubuf,
                    unsigned int len) {
  int a;
  return a;
}


x86 assembly (clang, -O0):
<blk_rq_map_user>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.request_queue = type opaque
%struct.request = type opaque
define i32 @blk_rq_map_user(%struct.request_queue* %0, %struct.request* %1, i8* %2, i32 %3) {
%5 = alloca %struct.request_queue*
%6 = alloca %struct.request*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store %struct.request_queue* %0, %struct.request_queue** %5
store %struct.request* %1, %struct.request** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %9
ret i32 %10
}

LLVM IR (-O2):
%struct.request_queue = type opaque
%struct.request = type opaque
define i32 @blk_rq_map_user(%struct.request_queue* nocapture readnone %0, %struct.request* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
uint32_t USBLPMIntStatus(uint32_t ui32Base) {
  ASSERT(ui32Base == 0x40050000);
  return ((*((volatile uint8_t *)(ui32Base + 0x00000364))));
}


x86 assembly (clang, -O0):
<USBLPMIntStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0x364,%eax
cltq
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBLPMIntStatus>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x40050000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
mov    0x364(%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @USBLPMIntStatus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1074069504
%5 = zext i1 %4 to i32
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 868
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @USBLPMIntStatus(i32 %0) {
%2 = icmp eq i32 %0, 1074069504
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = add nsw i32 %0, 868
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int);
void disconn(int s) {
  shutdown(s, 2);
  close(s);
}


x86 assembly (clang, -O0):
<disconn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disconn>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%esi
call   1030 <shutdown@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @disconn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @shutdown(i32 %3, i32 2)
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
ret void
}

LLVM IR (-O2):
define void @disconn(i32 %0) {
%2 = tail call i32 @shutdown(i32 %0, i32 2)
%3 = tail call i32 @close(i32 %0)
ret void
}
void UARTEnableRXInterrupt(void) {
  *((char *)0xFFFFFFE1) = *((char *)0xFFFFFFE1) | 1;
}


x86 assembly (clang, -O0):
<UARTEnableRXInterrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffe1,%eax
movsbl (%rax),%eax
or     $0x1,%eax
mov    %al,%cl
mov    $0xffffffe1,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTEnableRXInterrupt>:
mov    $0xffffffe1,%eax
orb    $0x1,(%rax)
ret

LLVM IR (-O0):
define void @UARTEnableRXInterrupt() {
%1 = load i8, i8* inttoptr (i64 4294967265 to i8*)
%2 = sext i8 %1 to i32
%3 = or i32 %2, 1
%4 = trunc i32 %3 to i8
store i8 %4, i8* inttoptr (i64 4294967265 to i8*)
ret void
}

LLVM IR (-O2):
define void @UARTEnableRXInterrupt() {
%1 = load i8, i8* inttoptr (i64 4294967265 to i8*)
%2 = or i8 %1, 1
store i8 %2, i8* inttoptr (i64 4294967265 to i8*)
ret void
}
/* Variables and functions */
int ioCanWriteImage();
int secCanWriteImage(void) { return ioCanWriteImage(); }


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

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

LLVM IR (-O0):
define i32 @secCanWriteImage() {
%1 = call i32 (...) @ioCanWriteImage()
ret i32 %1
}

LLVM IR (-O2):
define i32 @secCanWriteImage() {
%1 = tail call i32 (...) @ioCanWriteImage()
ret i32 %1
}
/* Type definitions */
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int time_out(int fd) {
  fd_set rfds;
  struct timeval tv;
  FD_ZERO(&rfds);
  FD_SET(fd, &rfds);
  tv.tv_sec = 3;
  tv.tv_usec = 0;
  return select(fd + 1, &rfds, NULL, NULL, &tv);
}


x86 assembly (clang, -O0):
<time_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <FD_ZERO@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1050 <FD_SET@plt>
movl   $0x3,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   1040 <select@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_out>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1030 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <FD_SET@plt>
movl   $0x3,0x8(%rsp)
movq   $0x0,0x10(%rsp)
add    $0x1,%ebx
lea    0x8(%rsp),%r8
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <select@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i32 @time_out(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timeval
store i32 %0, i32* %2
%5 = call i32 @FD_ZERO(i32* %3)
%6 = load i32, i32* %2
%7 = call i32 @FD_SET(i32 %6, i32* %3)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 0
store i32 3, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i32 0, i32 1
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
%12 = call i32 @select(i32 %11, i32* %3, i32* null, i32* null, %struct.timeval* %4)
ret i32 %12
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @time_out(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
%4 = bitcast i32* %2 to i8*
%5 = bitcast %struct.timeval* %3 to i8*
%6 = call i32 @FD_ZERO(i32* %2)
%7 = call i32 @FD_SET(i32 %0, i32* %2)
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 3, i32* %8
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i64 0, i64* %9
%10 = add nsw i32 %0, 1
%11 = call i32 @select(i32 %10, i32* %2, i32* null, i32* null, %struct.timeval* %3)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void disp_usage(void) {
  printf("Usage: lemem [-l] [-s] -m <memory limit in MiB> -- "
         "<program> [args ...]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<disp_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<disp_usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"Usage: lemem [-l] [-s] -m <memory limit in MiB> -- <program> [args ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @disp_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [72 x i8] c"Usage: lemem [-l] [-s] -m <memory limit in MiB> -- <program> [args ...]\00"
define void @disp_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int test(unsigned char *, int);
int is_a(unsigned char *seq, int n) {
  int ndx = n * 2;
  if (test(seq, ndx) == 1 || test(seq, ndx + 1) == 1)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <test@plt>
cmp    $0x1,%eax
je     1155 <is_a+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
add    $0x1,%esi
call   1030 <test@plt>
cmp    $0x1,%eax
jne    1161 <is_a+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_a+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_a>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
add    %esi,%ebx
mov    %ebx,%esi
call   1030 <test@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
je     1142 <is_a+0x32>
or     $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <test@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_a(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = tail call i32 @test(i8* %0, i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = or i32 %3, 1
%8 = tail call i32 @test(i8* %0, i32 %7)
%9 = icmp ne i32 %8, 1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
int efx_mcdi_mon_probe(struct efx_nic *efx) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.efx_nic = type opaque
define i32 @efx_mcdi_mon_probe(%struct.efx_nic* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
char **tokenize(char *word, const char ch) {
  char **result = NULL;
  return result;
}


x86 assembly (clang, -O0):
<tokenize>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8** @tokenize(i8* nocapture readnone %0, i8 signext %1) {
ret i8** null
}
/* Variables and functions */
int japi_getviewportheight(int);
int j_getviewportheight(int arg0) { return (japi_getviewportheight(arg0)); }


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

x86 assembly (clang, -O2):
<j_getviewportheight>:
jmp    1030 <japi_getviewportheight@plt>

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

LLVM IR (-O2):
define i32 @j_getviewportheight(i32 %0) {
%2 = tail call i32 @japi_getviewportheight(i32 %0)
ret i32 %2
}
int test_imm_13int64_lowword_mem(long long *val) {
  return ((*val) & (0x13 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_13int64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 19
%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_13int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 19
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
void strcat(char *destination, char *source) {
  int len = strlen(destination);
  memcpy(destination + len, source, strlen(source) + 1);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <strlen@plt>
movslq %eax,%rbx
add    %r15,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memcpy@plt>

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

LLVM IR (-O2):
define void @strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @strlen(i8* %1)
%7 = add nsw i32 %6, 1
%8 = tail call i32 @memcpy(i8* %5, i8* %1, i32 %7)
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

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

/* Variables and functions */
void set_XEvent_xselectionclear_window(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselectionclear.window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XEvent_xselectionclear_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void Exit(char **s) {
  printf("bye bye\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<Exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"bye bye\0A\00"
@EXIT_SUCCESS = global i32 0
define void @Exit(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [8 x i8] c"bye bye\00"
define void @Exit(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
double dotproduct(double, double, double, double);
double vector_projection_with_precalculated_axis_modulus(double axis_x,
                                                         double axis_y,
                                                         double px, double py,
                                                         double axis_mod) {
  return dotproduct(px, py, axis_x, axis_y) / axis_mod;
}


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

x86 assembly (clang, -O2):
<vector_projection_with_precalculated_axis_modulus>:
push   %rax
movsd  %xmm4,(%rsp)
movaps %xmm1,%xmm4
movaps %xmm0,%xmm5
movapd %xmm2,%xmm0
movaps %xmm3,%xmm1
movaps %xmm5,%xmm2
movaps %xmm4,%xmm3
call   1030 <dotproduct@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @vector_projection_with_precalculated_axis_modulus(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %8
%12 = load double, double* %9
%13 = load double, double* %6
%14 = load double, double* %7
%15 = call double @dotproduct(double %11, double %12, double %13, double %14)
%16 = load double, double* %10
%17 = fdiv double %15, %16
ret double %17
}

LLVM IR (-O2):
define double @vector_projection_with_precalculated_axis_modulus(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @dotproduct(double %2, double %3, double %0, double %1)
%7 = fdiv double %6, %4
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, unsigned char *, int);
int I4(unsigned char *p) {
  int u;
  memcpy(&u, p, 4);
  return u;
}


x86 assembly (clang, -O0):
<I4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I4>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @I4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @I4(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
void do_something(int n) {}


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

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

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

LLVM IR (-O2):
define void @do_something(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void regfreematch(char **matches, int maxmatch) {
  int i;
  for (i = 0; i < maxmatch; i++) {
    if (matches[i] != NULL)
      free(matches[i]);
  }
}


x86 assembly (clang, -O0):
<regfreematch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1169 <regfreematch+0x59>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1156 <regfreematch+0x46>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    115b <regfreematch+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <regfreematch+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regfreematch>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1149 <regfreematch+0x39>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
jmp    1139 <regfreematch+0x29>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     1149 <regfreematch+0x39>
mov    (%r14,%rbx,8),%rdi
test   %rdi,%rdi
je     1130 <regfreematch+0x20>
call   1030 <free@plt>
jmp    1130 <regfreematch+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @regfreematch(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i8**, i8*** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %24
17: ; preds = %10
%18 = load i8**, i8*** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @free(i8* %22)
br label %24
24: ; preds = %17, %10
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @regfreematch(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ 0, %4 ], [ %14, %13 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %6
%12 = tail call i32 @free(i8* %9)
br label %13
13: ; preds = %6, %11
%14 = add nuw nsw i64 %7, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %16, label %6
16: ; preds = %13, %2
ret void
}
void fileIO() {}


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

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

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

LLVM IR (-O2):
define void @fileIO() {
ret void
}
double test_pow(double x, double y) { return __builtin_pow(x, y); }


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

x86 assembly (clang, -O2):
<test_pow>:
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @test_pow(double %0, double %1) {
%3 = tail call double @pow(double %0, double %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ boardCoordsConvertedToString(int, int, char *);
void invalidCoordinatesConvertedToNanString(void) {
  boardCoordsConvertedToString(-1, 9, "nan");
  boardCoordsConvertedToString(5, -1, "nan");
}


x86 assembly (clang, -O0):
<invalidCoordinatesConvertedToNanString>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x9,%esi
lea    0xedb(%rip),%rdx
call   1030 <boardCoordsConvertedToString@plt>
mov    $0x5,%edi
mov    $0xffffffff,%esi
lea    0xec5(%rip),%rdx
call   1030 <boardCoordsConvertedToString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidCoordinatesConvertedToNanString>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    $0xffffffff,%edi
mov    $0x9,%esi
mov    %rbx,%rdx
call   1030 <boardCoordsConvertedToString@plt>
mov    $0x5,%edi
mov    $0xffffffff,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <boardCoordsConvertedToString@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"nan\00"
define void @invalidCoordinatesConvertedToNanString() {
%1 = call i32 @boardCoordsConvertedToString(i32 -1, i32 9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @boardCoordsConvertedToString(i32 5, i32 -1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"nan\00"
define void @invalidCoordinatesConvertedToNanString() {
%1 = tail call i32 @boardCoordsConvertedToString(i32 -1, i32 9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @boardCoordsConvertedToString(i32 5, i32 -1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _CANBaseValid(int);
bool CANRetryGet(uint32_t ui32Base) {
  ASSERT(_CANBaseValid(ui32Base));
  if ((*((volatile uint32_t *)(ui32Base + 0x00000000))) & 0x00000020) {
    return (false);
  }
  return (true);
}


x86 assembly (clang, -O0):
<CANRetryGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_CANBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     115c <CANRetryGet+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1163 <CANRetryGet+0x43>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANRetryGet>:
push   %rbx
mov    %edi,%ebx
call   1030 <_CANBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
movslq %ebx,%rcx
xor    %eax,%eax
testl  $0x20,(%rcx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CANRetryGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @_CANBaseValid(i32 %4)
%6 = call i32 @ASSERT(i32 %5)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
%11 = load volatile i32, i32* %10
%12 = and i32 %11, 32
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 0, i32* %2
br label %16
15: ; preds = %1
store i32 1, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @CANRetryGet(i32 %0) {
%2 = tail call i32 @_CANBaseValid(i32 %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = sext i32 %0 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = lshr i32 %6, 5
%8 = and i32 %7, 1
%9 = xor i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ test_vfs_symlink_basic();
int /*<<< orphan*/ test_vfs_symlink_vnr();
int test_vfs_symlink(void) {
  test_vfs_symlink_basic();
  test_vfs_symlink_vnr();
  return 0;
}


x86 assembly (clang, -O0):
<test_vfs_symlink>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_vfs_symlink_basic@plt>
mov    $0x0,%al
call   1040 <test_vfs_symlink_vnr@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_vfs_symlink>:
push   %rax
xor    %eax,%eax
call   1030 <test_vfs_symlink_basic@plt>
xor    %eax,%eax
call   1040 <test_vfs_symlink_vnr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_vfs_symlink() {
%1 = call i32 (...) @test_vfs_symlink_basic()
%2 = call i32 (...) @test_vfs_symlink_vnr()
ret i32 0
}

LLVM IR (-O2):
define i32 @test_vfs_symlink() {
%1 = tail call i32 (...) @test_vfs_symlink_basic()
%2 = tail call i32 (...) @test_vfs_symlink_vnr()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void help(const char *s) {
  printf("usage: %s\n"
         "  -h, --help            show this help\n"
         "  -c, --config <file>   config file\n"
         "  -d, --daemon          daemonize after initialization\n"
         "  -p, --pidfile <file>  PID file\n"
         "  --logfile <file>      log file\n",
         s);
}


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

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

LLVM IR (-O0):
@.str = [207 x i8] c"usage: %s\0A -h, --help show this help\0A -c, --config <file> config file\0A -d, --daemon daemonize after initialization\0A -p, --pidfile <file> PID file\0A --logfile <file> log file\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [207 x i8] c"usage: %s\0A -h, --help show this help\0A -c, --config <file> config file\0A -d, --daemon daemonize after initialization\0A -p, --pidfile <file> PID file\0A --logfile <file> log file\0A\00"
define void @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([207 x i8], [207 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ readl(void *);
uint32_t read_pxpat1s(unsigned port) {
  return readl((void *)0xb0010000 + (port * 0x100) + (0x34));
}


x86 assembly (clang, -O0):
<read_pxpat1s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%edi
add    %rax,%rdi
add    $0x34,%rdi
call   1030 <readl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pxpat1s>:
shl    $0x8,%edi
mov    $0xb0010034,%eax
add    %rax,%rdi
jmp    1030 <readl@plt>

LLVM IR (-O0):
define i32 @read_pxpat1s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 256
%5 = zext i32 %4 to i64
%6 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %5
%7 = getelementptr i8, i8* %6, i64 52
%8 = call i32 @readl(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @read_pxpat1s(i32 %0) {
%2 = shl i32 %0, 8
%3 = zext i32 %2 to i64
%4 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %3
%5 = getelementptr i8, i8* %4, i64 52
%6 = tail call i32 @readl(i8* %5)
ret i32 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
char *writeBytes(char *buf, char *in, uint32_t len) {
  memcpy(buf, in, len);
  return buf + len;
}


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

x86 assembly (clang, -O2):
<writeBytes>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
call   1030 <memcpy@plt>
movslq %ebx,%rax
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @writeBytes(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void _print(const char *data, size_t data_length) {
  for (size_t i = 0; i < data_length; ++i)
    putchar((int)data[i]);
}


x86 assembly (clang, -O0):
<_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1158 <_print+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <_print+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1143 <_print+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <_print+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @_print(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %17, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* %11, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call i32 @putchar(i32 %15)
br label %17
17: ; preds = %10
%18 = load i64, i64* %5
%19 = add i64 %18, 1
store i64 %19, i64* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @_print(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw i64 %6, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
pid_t gettid_sys() { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @gettid_sys() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @gettid_sys() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
scalar_t__ tag_readblock(int, char *);
void print_config_registers(void) {
  char buf[16];
  int i;
  if (tag_readblock(0x7A, buf)) {
    ;
    for (i = 0; i < 7; i++) {
      ;
    }
  }
}


x86 assembly (clang, -O0):
<print_config_registers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rsi
mov    $0x7a,%edi
call   1030 <tag_readblock@plt>
cmp    $0x0,%rax
je     1159 <print_config_registers+0x49>
movl   $0x0,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jge    1154 <print_config_registers+0x44>
jmp    1146 <print_config_registers+0x36>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <print_config_registers+0x27>
jmp    1159 <print_config_registers+0x49>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_config_registers>:
sub    $0x18,%rsp
mov    %rsp,%rsi
mov    $0x7a,%edi
call   1030 <tag_readblock@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @print_config_registers() {
%1 = alloca [16 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = call i64 @tag_readblock(i32 122, i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %0
store i32 0, i32* %2
br label %7
7: ; preds = %11, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %14
10: ; preds = %7
br label %11
11: ; preds = %10
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %7
14: ; preds = %7
br label %15
15: ; preds = %14, %0
ret void
}

LLVM IR (-O2):
define void @print_config_registers() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i64 @tag_readblock(i32 122, i8* %2)
ret void
}
int test_imm_96int8_mem(signed char *val) {
  return ((*val) & (-0x96 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_96int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff6a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_96int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -150
%7 = icmp ne i32 %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_96int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -150
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
int shamt(int instruction) { return (instruction >> 6) & 0x0000001f; }


x86 assembly (clang, -O0):
<shamt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x6,%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shamt>:
mov    %edi,%eax
shr    $0x6,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @shamt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
%5 = and i32 %4, 31
ret i32 %5
}

LLVM IR (-O2):
define i32 @shamt(i32 %0) {
%2 = lshr i32 %0, 6
%3 = and i32 %2, 31
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int /*<<< orphan*/, int);
int /*<<< orphan*/ rotate_anticlockwise(int);
void rotate_anticlockwise_test(void **state) {
  assert_int_equal(
      rotate_anticlockwise(0x0202020202020202ul | 0x0000FF0000000000ul),
      0x000000000000FF00ul | 0x0404040404040404ul);
}


x86 assembly (clang, -O0):
<rotate_anticlockwise_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x2020202,%edi
call   1040 <rotate_anticlockwise@plt>
mov    %eax,%edi
mov    $0x404ff04,%esi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate_anticlockwise_test>:
push   %rax
mov    $0x2020202,%edi
call   1040 <rotate_anticlockwise@plt>
mov    %eax,%edi
mov    $0x404ff04,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @rotate_anticlockwise_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @rotate_anticlockwise(i32 33686018)
%4 = call i32 @assert_int_equal(i32 %3, i32 67436292)
ret void
}

LLVM IR (-O2):
define void @rotate_anticlockwise_test(i8** nocapture readnone %0) {
%2 = tail call i32 @rotate_anticlockwise(i32 33686018)
%3 = tail call i32 @assert_int_equal(i32 %2, i32 67436292)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int check_if_block(char *first) { return strcmp(first, "block") == 0; }


x86 assembly (clang, -O0):
<check_if_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_block>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"block\00"
define i32 @check_if_block(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"block\00"
define i32 @check_if_block(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *argv0) {
  fprintf(stderr, "Usage: %s <ObsTCP port number> > /dir/private-key\n", argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: %s <ObsTCP port number> > /dir/private-key\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Usage: %s <ObsTCP port number> > /dir/private-key\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ KeSetEvent(int, int, int /*<<< orphan*/);
int FloppyPnpComplete(int DeviceObject, int Irp, int Context) {
  {
    { KeSetEvent(Context, 1, 0); }
    return (-1073741802);
  }
}


x86 assembly (clang, -O0):
<FloppyPnpComplete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <KeSetEvent@plt>
mov    $0xc0000016,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FloppyPnpComplete>:
push   %rax
mov    %edx,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <KeSetEvent@plt>
mov    $0xc0000016,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @FloppyPnpComplete(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* %6
%8 = call i32 @KeSetEvent(i32 %7, i32 1, i32 0)
ret i32 -1073741802
}

LLVM IR (-O2):
define i32 @FloppyPnpComplete(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @KeSetEvent(i32 %2, i32 1, i32 0)
ret i32 -1073741802
}
/* Variables and functions */
double fabs(double);
int cs_tol(int i, int j, double aij, void *tol) {
  return (fabs(aij) > *((double *)tol));
  (void)i;
  (void)j;
}


x86 assembly (clang, -O0):
<cs_tol>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xee1(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs_tol>:
andpd  0xef8(%rip),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @cs_tol(i32 %0, i32 %1, double %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store double %2, double* %7
store i8* %3, i8** %8
%9 = load double, double* %7
%10 = call double @llvm.fabs.f64(double %9)
%11 = load i8*, i8** %8
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
%14 = fcmp ogt double %10, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @cs_tol(i32 %0, i32 %1, double %2, i8* nocapture %3) {
%5 = tail call double @llvm.fabs.f64(double %2)
%6 = bitcast i8* %3 to double*
%7 = load double, double* %6
%8 = fcmp ogt double %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char const *,
                            int /*<<< orphan*/);
__attribute__((noreturn)) void def_crash_handler(const char *format,
                                                 va_list args, void *param) {
  vfprintf(stderr, format, args);
  exit(0);
  (void)param;
}


x86 assembly (clang, -O0):
<def_crash_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<def_crash_handler>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1030 <vfprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @def_crash_handler(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i32 @vfprintf(i32 %7, i8* %8, i32 %9)
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @def_crash_handler(i8* %0, i32 %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @vfprintf(i32 %4, i8* %0, i32 %1)
%6 = tail call i32 @exit(i32 0)
unreachable
}