xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ timeout;
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVTIMEO;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              char *, int);
void set_recv_timeout(int fd) {
  struct timeval timeout;
  timeout.tv_sec = 5;
  timeout.tv_usec = 0;
  setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof(timeout));
}


x86 assembly (clang, -O0):
<set_recv_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_recv_timeout>:
sub    $0x18,%rsp
movl   $0x5,0x8(%rsp)
movq   $0x0,0x10(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    0x8(%rsp),%rcx
mov    $0x10,%r8d
call   1030 <setsockopt@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define void @set_recv_timeout(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timeval
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i32 5, i32* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* %2
%7 = load i32, i32* @SOL_SOCKET
%8 = load i32, i32* @SO_RCVTIMEO
%9 = bitcast %struct.timeval* %3 to i8*
%10 = call i32 @setsockopt(i32 %6, i32 %7, i32 %8, i8* %9, i32 16)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define void @set_recv_timeout(i32 %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i32 5, i32* %4
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i64 0, i64* %5
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVTIMEO
%8 = call i32 @setsockopt(i32 %0, i32 %6, i32 %7, i8* %3, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BannerMsg(char *, int);
int /*<<< orphan*/ ms_sleep(int);
int main() {
  int i;
  int j;
  j = 0;
  i = 0;
  BannerMsg("balle", 10);
  ms_sleep(1000);
  BannerMsg("Hi This is Test Message", 10);
  ms_sleep(1000);
  BannerMsg("elepahnant type", 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xebc(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xea7(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xea4(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xec3(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
mov    $0x3e8,%edi
call   1030 <ms_sleep@plt>
lea    0xec0(%rip),%rdi
mov    $0xa,%esi
call   1040 <BannerMsg@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"balle\00"
@.str.1 = [24 x i8] c"Hi This is Test Message\00"
@.str.2 = [16 x i8] c"elepahnant type\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %2
%4 = call i32 @BannerMsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = call i32 @ms_sleep(i32 1000)
%6 = call i32 @BannerMsg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 10)
%7 = call i32 @ms_sleep(i32 1000)
%8 = call i32 @BannerMsg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"balle\00"
@.str.1 = [24 x i8] c"Hi This is Test Message\00"
@.str.2 = [16 x i8] c"elepahnant type\00"
define i32 @main() {
%1 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @ms_sleep(i32 1000)
%3 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 10)
%4 = tail call i32 @ms_sleep(i32 1000)
%5 = tail call i32 @BannerMsg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ bits;

/* Variables and functions */
unsigned long rightrotate(unsigned long bits, size_t size) {
  unsigned long right_side = bits & ~(~0UL << size);
  bits >>= size;
  right_side <<= ((sizeof(bits) << 3) - size);
  return bits | right_side;
}


x86 assembly (clang, -O0):
<rightrotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
mov    %rdx,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
shr    %cl,%rax
mov    %rax,-0x8(%rbp)
mov    $0x40,%ecx
sub    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
or     -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrotate>:
mov    %rsi,%rcx
mov    %rdi,%rax
ror    %cl,%rax
ret

LLVM IR (-O0):
define i64 @rightrotate(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = shl i64 -1, %7
%9 = xor i64 %8, -1
%10 = and i64 %6, %9
store i64 %10, i64* %5
%11 = load i64, i64* %4
%12 = load i64, i64* %3
%13 = lshr i64 %12, %11
store i64 %13, i64* %3
%14 = load i64, i64* %4
%15 = sub i64 64, %14
%16 = load i64, i64* %5
%17 = shl i64 %16, %15
store i64 %17, i64* %5
%18 = load i64, i64* %3
%19 = load i64, i64* %5
%20 = or i64 %18, %19
ret i64 %20
}

LLVM IR (-O2):
define i64 @rightrotate(i64 %0, i64 %1) {
%3 = lshr i64 %0, %1
%4 = sub i64 64, %1
%5 = shl i64 %0, %4
%6 = or i64 %5, %3
ret i64 %6
}
double d22_to_double(int x) { return ((double)x) / 0x400000; }


x86 assembly (clang, -O0):
<d22_to_double>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @d22_to_double(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 0x4150000000000000
ret double %5
}

LLVM IR (-O2):
define double @d22_to_double(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 0x3E90000000000000
ret double %3
}
int is_bit_set(const char *bits, int n) {
  return bits[n / 8] & (1 << (7 - (n % 8)));
}


x86 assembly (clang, -O0):
<is_bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
mov    $0x7,%ecx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bit_set>:
lea    0x7(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
mov    %eax,%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movsbl (%rdi,%rcx,1),%edx
and    $0xfffffff8,%eax
sub    %eax,%esi
mov    $0x7,%cl
sub    %sil,%cl
mov    $0x1,%eax
shl    %cl,%eax
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @is_bit_set(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 8
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i32, i32* %4
%13 = srem i32 %12, 8
%14 = sub nsw i32 7, %13
%15 = shl i32 1, %14
%16 = and i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_bit_set(i8* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 8
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = srem i32 %1, 8
%9 = sub nsw i32 7, %8
%10 = shl nuw nsw i32 1, %9
%11 = and i32 %10, %7
ret i32 %11
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_output_listener {
  int dummy;
};
struct wl_output {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_output_add_listener(struct wl_output *wl_output,
                           const struct wl_output_listener *listener,
                           void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_output,
                               (void (**)(void))listener, data);
}


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

x86 assembly (clang, -O2):
<wl_output_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.wl_output = type { i32 }
%struct.wl_output_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_output_add_listener(%struct.wl_output* %0, %struct.wl_output_listener* %1, i8* %2) {
%4 = alloca %struct.wl_output*
%5 = alloca %struct.wl_output_listener*
%6 = alloca i8*
store %struct.wl_output* %0, %struct.wl_output** %4
store %struct.wl_output_listener* %1, %struct.wl_output_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_output*, %struct.wl_output** %4
%8 = bitcast %struct.wl_output* %7 to %struct.wl_proxy*
%9 = load %struct.wl_output_listener*, %struct.wl_output_listener** %5
%10 = bitcast %struct.wl_output_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_output = type { i32 }
%struct.wl_output_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_output_add_listener(%struct.wl_output* %0, %struct.wl_output_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_output* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_output_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
int libfunc(void) { return 3; }


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

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

LLVM IR (-O0):
define i32 @libfunc() {
ret i32 3
}

LLVM IR (-O2):
define i32 @libfunc() {
ret i32 3
}
unsigned long
avcbe_insert_filler_data_for_cpb_buffer(unsigned long input_filler_size) {
  return input_filler_size;
}


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

x86 assembly (clang, -O2):
<avcbe_insert_filler_data_for_cpb_buffer>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @avcbe_insert_filler_data_for_cpb_buffer(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ function2();
int /*<<< orphan*/ function3();
void function1() {
  function2();
  function3();
}


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

x86 assembly (clang, -O2):
<function1>:
push   %rax
xor    %eax,%eax
call   1040 <function2@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <function3@plt>

LLVM IR (-O0):
define void @function1() {
%1 = call i32 (...) @function2()
%2 = call i32 (...) @function3()
ret void
}

LLVM IR (-O2):
define void @function1() {
%1 = tail call i32 (...) @function2()
%2 = tail call i32 (...) @function3()
ret void
}
void qikswap(int *a, unsigned i, unsigned j) {
  int temp;
  temp = a[i];
  a[i] = a[j];
  a[j] = temp;
}


x86 assembly (clang, -O0):
<qikswap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<qikswap>:
mov    %esi,%eax
mov    (%rdi,%rax,4),%ecx
mov    %edx,%edx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @qikswap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = zext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @qikswap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_to_ccr(char *);
void i_eori_ccr(void) { op_to_ccr("xor"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"xor\00"
define void @i_eori_ccr() {
%1 = call i32 @op_to_ccr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"xor\00"
define void @i_eori_ccr() {
%1 = tail call i32 @op_to_ccr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  double tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
double get_MINUS_time_MINUS_elapsed() {
  struct timespec tv;
  clock_gettime(CLOCK_REALTIME, &tv);
  return 1000000000 * tv.tv_sec + tv.tv_nsec;
}


x86 assembly (clang, -O0):
<get_MINUS_time_MINUS_elapsed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_MINUS_time_MINUS_elapsed>:
sub    $0x18,%rsp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,0x8(%rsp),%eax
3b
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, double }
@CLOCK_REALTIME = global i32 0
define double @get_MINUS_time_MINUS_elapsed() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_REALTIME
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000000, %5
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load double, double* %8
%10 = fadd double %7, %9
ret double %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, double }
@CLOCK_REALTIME = global i32 0
define double @get_MINUS_time_MINUS_elapsed() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_REALTIME
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000000
%8 = sitofp i32 %7 to double
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load double, double* %9
%11 = fadd double %10, %8
ret double %11
}
/* Type definitions */
struct file_buffer {
  int dummy;
};
struct cache {
  int dummy;
};

/* Variables and functions */
struct file_buffer *_cache_get(struct cache *, long long, int);
struct file_buffer *cache_get(struct cache *cache, long long index) {
  return _cache_get(cache, index, 1);
}


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

x86 assembly (clang, -O2):
<cache_get>:
mov    $0x1,%edx
jmp    1030 <_cache_get@plt>

LLVM IR (-O0):
%struct.file_buffer = type { i32 }
%struct.cache = type { i32 }
define %struct.file_buffer* @cache_get(%struct.cache* %0, i64 %1) {
%3 = alloca %struct.cache*
%4 = alloca i64
store %struct.cache* %0, %struct.cache** %3
store i64 %1, i64* %4
%5 = load %struct.cache*, %struct.cache** %3
%6 = load i64, i64* %4
%7 = call %struct.file_buffer* @_cache_get(%struct.cache* %5, i64 %6, i32 1)
ret %struct.file_buffer* %7
}

LLVM IR (-O2):
%struct.file_buffer = type { i32 }
%struct.cache = type { i32 }
define %struct.file_buffer* @cache_get(%struct.cache* %0, i64 %1) {
%3 = tail call %struct.file_buffer* @_cache_get(%struct.cache* %0, i64 %1, i32 1)
ret %struct.file_buffer* %3
}
/* Variables and functions */
char *strdup(char *);
char *strdupnul(char *in) {
  if (in == NULL) {
    return NULL;
  } else {
    return strdup(in);
  }
}


x86 assembly (clang, -O0):
<strdupnul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <strdupnul+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <strdupnul+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @strdupnul(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @strdup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @strdupnul(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_strlen(char *);
int write(int, char *, int /*<<< orphan*/);
void put_error(char *str, int kill) {
  if ((write(2, str, my_strlen(str))) == -1)
    exit(1);
  if (kill == 1)
    exit(1);
}


x86 assembly (clang, -O0):
<put_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
cmp    $0xffffffff,%eax
jne    1173 <put_error+0x43>
mov    $0x1,%edi
call   1050 <exit@plt>
cmpl   $0x1,-0xc(%rbp)
jne    1187 <put_error+0x57>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
je     115d <put_error+0x2d>
cmp    $0x1,%ebp
je     115d <put_error+0x2d>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define void @put_error(i8* %0, i32 %1) {
%3 = tail call i32 @my_strlen(i8* %0)
%4 = tail call i32 @write(i32 2, i8* %0, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = icmp eq i32 %1, 1
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_tig_fflush();
extern void tig_flush() { sys_tig_fflush(); }


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

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

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

LLVM IR (-O2):
define void @tig_flush() {
%1 = tail call i32 (...) @sys_tig_fflush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int execle(const char *path, const char *arg0, ...) {
  fprintf(stderr, "ERROR: execle is unsupported!\n");
  fprintf(stderr, "Tried to execute '%s' with arg0 '%s'\n", path, arg0);
  abort();
}


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

x86 assembly (clang, -O2):
<execle>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eae(%rip),%r15
mov    (%r15),%edi
lea    0xec4(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r15),%edi
lea    0xed2(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR: execle is unsupported!\0A\00"
@.str.1 = [38 x i8] c"Tried to execute '%s' with arg0 '%s'\0A\00"
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9)
%11 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR: execle is unsupported!\0A\00"
@.str.1 = [38 x i8] c"Tried to execute '%s' with arg0 '%s'\0A\00"
define i32 @execle(i8* %0, i8* %1, ...) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %1)
%7 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
void *malloc(int);
scalar_t__ memcpy(void *, char const *, int);
int strlen(char const *);
char *strdup(const char *src) {
  int len = strlen(src) + 1;
  void *new = malloc(len);
  if (new == NULL)
    return NULL;
  return (char *)memcpy(new, src, len);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116f <strdup+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    1183 <strdup+0x53>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     115b <strdup+0x2b>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
jmp    115d <strdup+0x2d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = tail call i64 @memcpy(i8* %4, i8* %0, i32 %3)
%8 = inttoptr i64 %7 to i8*
br label %9
9: ; preds = %1, %6
%10 = phi i8* [ %8, %6 ], [ null, %1 ]
ret i8* %10
}
void gfc_global_cleanup() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int, int /*<<< orphan*/);
void capture_write_sscape(uint16_t port, uint8_t val, void *p) {
  capture_event(p, (0 << 8), 1, port);
}


x86 assembly (clang, -O0):
<capture_write_sscape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <capture_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_write_sscape>:
mov    %edi,%ecx
mov    %rdx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <capture_event@plt>

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

LLVM IR (-O2):
define void @capture_write_sscape(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @capture_event(i8* %2, i32 0, i32 1, i32 %0)
ret void
}
unsigned xrop3_45_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = S | stk3;
  stk1 = T ^ stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_45_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %3, -256
%8 = xor i32 %6, %7
%9 = and i32 %8, %4
%10 = xor i32 %6, -1
%11 = and i32 %7, %10
%12 = xor i32 %4, -1
%13 = and i32 %12, %5
%14 = or i32 %11, %13
%15 = or i32 %14, %9
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
long O_NONBLOCK;
long fcntl(int, int /*<<< orphan*/, long);
void os_set_sock_nonblocking_mode(int sock) {
  long arg = fcntl(sock, F_GETFL, NULL);
  arg |= O_NONBLOCK;
  fcntl(sock, F_SETFL, arg);
}


x86 assembly (clang, -O0):
<os_set_sock_nonblocking_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <fcntl@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_set_sock_nonblocking_mode>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2ebe(%rip),%rcx
or     (%rcx),%rax
mov    0x2ea4(%rip),%rcx
mov    (%rcx),%esi
mov    %ebx,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define void @os_set_sock_nonblocking_mode(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i64 @fcntl(i32 %4, i32 %5, i64 0)
store i64 %6, i64* %3
%7 = load i64, i64* @O_NONBLOCK
%8 = load i64, i64* %3
%9 = or i64 %8, %7
store i64 %9, i64* %3
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i64, i64* %3
%13 = call i64 @fcntl(i32 %10, i32 %11, i64 %12)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@O_NONBLOCK = global i64 0
@F_SETFL = global i32 0
define void @os_set_sock_nonblocking_mode(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i64 @fcntl(i32 %0, i32 %2, i64 0)
%4 = load i64, i64* @O_NONBLOCK
%5 = or i64 %4, %3
%6 = load i32, i32* @F_SETFL
%7 = tail call i64 @fcntl(i32 %0, i32 %6, i64 %5)
ret void
}
void coresight_cti_ctx_restore(void) {}


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

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

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

LLVM IR (-O2):
define void @coresight_cti_ctx_restore() {
ret void
}
void ab7cdefghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @ab7cdefghijklmnopqrstuvwxzy() {
ret void
}
int test_imm_86uint8_mem(unsigned char *val) {
  return ((*val) & (0x86 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_86uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 134
%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_86uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -122
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
func_with_args(moo, yo, dawg) { echo(moo, " is ", yo, " under ", dawg); }


x86 assembly (clang, -O0):
<func_with_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%r8d
lea    0xece(%rip),%rsi
lea    0xecc(%rip),%rcx
mov    $0x0,%al
call   1030 <echo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_with_args>:
mov    %edx,%r8d
mov    %esi,%edx
lea    0xee4(%rip),%rsi
lea    0xee2(%rip),%rcx
xor    %eax,%eax
jmp    1030 <echo@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" is \00"
@.str.1 = [8 x i8] c" under \00"
define i32 @func_with_args(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* %7
%11 = call i32 (i32, i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i32, i8*, i32, i8*, i32, ...)*)(i32 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c" is \00"
@.str.1 = [8 x i8] c" under \00"
define i32 @func_with_args(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, i8*, i32, ...) bitcast (i32 (...)* @echo to i32 (i32, i8*, i32, i8*, i32, ...)*)(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 undef
}
/* Type definitions */
struct signature {
  int dummy;
};

/* Variables and functions */
int signature_greater(struct signature *, struct signature *);
int signature_ptr_greater(const void *x, const void *y) {
  return signature_greater((*(struct signature **)x),
                           (*(struct signature **)y));
}


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

x86 assembly (clang, -O2):
<signature_ptr_greater>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <signature_greater@plt>

LLVM IR (-O0):
%struct.signature = type { i32 }
define i32 @signature_ptr_greater(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to %struct.signature**
%7 = load %struct.signature*, %struct.signature** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.signature**
%10 = load %struct.signature*, %struct.signature** %9
%11 = call i32 @signature_greater(%struct.signature* %7, %struct.signature* %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.signature = type { i32 }
define i32 @signature_ptr_greater(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to %struct.signature**
%4 = load %struct.signature*, %struct.signature** %3
%5 = bitcast i8* %1 to %struct.signature**
%6 = load %struct.signature*, %struct.signature** %5
%7 = tail call i32 @signature_greater(%struct.signature* %4, %struct.signature* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fcvtsd(int s, int d) {
  assem_debug("fcvtsd s%d,d%d\n", d, s);
  output_w32(0xeeb70bc0 | ((d & 14) << 11) | ((d & 1) << 22) | (s & 7));
}


x86 assembly (clang, -O0):
<emit_fcvtsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0xe,%edi
shl    $0xb,%edi
or     $0xeeb70bc0,%edi
mov    -0x8(%rbp),%eax
and    $0x1,%eax
shl    $0x16,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fcvtsd>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
lea    0xed0(%rip),%rdi
mov    %r14d,%edx
call   1030 <assem_debug@plt>
mov    %ebx,%eax
and    $0xe,%eax
shl    $0xb,%eax
and    $0x1,%ebx
shl    $0x16,%ebx
and    $0x7,%r14d
or     %ebx,%r14d
lea    (%rax,%r14,1),%edi
add    $0xeeb70bc0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"fcvtsd s%d,d%d\0A\00"
define void @emit_fcvtsd(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 = call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 14
%10 = shl i32 %9, 11
%11 = or i32 -289993792, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 1
%14 = shl i32 %13, 22
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 7
%18 = or i32 %15, %17
%19 = call i32 @output_w32(i32 %18)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"fcvtsd s%d,d%d\0A\00"
define void @emit_fcvtsd(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 11
%5 = and i32 %4, 28672
%6 = shl i32 %1, 22
%7 = and i32 %6, 4194304
%8 = and i32 %0, 7
%9 = or i32 %8, %7
%10 = or i32 %9, %5
%11 = or i32 %10, -289993792
%12 = tail call i32 @output_w32(i32 %11)
ret void
}
void *p() {
  int y = 0;
  for (int i = 0; i < 50; i++) {
    y++;
  }
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x32,-0x10(%rbp)
jge    1133 <p+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <p+0x12>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @p() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 50
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
%14 = load i8*, i8** %1
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @p() {
ret i8* undef
}
/* Type definitions */
typedef void passwd;

/* Variables and functions */
int /*<<< orphan*/ __softboundmpx_store_return_metadata(void *, char *);
void *getpwnam(char const *);
__attribute__((__weak__, __always___)) struct passwd *
softboundmpx_getpwnam(const char *name) {
  void *ret_ptr = getpwnam(name);
  __softboundmpx_store_return_metadata(ret_ptr, (char *)ret_ptr + 1024 * 1024);
  return ret_ptr;
}


x86 assembly (clang, -O0):
<softboundmpx_getpwnam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x100000,%rsi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundmpx_getpwnam>:
push   %rbx
call   1030 <getpwnam@plt>
mov    %rax,%rbx
lea    0x100000(%rax),%rsi
mov    %rax,%rdi
call   1040 <__softboundmpx_store_return_metadata@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type opaque
define weak %struct.passwd* @softboundmpx_getpwnam(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @getpwnam(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1048576
%9 = call i32 @__softboundmpx_store_return_metadata(i8* %6, i8* %8)
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to %struct.passwd*
ret %struct.passwd* %11
}

LLVM IR (-O2):
%struct.passwd = type opaque
define weak %struct.passwd* @softboundmpx_getpwnam(i8* %0) {
%2 = tail call i8* @getpwnam(i8* %0)
%3 = getelementptr inbounds i8, i8* %2, i64 1048576
%4 = tail call i32 @__softboundmpx_store_return_metadata(i8* %2, i8* %3)
%5 = bitcast i8* %2 to %struct.passwd*
ret %struct.passwd* %5
}
/* Variables and functions */
int /*<<< orphan*/ SystemInit();
int /*<<< orphan*/ start_sd();
int main(void) {
  SystemInit();
  start_sd();
  while (1) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <SystemInit@plt>
mov    $0x0,%al
call   1030 <start_sd@plt>
jmp    113d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <SystemInit@plt>
xor    %eax,%eax
call   1030 <start_sd@plt>
nop
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @SystemInit()
%3 = call i32 (...) @start_sd()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @SystemInit()
%2 = tail call i32 (...) @start_sd()
br label %3
3: ; preds = %0, %3
br label %3
}
int __attribute__((no)) foo(int *p, int *q) {
  *p = 2;
  *q = 1;
  return *p;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x2,(%rdi)
movl   $0x1,(%rsi)
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @foo(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
store i32 2, i32* %5
%6 = load i32*, i32** %4
store i32 1, i32* %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0, i32* nocapture writeonly %1) {
store i32 2, i32* %0
store i32 1, i32* %1
%3 = load i32, i32* %0
ret i32 %3
}
/* Variables and functions */
unsigned long long __builtin_arm_rsr64(char *);
unsigned long long rsr64() { return __builtin_arm_rsr64("cp1:2:c3"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"cp1:2:c3\00"
define i64 @rsr64() {
%1 = call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}

LLVM IR (-O2):
@.str = [9 x i8] c"cp1:2:c3\00"
define i64 @rsr64() {
%1 = tail call i64 @__builtin_arm_rsr64(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i64 %1
}
void MirrorPlane() {}


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

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

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

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