xunge/DecIR huggingface dataset:
/* Variables and functions */
int send_msg(int, unsigned char *, int /*<<< orphan*/);
int send_login(int socket, unsigned char *username) {
  return send_msg(socket, username, 0);
}


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

x86 assembly (clang, -O2):
<send_login>:
xor    %edx,%edx
jmp    1030 <send_msg@plt>

LLVM IR (-O0):
define i32 @send_login(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @send_msg(i32 %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @send_login(i32 %0, i8* %1) {
%3 = tail call i32 @send_msg(i32 %0, i8* %1, i32 0)
ret i32 %3
}
int fill(char *p, int n, char **l) {
  while (*++p && n--)
    ;
  *l = p;
  return n <= 0;
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1144 <fill+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1154 <fill+0x54>
jmp    1159 <fill+0x59>
jmp    110f <fill+0xf>
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
cmpl   $0x0,-0xc(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
mov    %esi,%eax
add    %rdi,%rax
add    $0x1,%rax
add    $0x1,%rdi
nopl   (%rax)
cmpb   $0x0,(%rdi)
je     1125 <fill+0x25>
add    $0x1,%rdi
add    $0xffffffff,%esi
jb     1110 <fill+0x10>
mov    $0xffffffff,%esi
jmp    1128 <fill+0x28>
mov    %rdi,%rax
mov    %rax,(%rdx)
xor    %eax,%eax
test   %esi,%esi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @fill(i8* %0, i32 %1, i8** nocapture writeonly %2) {
%4 = zext i32 %1 to i64
%5 = add nuw nsw i64 %4, 1
%6 = getelementptr i8, i8* %0, i64 %5
br label %7
7: ; preds = %13, %3
%8 = phi i32 [ %1, %3 ], [ %14, %13 ]
%9 = phi i8* [ %0, %3 ], [ %10, %13 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = add nsw i32 %8, -1
%15 = icmp eq i32 %8, 0
br i1 %15, label %16, label %7
16: ; preds = %7, %13
%17 = phi i8* [ %10, %7 ], [ %6, %13 ]
%18 = phi i32 [ %8, %7 ], [ -1, %13 ]
store i8* %17, i8** %2
%19 = icmp slt i32 %18, 1
%20 = zext i1 %19 to i32
ret i32 %20
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};
struct stat {
  int dummy;
};

/* Variables and functions */
struct timespec get_stat_birthtime(struct stat const *st) {
  struct timespec t;
  t.tv_sec = -1;
  t.tv_nsec = -1;
  return t;
}


x86 assembly (clang, -O0):
<get_stat_birthtime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stat_birthtime>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.timespec = type { i32, i32 }
define i64 @get_stat_birthtime(%struct.stat* %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.stat*
store %struct.stat* %0, %struct.stat** %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 -1, i32* %4
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i32 -1, i32* %5
%6 = bitcast %struct.timespec* %2 to i64*
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i64 @get_stat_birthtime(%struct.stat* nocapture readnone %0) {
ret i64 -1
}
int test_imm_C5int16_mem(short *val) {
  return ((*val) & (-0xC5 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C5int16_mem>:
movzwl (%rdi),%eax
test   $0xff3b,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C5int16_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, -197
%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_C5int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -197
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t be_to_h_u24(const uint8_t *buf) {
  return (uint32_t)((uint32_t)buf[2] | (uint32_t)buf[1] << 8 |
                    (uint32_t)buf[0] << 16);
}


x86 assembly (clang, -O0):
<be_to_h_u24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_to_h_u24>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x8,%ecx
or     0x10(%rdi),%ecx
shl    $0x10,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @be_to_h_u24(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 2
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
%13 = load i64*, i64** %2
%14 = getelementptr inbounds i64, i64* %13, i64 0
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 16
%18 = or i32 %12, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @be_to_h_u24(i64* nocapture %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %4
%10 = load i64, i64* %0
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %9, %12
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ SIG_UNBLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void unblock_sig() {
  sigset_t sigs;
  sigemptyset(&sigs);
  sigaddset(&sigs, SIGALRM);
  sigprocmask(SIG_UNBLOCK, &sigs, NULL);
}


x86 assembly (clang, -O0):
<unblock_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
lea    -0x4(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unblock_sig>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1050 <sigaddset@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIGALRM = global i32 0
@SIG_UNBLOCK = global i32 0
define void @unblock_sig() {
%1 = alloca i32
%2 = call i32 @sigemptyset(i32* %1)
%3 = load i32, i32* @SIGALRM
%4 = call i32 @sigaddset(i32* %1, i32 %3)
%5 = load i32, i32* @SIG_UNBLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@SIG_UNBLOCK = global i32 0
define void @unblock_sig() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SIGALRM
%5 = call i32 @sigaddset(i32* %1, i32 %4)
%6 = load i32, i32* @SIG_UNBLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %1, i32* null)
ret void
}
void pcp_print_net_nfsd_stats(struct activity *a, int curr) {}


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

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

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

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_nfsd_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
void addvf(float *result, const float s1) {
  result[0] += s1;
  result[1] += s1;
  result[2] += s1;
}


x86 assembly (clang, -O0):
<addvf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  (%rax),%xmm0
movss  %xmm0,(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
movss  %xmm0,0x4(%rax)
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
addss  0x8(%rax),%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<addvf>:
movss  (%rdi),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rdi),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
addss  0x8(%rdi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @addvf(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
store float* %0, float** %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float*, float** %3
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = fadd float %8, %5
store float %9, float* %7
%10 = load float, float* %4
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = fadd float %13, %10
store float %14, float* %12
%15 = load float, float* %4
%16 = load float*, float** %3
%17 = getelementptr inbounds float, float* %16, i64 2
%18 = load float, float* %17
%19 = fadd float %18, %15
store float %19, float* %17
ret void
}

LLVM IR (-O2):
define void @addvf(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fadd float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fadd float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fadd float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void **);
void free2(void **a, int n1) {
  int i;
  for (i = 0; i < n1; i++)
    free(a[i]);
  free(a);
}


x86 assembly (clang, -O0):
<free2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free2+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free2+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @free2(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = bitcast i8** %8 to i8***
%10 = load i8**, i8*** %9
%11 = tail call i32 @free(i8** %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
%15 = tail call i32 @free(i8** %0)
ret void
}
__attribute__((no, noclone)) unsigned __int128 t110_2sub(unsigned char y) {
  unsigned char x = (0x7f - 1);
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t110_2sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dil,%al
mov    %al,-0x11(%rbp)
movb   $0x7e,-0x12(%rbp)
movzbl -0x12(%rbp),%eax
mov    %eax,%edx
movzbl -0x11(%rbp),%eax
xor    %ecx,%ecx
sub    %rax,%rdx
sbb    %rcx,%rcx
setb   %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    114c <t110_2sub+0x3c>
jmp    1153 <t110_2sub+0x43>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t110_2sub>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%eax
xor    %r14d,%r14d
mov    $0x7e,%ebx
sub    %rax,%rbx
sbb    %r14,%r14
jae    112d <t110_2sub+0x1d>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t110_2sub(i8 zeroext %0) {
%2 = alloca i128
%3 = alloca i8
%4 = alloca i8
%5 = alloca i128
store i8 %0, i8* %3
store i8 126, i8* %4
%6 = load i8, i8* %4
%7 = load i8, i8* %3
%8 = zext i8 %6 to i128
%9 = zext i8 %7 to i128
%10 = call { i128, i1 } @llvm.usub.with.overflow.i128(i128 %8, i128 %9)
%11 = extractvalue { i128, i1 } %10, 1
%12 = extractvalue { i128, i1 } %10, 0
store i128 %12, i128* %5
br i1 %11, label %13, label %15
13: ; preds = %1
%14 = call i32 (...) @bar()
br label %15
15: ; preds = %13, %1
%16 = load i128, i128* %5
store i128 %16, i128* %2
%17 = bitcast i128* %2 to { i64, i64 }*
%18 = load { i64, i64 }, { i64, i64 }* %17
ret { i64, i64 } %18
}

LLVM IR (-O2):
define { i64, i64 } @t110_2sub(i8 zeroext %0) {
%2 = zext i8 %0 to i128
%3 = tail call { i128, i1 } @llvm.usub.with.overflow.i128(i128 126, i128 %2)
%4 = extractvalue { i128, i1 } %3, 1
%5 = extractvalue { i128, i1 } %3, 0
br i1 %4, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @bar()
br label %8
8: ; preds = %6, %1
%9 = trunc i128 %5 to i64
%10 = lshr i128 %5, 64
%11 = trunc i128 %10 to i64
%12 = insertvalue { i64, i64 } poison, i64 %9, 0
%13 = insertvalue { i64, i64 } %12, i64 %11, 1
ret { i64, i64 } %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void shmem_float_prod_to_all(float *target, float *source, int nreduce,
                                    int PE_start, int logPE_stride, int PE_size,
                                    float *pWrk, long *pSync) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_float_prod_to_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define void @shmem_float_prod_to_all(float* %0, float* %1, i32 %2, i32 %3, i32 %4, i32 %5, float* %6, i64* %7) {
%9 = alloca float*
%10 = alloca float*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca float*
%16 = alloca i64*
store float* %0, float** %9
store float* %1, float** %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store float* %6, float** %15
store i64* %7, i64** %16
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define void @shmem_float_prod_to_all(float* nocapture readnone %0, float* nocapture readnone %1, i32 %2, i32 %3, i32 %4, i32 %5, float* nocapture readnone %6, i64* nocapture readnone %7) {
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
void update_count(int val, int *count) {
  if ((val > 2) && (val < 7)) {
    (*count)++;
  } else if (val == 10) {
    (*count)--;
  }
}


x86 assembly (clang, -O0):
<update_count>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jle    112f <update_count+0x2f>
cmpl   $0x7,-0x4(%rbp)
jge    112f <update_count+0x2f>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1149 <update_count+0x49>
cmpl   $0xa,-0x4(%rbp)
jne    1144 <update_count+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
jmp    1149 <update_count+0x49>
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_count>:
lea    -0x3(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x4,%ecx
jb     1117 <update_count+0x17>
mov    $0xffffffff,%eax
cmp    $0xa,%edi
jne    1119 <update_count+0x19>
add    %eax,(%rsi)
ret

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

LLVM IR (-O2):
define void @update_count(i32 %0, i32* nocapture %1) {
%3 = add i32 %0, -3
%4 = icmp ult i32 %3, 4
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = icmp eq i32 %0, 10
br i1 %6, label %7, label %11
7: ; preds = %5, %2
%8 = phi i32 [ 1, %2 ], [ -1, %5 ]
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %8
store i32 %10, i32* %1
br label %11
11: ; preds = %7, %5
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_size;
};
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
scalar_t__ stat(char const *const, struct stat *);
off_t lame_get_file_size(const char *const filename) {
  struct stat sb;
  if (0 == stat(filename, &sb))
    return sb.st_size;
  return (off_t)-1;
}


x86 assembly (clang, -O0):
<lame_get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    1142 <lame_get_file_size+0x32>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <lame_get_file_size+0x39>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lame_get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
neg    %rax
sbb    %eax,%eax
or     (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @lame_get_file_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
store i32 %10, i32* %2
br label %12
11: ; preds = %1
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @lame_get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 %7, i32 -1
ret i32 %8
}
/* Variables and functions */
int elevar(int);
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int n = 4;
  printf("Elevar %d: %d", n, elevar(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <elevar@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <elevar@plt>
lea    0xece(%rip),%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Elevar %d: %d\00"
define i32 @main() {
%1 = tail call i32 @elevar(i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 4, i32 %1)
ret i32 0
}
int ti_vwma_start(double const *options) { return (int)options[0] - 1; }


x86 assembly (clang, -O0):
<ti_vwma_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_vwma_start>:
cvttsd2si (%rdi),%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @ti_vwma_start(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fptosi double %5 to i32
%7 = sub nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @ti_vwma_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = add nsw i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  char *string;
  char *string_err;
  string = "a string written to standard out\n";
  write(1, string, strlen(string));
  string_err = "a string written to standard error\n";
  write(2, string_err, strlen(string_err));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
lea    0xeb9(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xedc(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"a string written to standard out\0A\00"
@.str.1 = [36 x i8] c"a string written to standard error\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8** %6
%8 = load i8*, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 1, i8* %8, i32 %10)
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %7
%14 = call i32 @strlen(i8* %13)
%15 = call i32 @write(i32 2, i8* %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"a string written to standard out\0A\00"
@.str.1 = [36 x i8] c"a string written to standard error\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(int);
void *xmalloc(int size) {
  void *p = malloc(size);
  if (!p)
    error("Out of memory");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xmalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int help_state_init(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @help_state_init() {
ret i32 0
}

LLVM IR (-O2):
define i32 @help_state_init() {
ret i32 0
}
unsigned int hashString(char *string, unsigned int modulus) {
  unsigned long hash = 0;
  char ch;
  while ((ch = *string++) != '\0') {
    hash = ch + (hash << 6) + (hash << 16) - hash;
  }
  return hash % modulus;
}


x86 assembly (clang, -O0):
<hashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     115b <hashString+0x5b>
movsbq -0x19(%rbp),%rax
mov    -0x18(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <hashString+0x13>
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <hashString+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hashString+0x10>
jmp    112d <hashString+0x2d>
xor    %eax,%eax
mov    %esi,%ecx
mov    %rax,%rdx
shr    $0x20,%rdx
je     1141 <hashString+0x41>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hashString(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i64 [ %12, %5 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %6 to i64
%11 = mul i64 %8, 65599
%12 = add i64 %11, %10
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i64 [ 0, %2 ], [ %12, %5 ]
%17 = zext i32 %1 to i64
%18 = urem i64 %16, %17
%19 = trunc i64 %18 to i32
ret i32 %19
}
/* Type definitions */
struct timespec {
  long tv_sec;
  long tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, int /*<<< orphan*/ *);
int netsim_sleep(long ms) {
  struct timespec ts = {.tv_sec = ms / 1000, .tv_nsec = ms % 1000 * 1000000};
  return nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<netsim_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3e8,%ecx
cqto
idiv   %rcx
imul   $0xf4240,%rdx,%rax
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netsim_sleep>:
sub    $0x18,%rsp
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rax,%rdx
mov    %rdx,0x8(%rsp)
imul   $0x3e8,%rdx,%rax
sub    %rax,%rdi
imul   $0xf4240,%rdi,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i32 @netsim_sleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i64, i64* %2
%6 = sdiv i64 %5, 1000
store i64 %6, i64* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i64, i64* %2
%9 = srem i64 %8, 1000
%10 = mul nsw i64 %9, 1000000
store i64 %10, i64* %7
%11 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret i32 %11
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i32 @netsim_sleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = sdiv i64 %0, 1000
store i64 %5, i64* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%7 = srem i64 %0, 1000
%8 = mul nsw i64 %7, 1000000
store i64 %8, i64* %6
%9 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret i32 %9
}
/* Variables and functions */
scalar_t__ isnan(float);
extern int TakeAFloatNaN(float x) {
  if (isnan(x))
    return 5;
  return 0;
}


x86 assembly (clang, -O0):
<TakeAFloatNaN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <isnan@plt>
cmp    $0x0,%rax
je     113d <TakeAFloatNaN+0x2d>
movl   $0x5,-0x4(%rbp)
jmp    1144 <TakeAFloatNaN+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeAFloatNaN>:
push   %rax
call   1030 <isnan@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @TakeAFloatNaN(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call i64 @isnan(float %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 5, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @TakeAFloatNaN(float %0) {
%2 = tail call i64 @isnan(float %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 5
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int32_t xori(int32_t reg1, uint16_t kte) { return (reg1 ^ kte); }


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

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

LLVM IR (-O0):
define i32 @xori(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @xori(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
void execute_geo_f() {}


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

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

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

LLVM IR (-O2):
define void @execute_geo_f() {
ret void
}
/* Variables and functions */
bool nrf52_errata_96(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_96() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_96() {
ret i32 0
}
/* Variables and functions */
bool fips_enabled_p(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @fips_enabled_p() {
ret i32 0
}

LLVM IR (-O2):
define i32 @fips_enabled_p() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void write3(FILE *f, unsigned char a, unsigned char b, unsigned char c) {
  unsigned char arr[3];
  arr[0] = a, arr[1] = b, arr[2] = c;
  fwrite(arr, 3, 1, f);
}


x86 assembly (clang, -O0):
<write3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %rdi,-0x8(%rbp)
mov    %dl,-0x9(%rbp)
mov    %cl,-0xa(%rbp)
mov    %al,-0xb(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xe(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0xd(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xc(%rbp)
lea    -0xe(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x3,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write3>:
push   %rax
mov    %rdi,%rax
mov    %sil,0x5(%rsp)
mov    %dl,0x6(%rsp)
mov    %cl,0x7(%rsp)
lea    0x5(%rsp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write3(i32* %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca [3 x i8]
store i32* %0, i32** %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8, i8* %6
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i8, i8* %7
%13 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i8, i8* %8
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 2
store i8 %14, i8* %15
%16 = getelementptr inbounds [3 x i8], [3 x i8]* %9, i64 0, i64 0
%17 = load i32*, i32** %5
%18 = call i32 @fwrite(i8* %16, i32 3, i32 1, i32* %17)
ret void
}

LLVM IR (-O2):
define void @write3(i32* nocapture %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca [3 x i8]
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %1, i8* %6
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 %2, i8* %7
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 2
store i8 %3, i8* %8
%9 = call i32 @fwrite(i8* %6, i32 3, i32 1, i32* %0)
ret void
}
void fc82(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      goto a;
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc82(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
br label %20
9: ; No predecessors!
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = load i32, i32* %2
%15 = zext i32 %14 to i64
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
%18 = load i32, i32* %2
%19 = zext i32 %18 to i64
br label %20
20: ; preds = %9, %1
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc82(i32 %0) {
ret void
}
void ff_hevc_put_hevc_bi_w_epel_v64_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_v64_10_sse4() {
ret void
}
int findNext(const char *p) {
  int i = 1;
  while (p[i] == '*')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<findNext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    1132 <findNext+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <findNext+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findNext>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x2a,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
je     1110 <findNext+0x10>
ret

LLVM IR (-O0):
define i32 @findNext(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @findNext(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 1, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 42
%7 = add nuw i64 %3, 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int main(int argc, char *argv[]) {
  int i, a = 0;
  for (i = 0; i < 10; i++)
    a += i + 0xff00ff;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1146 <main+0x46>
mov    -0x14(%rbp),%eax
add    $0xff00ff,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 167119395
}
/* Variables and functions */
float fabs(float);
float helpFindMinAbsFloat(float a, float b) {
  float aAbs = fabs(a);
  float bAbs = fabs(b);
  if (aAbs < bAbs) {
    return aAbs;
  } else {
    return bAbs;
  }
}


x86 assembly (clang, -O0):
<helpFindMinAbsFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1162 <helpFindMinAbsFloat+0x52>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116c <helpFindMinAbsFloat+0x5c>
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helpFindMinAbsFloat>:
movaps 0xef9(%rip),%xmm2
andps  %xmm2,%xmm0
andps  %xmm2,%xmm1
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @helpFindMinAbsFloat(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
%8 = load float, float* %4
%9 = call float @fabs(float %8)
store float %9, float* %6
%10 = load float, float* %5
%11 = call float @fabs(float %10)
store float %11, float* %7
%12 = load float, float* %6
%13 = load float, float* %7
%14 = fcmp olt float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = load float, float* %6
store float %16, float* %3
br label %19
17: ; preds = %2
%18 = load float, float* %7
store float %18, float* %3
br label %19
19: ; preds = %17, %15
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @helpFindMinAbsFloat(float %0, float %1) {
%3 = tail call float @llvm.fabs.f32(float %0)
%4 = tail call float @llvm.fabs.f32(float %1)
%5 = fcmp olt float %3, %4
%6 = select i1 %5, float %3, float %4
ret float %6
}
/* Variables and functions */
int _plat__WasPowerLost() { return true; }


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

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

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

LLVM IR (-O2):
define i32 @_plat__WasPowerLost() {
ret i32 1
}
void remove_newlines(char *s) {
  char *p;
  for (p = s; *p != '\0'; p++)
    if (*p == '\r' || *p == '\n')
      *p = ' ';
}


x86 assembly (clang, -O0):
<remove_newlines>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <remove_newlines+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
je     1140 <remove_newlines+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1147 <remove_newlines+0x47>
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
jmp    114c <remove_newlines+0x4c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <remove_newlines+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_newlines>:
jmp    1117 <remove_newlines+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x20,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <remove_newlines+0x10>
cmp    $0xd,%al
je     1110 <remove_newlines+0x10>
test   %al,%al
jne    1113 <remove_newlines+0x13>
ret

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

LLVM IR (-O2):
define void @remove_newlines(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 13, label %5
i8 10, label %5
]
5: ; preds = %2, %2
store i8 32, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}