xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_OBJECT;

/* Variables and functions */
int sn_cmp(int /*<<< orphan*/ const *const *, unsigned int const *);
int sn_cmp_BSEARCH_CMP_FN(const void *a_, const void *b_) {
  const ASN1_OBJECT *const *a = a_;
  unsigned int const *b = b_;
  return sn_cmp(a, b);
}


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

x86 assembly (clang, -O2):
<sn_cmp_BSEARCH_CMP_FN>:
jmp    1030 <sn_cmp@plt>

LLVM IR (-O0):
define i32 @sn_cmp_BSEARCH_CMP_FN(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32**
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32**
store i32** %8, i32*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32**, i32*** %5
%12 = load i32*, i32** %6
%13 = call i32 @sn_cmp(i32** %11, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @sn_cmp_BSEARCH_CMP_FN(i8* %0, i8* %1) {
%3 = bitcast i8* %0 to i32**
%4 = bitcast i8* %1 to i32*
%5 = tail call i32 @sn_cmp(i32** %3, i32* %4)
ret i32 %5
}
void CRYPTO_get_add_lock_callback(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ inv_dct8_1d_internal_c(int /*<<< orphan*/ *const,
                                          int /*<<< orphan*/ const, int const,
                                          int const, int /*<<< orphan*/);
void dav1d_inv_dct8_1d_c(int32_t *const c, const ptrdiff_t stride,
                         const int min, const int max) {
  inv_dct8_1d_internal_c(c, stride, min, max, 0);
}


x86 assembly (clang, -O0):
<dav1d_inv_dct8_1d_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <inv_dct8_1d_internal_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dav1d_inv_dct8_1d_c>:
xor    %r8d,%r8d
jmp    1030 <inv_dct8_1d_internal_c@plt>

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

LLVM IR (-O2):
define void @dav1d_inv_dct8_1d_c(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @inv_dct8_1d_internal_c(i32* %0, i32 %1, i32 %2, i32 %3, i32 0)
ret void
}
void getTransverterState(int fd) {}


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

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

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

LLVM IR (-O2):
define void @getTransverterState(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int write(int, char *, int);
void kick_fd_client(int fd) {
  char buf = '1';
  if (write(fd, &buf, 1) != 1)
    exit(1);
}


x86 assembly (clang, -O0):
<kick_fd_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movb   $0x31,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
je     1153 <kick_fd_client+0x33>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kick_fd_client>:
push   %rax
movb   $0x31,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
jne    113c <kick_fd_client+0x1c>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @kick_fd_client(i32 %0) {
%2 = alloca i8
store i8 49, i8* %2
%3 = call i32 @write(i32 %0, i8* %2, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
void get_unused_fd(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<get_unused_fd>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_unused_fd>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.get_unused_fd = [14 x i8] c"get_unused_fd\00"
define void @get_unused_fd() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_unused_fd, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.get_unused_fd = [14 x i8] c"get_unused_fd\00"
define void @get_unused_fd() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__func__.get_unused_fd, i64 0, i64 0))
ret void
}
/* Variables and functions */
float expf(float);
float r_exp(float *x) { return (expf(*x)); }


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

x86 assembly (clang, -O2):
<r_exp>:
movss  (%rdi),%xmm0
jmp    1030 <expf@plt>

LLVM IR (-O0):
define float @r_exp(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = call float @expf(float %4)
ret float %5
}

LLVM IR (-O2):
define float @r_exp(float* nocapture %0) {
%2 = load float, float* %0
%3 = tail call float @expf(float %2)
ret float %3
}
/* Variables and functions */
unsigned long max(unsigned long a, unsigned long b) {
  if (a > b)
    return (a);
  return (b);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112f <max+0x2f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int cairo_code_draw_whiteTinyButton_get_width() { return 22; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_whiteTinyButton_get_width() {
ret i32 22
}

LLVM IR (-O2):
define i32 @cairo_code_draw_whiteTinyButton_get_width() {
ret i32 22
}
void foo190() {}


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

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

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

LLVM IR (-O2):
define void @foo190() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F2(int **);
void test4() {
  int *X;
  F2(&X);
  *X = 1;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <F2@plt>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %rax
mov    %rsp,%rdi
call   1030 <F2@plt>
mov    (%rsp),%rax
movl   $0x1,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @test4() {
%1 = alloca i32*
%2 = call i32 @F2(i32** %1)
%3 = load i32*, i32** %1
store i32 1, i32* %3
ret void
}

LLVM IR (-O2):
define void @test4() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @F2(i32** %1)
%4 = load i32*, i32** %1
store i32 1, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void unix_socket_close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<unix_socket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @unix_socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ shutdown(int, int /*<<< orphan*/);
extern void tcp_close(int sd) {
  shutdown(sd, SHUT_RDWR);
  close(sd);
}


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

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

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

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
define void @tcp_close(i32 %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i32 @shutdown(i32 %0, i32 %2)
%4 = tail call i32 @close(i32 %0)
ret void
}
int _Hand_PatternSort(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}


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

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

LLVM IR (-O0):
define i32 @_Hand_PatternSort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_Hand_PatternSort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void exchange(int *p1, int *p2) {
  int temp;
  temp = *p1;
  *p1 = *p2;
  *p2 = temp;
}


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

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

LLVM IR (-O0):
define void @exchange(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int LPCChannelValid(unsigned long);
void LPCChannelEnable(unsigned long ulBase, unsigned long ulChannel) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT(LPCChannelValid(ulChannel));
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= (1 << ulChannel);
}


x86 assembly (clang, -O0):
<LPCChannelEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelEnable>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
or     %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @LPCChannelEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074266112
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @LPCChannelValid(i64 %9)
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
%15 = sext i32 %14 to i64
%16 = load i64, i64* %3
%17 = add i64 %16, 0
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = or i64 %19, %15
store volatile i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @LPCChannelEnable(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @LPCChannelValid(i64 %1)
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = trunc i64 %1 to i32
%9 = shl nuw i32 1, %8
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %0 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %10
store volatile i64 %13, i64* %11
ret void
}
double EOS_T(double p, double rho) { return p / rho / 287.0; }


x86 assembly (clang, -O0):
<EOS_T>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<EOS_T>:
divsd  %xmm1,%xmm0
divsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @EOS_T(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 = fdiv double %5, %6
%8 = fdiv double %7, 2.870000e+02
ret double %8
}

LLVM IR (-O2):
define double @EOS_T(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fdiv double %3, 2.870000e+02
ret double %4
}
int test_imm_CFint16_mem(short *val) {
  return ((*val) & (0xCF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_CFint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 207
%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_CFint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 207
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void error_duplicate_pid(int pid) {
  fprintf(stderr, "Error - more than one process has id %d.\n", pid);
  exit(-1);
}


x86 assembly (clang, -O0):
<error_duplicate_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_duplicate_pid>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Error - more than one process has id %d.\0A\00"
define void @error_duplicate_pid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Error - more than one process has id %d.\0A\00"
define void @error_duplicate_pid(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ f_extern();
int /*<<< orphan*/ f_first();
int /*<<< orphan*/ f_later();
void __attribute__((transaction_safe)) test_safe(void) {
  f_extern();
  f_first();
  f_later();
}


x86 assembly (clang, -O0):
<test_safe>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <f_extern@plt>
mov    $0x0,%al
call   1050 <f_first@plt>
mov    $0x0,%al
call   1030 <f_later@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_safe>:
push   %rax
xor    %eax,%eax
call   1040 <f_extern@plt>
xor    %eax,%eax
call   1050 <f_first@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <f_later@plt>

LLVM IR (-O0):
define void @test_safe() {
%1 = call i32 (...) @f_extern()
%2 = call i32 (...) @f_first()
%3 = call i32 (...) @f_later()
ret void
}

LLVM IR (-O2):
define void @test_safe() {
%1 = tail call i32 (...) @f_extern()
%2 = tail call i32 (...) @f_first()
%3 = tail call i32 (...) @f_later()
ret void
}
void f(int b) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}
int test_imm_2Buint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x2B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Buint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 43
%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_2Buint64_midword_reg(i64 %0) {
%2 = and i64 %0, 2818048
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;
typedef scalar_t__ rdx;

/* Variables and functions */
int /*<<< orphan*/ cpuid(int, int *, int *, int *, int *);
bool cpuid_timeStampCounter_avail() {
  uint64_t rax, rbx, rcx, rdx;
  int leaf = 1;
  cpuid(leaf, &rax, &rbx, &rcx, &rdx);
  if ((((uint64_t)(rdx) &
        ((((uint64_t)1 << (((4)) - ((4)) + 1)) - 1) << ((4)))) >>
       (4)) == 1) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<cpuid_timeStampCounter_avail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <cpuid@plt>
mov    -0x14(%rbp),%eax
and    $0x10,%eax
sar    $0x4,%eax
cmp    $0x1,%eax
jne    1155 <cpuid_timeStampCounter_avail+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115c <cpuid_timeStampCounter_avail+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_timeStampCounter_avail>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x1,%edi
call   1030 <cpuid@plt>
mov    0x8(%rsp),%eax
shr    $0x4,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuid_timeStampCounter_avail() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 1, i32* %6
%7 = load i32, i32* %6
%8 = call i32 @cpuid(i32 %7, i32* %2, i32* %3, i32* %4, i32* %5)
%9 = load i32, i32* %5
%10 = and i32 %9, 16
%11 = ashr i32 %10, 4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %1
br label %15
14: ; preds = %0
store i32 0, i32* %1
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @cpuid_timeStampCounter_avail() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %4
%11 = lshr i32 %10, 4
%12 = and i32 %11, 1
ret i32 %12
}
int fun754() { return 754; }


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

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

LLVM IR (-O0):
define i32 @fun754() {
ret i32 754
}

LLVM IR (-O2):
define i32 @fun754() {
ret i32 754
}
/* Variables and functions */
int /*<<< orphan*/ lock_atom_add();
int /*<<< orphan*/ unlock_atom_add();
int atomicExch(int *addr, int value) {
  int ret;
  lock_atom_add();
  ret = *addr;
  *addr = value;
  unlock_atom_add();
  return ret;
}


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

x86 assembly (clang, -O2):
<atomicExch>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <lock_atom_add@plt>
mov    (%rbx),%ebp
mov    %r14d,(%rbx)
xor    %eax,%eax
call   1040 <unlock_atom_add@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @atomicExch(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (...) @lock_atom_add()
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = call i32 (...) @unlock_atom_add()
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @atomicExch(i32* nocapture %0, i32 %1) {
%3 = tail call i32 (...) @lock_atom_add()
%4 = load i32, i32* %0
store i32 %1, i32* %0
%5 = tail call i32 (...) @unlock_atom_add()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f0(int /*<<< orphan*/);
int /*<<< orphan*/ f1(int /*<<< orphan*/);
int /*<<< orphan*/ f2(int /*<<< orphan*/);
int /*<<< orphan*/ f3(int /*<<< orphan*/);
int /*<<< orphan*/ f4(int /*<<< orphan*/);
int /*<<< orphan*/ f5(int /*<<< orphan*/);
void test() {
  f0(0);
  f1(0);
  f2(0);
  f3(0);
  f4(0);
  f5(0);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <f0@plt>
xor    %edi,%edi
call   1060 <f1@plt>
xor    %edi,%edi
call   1040 <f2@plt>
xor    %edi,%edi
call   1050 <f3@plt>
xor    %edi,%edi
call   1080 <f4@plt>
xor    %edi,%edi
call   1070 <f5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
xor    %edi,%edi
call   1030 <f0@plt>
xor    %edi,%edi
call   1060 <f1@plt>
xor    %edi,%edi
call   1040 <f2@plt>
xor    %edi,%edi
call   1050 <f3@plt>
xor    %edi,%edi
call   1080 <f4@plt>
xor    %edi,%edi
pop    %rax
jmp    1070 <f5@plt>

LLVM IR (-O0):
define void @test() {
%1 = call i32 @f0(i32 0)
%2 = call i32 @f1(i32 0)
%3 = call i32 @f2(i32 0)
%4 = call i32 @f3(i32 0)
%5 = call i32 @f4(i32 0)
%6 = call i32 @f5(i32 0)
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @f0(i32 0)
%2 = tail call i32 @f1(i32 0)
%3 = tail call i32 @f2(i32 0)
%4 = tail call i32 @f3(i32 0)
%5 = tail call i32 @f4(i32 0)
%6 = tail call i32 @f5(i32 0)
ret void
}
int cvmx_helper_ports_on_interface(int interface) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @cvmx_helper_ports_on_interface(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fill_buffer(char *, int);
int /*<<< orphan*/ use_buffer(char *);
void main() {
  char buf[100];
  fill_buffer(buf, 100);
  use_buffer(buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1030 <fill_buffer@plt>
lea    -0x70(%rbp),%rdi
call   1040 <use_buffer@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
call   1030 <fill_buffer@plt>
mov    %rbx,%rdi
call   1040 <use_buffer@plt>
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @fill_buffer(i8* %2, i32 100)
%4 = call i32 @use_buffer(i8* %2)
ret void
}
/* Variables and functions */
char *concatenate(char *, char *, int, char const *, char const *);
char *get_job_log_dir(const char *log_dir, const char *job_id) {
  return concatenate("%s/userlogs/%s", "job_log_dir", 2, log_dir, job_id);
}


x86 assembly (clang, -O0):
<get_job_log_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xed9(%rip),%rsi
mov    $0x2,%edx
call   1030 <concatenate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_job_log_dir>:
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xee3(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x2,%edx
jmp    1030 <concatenate@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s/userlogs/%s\00"
@.str.1 = [12 x i8] c"job_log_dir\00"
define i8* @get_job_log_dir(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 = load i8*, i8** %4
%7 = call i8* @concatenate(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s/userlogs/%s\00"
@.str.1 = [12 x i8] c"job_log_dir\00"
define i8* @get_job_log_dir(i8* %0, i8* %1) {
%3 = tail call i8* @concatenate(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 2, i8* %0, i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ui16bad_underscore(int a) { return 5; }


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

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

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

LLVM IR (-O2):
define i32 @ui16bad_underscore(i32 %0) {
ret i32 5
}
/* Variables and functions */
void *b85tobin(void *, char *);
void *b85decode(void *p) { return b85tobin(p, (char *)p); }


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

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

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

LLVM IR (-O2):
define i8* @b85decode(i8* %0) {
%2 = tail call i8* @b85tobin(i8* %0, i8* %0)
ret i8* %2
}
int test_imm_ACint16_reg(short val) {
  return ((val) & (0xAC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ACint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xac,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_ACint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 172
%6 = icmp ne i32 %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_ACint16_reg(i16 signext %0) {
%2 = and i16 %0, 172
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ system(char const *);
int fork_exec(const char *command) {
  pid_t pid = fork();
  if (pid == 0) {
    system(command);
    exit(0);
  } else if (pid == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fork_exec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1160 <fork_exec+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <system@plt>
xor    %edi,%edi
call   1040 <exit@plt>
cmpl   $0xffffffff,-0x14(%rbp)
jne    1176 <fork_exec+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1182 <fork_exec+0x52>
jmp    117b <fork_exec+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fork_exec>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <fork@plt>
cmp    $0xffffffff,%eax
je     1146 <fork_exec+0x16>
test   %eax,%eax
je     1148 <fork_exec+0x18>
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @fork_exec(i8* nocapture %0) {
%2 = tail call i32 (...) @fork()
switch i32 %2, label %6 [
i32 0, label %3
i32 -1, label %7
]
3: ; preds = %1
%4 = tail call i32 @system(i8* %0)
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %1
br label %7
7: ; preds = %1, %6
%8 = phi i32 [ 0, %6 ], [ %2, %1 ]
ret i32 %8
}
char *strchrnul(const char *s, int c_in) {
  while (*++s != c_in && *s)
    ;
  return (char *)s;
}


x86 assembly (clang, -O0):
<strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
je     113c <strchrnul+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114c <strchrnul+0x4c>
jmp    1151 <strchrnul+0x51>
jmp    110b <strchrnul+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchrnul>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <strchrnul+0x20>
cmp    %esi,%ecx
jne    1110 <strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %5, %3 ]
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = icmp eq i8 %6, 0
%10 = or i1 %9, %8
br i1 %10, label %11, label %3
11: ; preds = %3
ret i8* %5
}
/* Variables and functions */
double sqrt(double);
double square(double);
double radius_from_diagonal(double radius, double thickness, double length) {
  return sqrt(square(radius + thickness) + 0.25 * square(length));
}


x86 assembly (clang, -O0):
<radius_from_diagonal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
call   1030 <square@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <square@plt>
movsd  -0x20(%rbp),%xmm1
movsd  0xe9e(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<radius_from_diagonal>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
addsd  %xmm1,%xmm0
call   1030 <square@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <square@plt>
mulsd  0xeb4(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1165 <radius_from_diagonal+0x45>
sqrtsd %xmm0,%xmm0
add    $0x18,%rsp
ret
add    $0x18,%rsp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @radius_from_diagonal(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = call double @square(double %9)
%11 = load double, double* %6
%12 = call double @square(double %11)
%13 = call double @llvm.fmuladd.f64(double 2.500000e-01, double %12, double %10)
%14 = call double @sqrt(double %13)
ret double %14
}

LLVM IR (-O2):
define double @radius_from_diagonal(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = tail call double @square(double %4)
%6 = tail call double @square(double %2)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 2.500000e-01, double %5)
%8 = tail call double @sqrt(double %7)
ret double %8
}
/* Variables and functions */
double log(double);
double funcao(double x) { return (log(x) - 1.0); }


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

x86 assembly (clang, -O2):
<funcao>:
push   %rax
call   1030 <log@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcao(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log(double %3)
%5 = fsub double %4, 1.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @funcao(double %0) {
%2 = tail call double @log(double %0)
%3 = fadd double %2, -1.000000e+00
ret double %3
}
double min(const double a, const double b) { return b < a ? b : a; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <min+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %4
br label %12
10: ; preds = %2
%11 = load double, double* %3
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fcmp olt double %1, %0
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstrNoOperand(int);
void GenFxnEpilog(void) {
  GenPrintInstrNoOperand(0x1F);
  GenPrintInstrNoOperand(0x21);
}


x86 assembly (clang, -O0):
<GenFxnEpilog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1f,%edi
call   1030 <GenPrintInstrNoOperand@plt>
mov    $0x21,%edi
call   1030 <GenPrintInstrNoOperand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenFxnEpilog>:
push   %rax
mov    $0x1f,%edi
call   1030 <GenPrintInstrNoOperand@plt>
mov    $0x21,%edi
pop    %rax
jmp    1030 <GenPrintInstrNoOperand@plt>

LLVM IR (-O0):
define void @GenFxnEpilog() {
%1 = call i32 @GenPrintInstrNoOperand(i32 31)
%2 = call i32 @GenPrintInstrNoOperand(i32 33)
ret void
}

LLVM IR (-O2):
define void @GenFxnEpilog() {
%1 = tail call i32 @GenPrintInstrNoOperand(i32 31)
%2 = tail call i32 @GenPrintInstrNoOperand(i32 33)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int native_func() {
  int first = 1;
  int second = 2;
  printf("First: %d.\nSecond: %d.\n", first, second);
  return first + second;
}


x86 assembly (clang, -O0):
<native_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<native_func>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <printf@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"First: %d.\0ASecond: %d.\0A\00"
define i32 @native_func() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
@.str = [24 x i8] c"First: %d.\0ASecond: %d.\0A\00"
define i32 @native_func() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1, i32 2)
ret i32 3
}
void trafoanimator_dealloc(void *pointer) {}


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

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

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

LLVM IR (-O2):
define void @trafoanimator_dealloc(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(double);
void fail(void) {
  assert(0);
  assert(0.0);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail>:
push   %rax
xorps  %xmm0,%xmm0
call   1030 <assert@plt>
xorps  %xmm0,%xmm0
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @fail() {
%1 = call i32 @assert(double 0.000000e+00)
%2 = call i32 @assert(double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @fail() {
%1 = tail call i32 @assert(double 0.000000e+00)
%2 = tail call i32 @assert(double 0.000000e+00)
ret void
}
void testthis(unsigned char *bla) { *bla = 99; }


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

x86 assembly (clang, -O2):
<testthis>:
movb   $0x63,(%rdi)
ret

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

LLVM IR (-O2):
define void @testthis(i8* nocapture writeonly %0) {
store i8 99, i8* %0
ret void
}
int __lngEq(unsigned short a[2], unsigned short b[2]) {
  return (*a == *b) && (a[1] == b[1]);
}


x86 assembly (clang, -O0):
<__lngEq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%ecx
mov    -0x10(%rbp),%rax
movzwl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jne    113f <__lngEq+0x3f>
mov    -0x8(%rbp),%rax
movzwl 0x2(%rax),%eax
mov    -0x10(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__lngEq>:
movzwl (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%cx
jne    1117 <__lngEq+0x17>
movzwl 0x2(%rdi),%ecx
xor    %eax,%eax
cmp    0x2(%rsi),%cx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @__lngEq(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = load i16, i16* %1
%5 = icmp eq i16 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = getelementptr inbounds i16, i16* %0, i64 1
%8 = load i16, i16* %7
%9 = getelementptr inbounds i16, i16* %1, i64 1
%10 = load i16, i16* %9
%11 = icmp eq i16 %8, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %6, %2
%14 = phi i32 [ 0, %2 ], [ %12, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void pointer(const int *a) {
  int b;
  a = &b;
  printf("%d\n", *a);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @pointer(i32* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 undef)
ret void
}