xunge/DecIR huggingface dataset:
/* Variables and functions */
char toupper(unsigned char);
void capitalizeBuffer(char *buffer) {
  do {
    *buffer = toupper((unsigned char)*buffer);
  } while (*buffer++);
}


x86 assembly (clang, -O0):
<capitalizeBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    111c <capitalizeBuffer+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capitalizeBuffer>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <capitalizeBuffer+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @capitalizeBuffer(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @toupper(i8 zeroext %4)
store i8 %5, i8* %3
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = icmp eq i8 %5, 0
br i1 %7, label %8, label %2
8: ; preds = %2
ret void
}
int test_imm_D6uint8_reg(unsigned char val) {
  return ((val) & (-0xD6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D6uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff2a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_D6uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -214
%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_D6uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 42
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void fn_reset(void *data) {
  unsigned int *tmp = (unsigned int *)data;
  *tmp = 0;
  return;
}


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

x86 assembly (clang, -O2):
<fn_reset>:
movl   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @fn_reset(i8* nocapture writeonly %0) {
%2 = bitcast i8* %0 to i32*
store i32 0, i32* %2
ret void
}
/* Variables and functions */
long LONG_MAX;
long size_to_long(const size_t x) {
  return (x > (unsigned long)LONG_MAX) ? LONG_MAX : (long)x;
}


x86 assembly (clang, -O0):
<size_to_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%rax
jbe    112f <size_to_long+0x2f>
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <size_to_long+0x37>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_to_long>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
cmovae %rdi,%rax
ret

LLVM IR (-O0):
@LONG_MAX = global i64 0
define i64 @size_to_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @LONG_MAX
%5 = icmp ugt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i64, i64* @LONG_MAX
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %6
%11 = phi i64 [ %7, %6 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
@LONG_MAX = global i64 0
define i64 @size_to_long(i64 %0) {
%2 = load i64, i64* @LONG_MAX
%3 = icmp ult i64 %2, %0
%4 = select i1 %3, i64 %2, i64 %0
ret i64 %4
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t signum_i64(int64_t i) {
  if (i > 0)
    return 1;
  if (i < 0)
    return (-1);
  return 0;
}


x86 assembly (clang, -O0):
<signum_i64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1120 <signum_i64+0x20>
movq   $0x1,-0x8(%rbp)
jmp    1140 <signum_i64+0x40>
cmpq   $0x0,-0x10(%rbp)
jge    1138 <signum_i64+0x38>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1140 <signum_i64+0x40>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_i64>:
mov    %rdi,%rcx
sar    $0x3f,%rcx
test   %rdi,%rdi
mov    $0x1,%eax
cmovle %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @signum_i64(i64 %0) {
%2 = ashr i64 %0, 63
%3 = icmp slt i64 %0, 1
%4 = select i1 %3, i64 %2, i64 1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void die_with_error(const char *msg) {
  perror(msg);
  exit(1);
}


x86 assembly (clang, -O0):
<die_with_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die_with_error>:
push   %rax
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @die_with_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die_with_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ argv;

/* Variables and functions */
int /*<<< orphan*/ fileToArray(char *);
int /*<<< orphan*/ printSortedArray();
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ threadUp();
int main(int argc, char *argv[]) {
  char fileName[sizeof(argv[1])];
  strcpy(fileName, argv[1]);
  fileToArray(fileName);
  threadUp();
  printSortedArray();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <strcpy@plt>
lea    -0x18(%rbp),%rdi
call   1060 <fileToArray@plt>
mov    $0x0,%al
call   1050 <threadUp@plt>
mov    $0x0,%al
call   1040 <printSortedArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    0x8(%rsi),%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <fileToArray@plt>
xor    %eax,%eax
call   1050 <threadUp@plt>
xor    %eax,%eax
call   1040 <printSortedArray@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [8 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @strcpy(i8* %6, i8* %9)
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%12 = call i32 @fileToArray(i8* %11)
%13 = call i32 (...) @threadUp()
%14 = call i32 (...) @printSortedArray()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [8 x i8]
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %4, i8* %6)
%8 = call i32 @fileToArray(i8* %4)
%9 = call i32 (...) @threadUp()
%10 = call i32 (...) @printSortedArray()
ret i32 0
}
int test_01(unsigned char *x, int y, int z) {
  return (x[0] << 3) & 192 ? y : z;
}


x86 assembly (clang, -O0):
<test_01>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x3,%eax
and    $0xc0,%eax
cmp    $0x0,%eax
je     1131 <test_01+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <test_01+0x37>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_01>:
mov    %esi,%eax
testb  $0x18,(%rdi)
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_01(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, 24
%6 = icmp eq i8 %5, 0
%7 = select i1 %6, i32 %2, i32 %1
ret i32 %7
}
void ff_hevc_put_hevc_bi_w_epel_hv4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_hv4_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
int /*<<< orphan*/ stderr;
__attribute__((visibility("default"))) void srandom(unsigned int seed) {
  fprintf(stderr, "Ignoring random seed: %u\n", seed);
}


x86 assembly (clang, -O0):
<srandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srandom>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Ignoring random seed: %u\0A\00"
define void @srandom(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 ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Ignoring random seed: %u\0A\00"
define void @srandom(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
long double fmod(double, double);
__attribute__((weak)) long double fmodl(long double x, long double y) {
  return fmod((double)x, (double)y);
}


x86 assembly (clang, -O0):
<fmodl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
fldt   -0x20(%rbp)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm1
call   1030 <fmod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodl>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fstpl  -0x8(%rsp)
movsd  -0x8(%rsp),%xmm0
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm1
jmp    1030 <fmod@plt>

LLVM IR (-O0):
define weak x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = fptrunc x86_fp80 %5 to double
%7 = load x86_fp80, x86_fp80* %4
%8 = fptrunc x86_fp80 %7 to double
%9 = call x86_fp80 @fmod(double %6, double %8)
ret x86_fp80 %9
}

LLVM IR (-O2):
define weak x86_fp80 @fmodl(x86_fp80 %0, x86_fp80 %1) {
%3 = fptrunc x86_fp80 %0 to double
%4 = fptrunc x86_fp80 %1 to double
%5 = tail call x86_fp80 @fmod(double %3, double %4)
ret x86_fp80 %5
}
main() {
  int true = 1;
#pragma omp parallel for
  while (true) {
    true = 0;
  }
  printf("err_parallel_for 002 : FAILED, can not compile this program.\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     113c <main+0x2c>
movl   $0x0,-0x8(%rbp)
jmp    1126 <main+0x16>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"err_parallel_for 002 : FAILED, can not compile this program.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 0, i32* %2
br label %3
7: ; preds = %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [61 x i8] c"err_parallel_for 002 : FAILED, can not compile this program.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void atomic_store_n_unsigned_int(unsigned int *ptr, unsigned int val,
                                 int memorder) {
  __atomic_store_n(ptr, val, memorder);
}


x86 assembly (clang, -O0):
<atomic_store_n_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x3,%eax
je     114f <atomic_store_n_unsigned_int+0x4f>
jmp    1130 <atomic_store_n_unsigned_int+0x30>
mov    -0x18(%rbp),%eax
sub    $0x5,%eax
je     115d <atomic_store_n_unsigned_int+0x5d>
jmp    1141 <atomic_store_n_unsigned_int+0x41>
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,(%rax)
jmp    1166 <atomic_store_n_unsigned_int+0x66>
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,(%rax)
jmp    1166 <atomic_store_n_unsigned_int+0x66>
mov    -0x20(%rbp),%rcx
mov    -0x14(%rbp),%eax
xchg   %eax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_store_n_unsigned_int>:
cmp    $0x3,%edx
je     110d <atomic_store_n_unsigned_int+0xd>
cmp    $0x5,%edx
jne    110d <atomic_store_n_unsigned_int+0xd>
xchg   %esi,(%rdi)
ret
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @atomic_store_n_unsigned_int(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %6
%10 = load i32, i32* %5
store i32 %10, i32* %7
switch i32 %9, label %11 [
i32 3, label %13
i32 5, label %15
]
11: ; preds = %3
%12 = load i32, i32* %7
store atomic i32 %12, i32* %8 monotonic
br label %17
13: ; preds = %3
%14 = load i32, i32* %7
store atomic i32 %14, i32* %8 release
br label %17
15: ; preds = %3
%16 = load i32, i32* %7
store atomic i32 %16, i32* %8 seq_cst
br label %17
17: ; preds = %15, %13, %11
ret void
}

LLVM IR (-O2):
define void @atomic_store_n_unsigned_int(i32* nocapture writeonly %0, i32 %1, i32 %2) {
switch i32 %2, label %4 [
i32 3, label %5
i32 5, label %6
]
4: ; preds = %3
store atomic i32 %1, i32* %0 monotonic
br label %7
5: ; preds = %3
store atomic i32 %1, i32* %0 release
br label %7
6: ; preds = %3
store atomic i32 %1, i32* %0 seq_cst
br label %7
7: ; preds = %6, %5, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
void destroy_routine(void *value) {
  printf("destory ...\n");
  free(value);
}


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

x86 assembly (clang, -O2):
<destroy_routine>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@str = [12 x i8] c"destory ...\00"
define void @destroy_routine(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drawstring(double, double, double, char *);
int /*<<< orphan*/ glColor3f(double, double, int);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutSwapBuffers();
void title() {
  glColor3f(0.0, 0.0, 1.0);
  drawstring(1.0, 1.7, 0.1, "Graphical Implementation of Particle Movement");
  glColor3f(0.0, 0.0, 1);
  glFlush();
  glutSwapBuffers();
}


x86 assembly (clang, -O0):
<title>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm1,%xmm1
mov    $0x1,%edi
movaps %xmm1,%xmm0
call   1040 <glColor3f@plt>
movsd  0xea4(%rip),%xmm0
movsd  0xea4(%rip),%xmm1
movsd  0xea4(%rip),%xmm2
lea    0xea5(%rip),%rdi
call   1060 <drawstring@plt>
xorps  %xmm1,%xmm1
mov    $0x1,%edi
movaps %xmm1,%xmm0
call   1040 <glColor3f@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
mov    $0x0,%al
call   1030 <glutSwapBuffers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<title>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%edi
call   1040 <glColor3f@plt>
lea    0xec0(%rip),%rdi
movsd  0xea0(%rip),%xmm0
movsd  0xea0(%rip),%xmm1
movsd  0xea0(%rip),%xmm2
call   1060 <drawstring@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
mov    $0x1,%edi
call   1040 <glColor3f@plt>
xor    %eax,%eax
call   1050 <glFlush@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glutSwapBuffers@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Graphical Implementation of Particle Movement\00"
define void @title() {
%1 = call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, i32 1)
%2 = call i32 @drawstring(double 1.000000e+00, double 1.700000e+00, double 1.000000e-01, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, i32 1)
%4 = call i32 (...) @glFlush()
%5 = call i32 (...) @glutSwapBuffers()
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"Graphical Implementation of Particle Movement\00"
define void @title() {
%1 = tail call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, i32 1)
%2 = tail call i32 @drawstring(double 1.000000e+00, double 1.700000e+00, double 1.000000e-01, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @glColor3f(double 0.000000e+00, double 0.000000e+00, i32 1)
%4 = tail call i32 (...) @glFlush()
%5 = tail call i32 (...) @glutSwapBuffers()
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
scalar_t__ is_prime_number(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  int count = 1000;
  for (i = 2; i <= count; i++) {
    if (is_prime_number(i))
      printf("%d\n", i);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     117d <main+0x5d>
mov    -0x8(%rbp),%edi
call   1040 <is_prime_number@plt>
cmp    $0x0,%rax
je     116a <main+0x4a>
mov    -0x8(%rbp),%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x4f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    0x2e5c(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xed0(%rip),%r14
jmp    114b <main+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebx
cmp    $0x3e9,%ebx
je     1163 <main+0x43>
mov    %ebx,%edi
call   1040 <is_prime_number@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
mov    0x2e76(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1000, i32* %3
store i32 2, i32* %2
br label %4
4: ; preds = %16, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp sle i32 %5, %6
br i1 %7, label %8, label %19
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i64 @is_prime_number(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %4
19: ; preds = %4
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 2, %0 ], [ %8, %7 ]
%3 = tail call i64 @is_prime_number(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 1001
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
unsigned long convert_ns_to_timer(unsigned long ns) { return 24 * ns / 1000; }


x86 assembly (clang, -O0):
<convert_ns_to_timer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x18,-0x8(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_ns_to_timer>:
shl    $0x3,%rdi
lea    (%rdi,%rdi,2),%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
mov    %rdx,%rax
shr    $0x4,%rax
ret

LLVM IR (-O0):
define i64 @convert_ns_to_timer(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 24, %3
%5 = udiv i64 %4, 1000
ret i64 %5
}

LLVM IR (-O2):
define i64 @convert_ns_to_timer(i64 %0) {
%2 = mul i64 %0, 24
%3 = udiv i64 %2, 1000
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("Yeah !\n"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Yeah !\0A\00"
define void @test() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Yeah !\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ log_f(char *);
void soundb_none_done(void) { log_f("sound: soundb_none_done()\n"); }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"sound: soundb_none_done()\0A\00"
define void @soundb_none_done() {
%1 = call i32 @log_f(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"sound: soundb_none_done()\0A\00"
define void @soundb_none_done() {
%1 = tail call i32 @log_f(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ delay_uart_bit();
int /*<<< orphan*/ uart_out(int /*<<< orphan*/);
void put_bit(bool high) {
  uart_out(0);
  delay_uart_bit();
}


x86 assembly (clang, -O0):
<put_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1040 <uart_out@plt>
mov    $0x0,%al
call   1030 <delay_uart_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_bit>:
push   %rax
xor    %edi,%edi
call   1040 <uart_out@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <delay_uart_bit@plt>

LLVM IR (-O0):
define void @put_bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @uart_out(i32 0)
%4 = call i32 (...) @delay_uart_bit()
ret void
}

LLVM IR (-O2):
define void @put_bit(i32 %0) {
%2 = tail call i32 @uart_out(i32 0)
%3 = tail call i32 (...) @delay_uart_bit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *cmd) {
  printf("Byte Write\n\n");
  printf("Usage: %s [-a] <filename>\n\n", cmd);
  printf("  -a Append to file (DEFAULT: Overwrite)\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Byte Write\0A\0A\00"
@.str.1 = [28 x i8] c"Usage: %s [-a] <filename>\0A\0A\00"
@.str.2 = [42 x i8] c" -a Append to file (DEFAULT: Overwrite)\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [28 x i8] c"Usage: %s [-a] <filename>\0A\0A\00"
@str = [12 x i8] c"Byte Write\0A\00"
@str.3 = [41 x i8] c" -a Append to file (DEFAULT: Overwrite)\00"
define void @usage(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
}
int _DlClose_(void *handle) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @_DlClose_(i8* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int gca_cmp_uint32(const void *aa, const void *bb) {
  const uint32_t a = *(const uint32_t *)aa;
  const uint32_t b = *(const uint32_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp_uint32>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp_uint32(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = icmp sgt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_cmp_uint32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ kill_processes(char const *);
int main(int argc, const char *argv[]) {
  kill_processes(argv[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <kill_processes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1030 <kill_processes@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @kill_processes(i8* %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @kill_processes(i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MIDI_SetLoopFlag(int);
void MUSIC_SetLoopFlag(int loopflag) { MIDI_SetLoopFlag(loopflag); }


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

x86 assembly (clang, -O2):
<MUSIC_SetLoopFlag>:
jmp    1030 <MIDI_SetLoopFlag@plt>

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

LLVM IR (-O2):
define void @MUSIC_SetLoopFlag(i32 %0) {
%2 = tail call i32 @MIDI_SetLoopFlag(i32 %0)
ret void
}
void pldebug(const char *label, ...) { (void)label; }


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

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

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

LLVM IR (-O2):
define void @pldebug(i8* nocapture %0, ...) {
ret void
}
int test_imm_B9uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xB9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B9uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 185
%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_B9uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 185
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
double f2d(float a) { return (double)a; }


x86 assembly (clang, -O0):
<f2d>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2d>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @f2d(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
ret double %4
}

LLVM IR (-O2):
define double @f2d(float %0) {
%2 = fpext float %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void kfree(const void *objp) {
  if (!objp)
    return;
  free((void *)objp);
}


x86 assembly (clang, -O0):
<kfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <kfree+0x1c>
jmp    1135 <kfree+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @kfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %1, %3
ret void
}
char *XSharpGetResources(void *dpy, unsigned long root) { return 0; }


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

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

LLVM IR (-O0):
define i8* @XSharpGetResources(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @XSharpGetResources(i8* nocapture readnone %0, i64 %1) {
ret i8* null
}
void setPrevContext(int *context, int *prev) { *(context + 1) = (int)prev; }


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

x86 assembly (clang, -O2):
<setPrevContext>:
mov    %esi,0x4(%rdi)
ret

LLVM IR (-O0):
define void @setPrevContext(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = ptrtoint i32* %5 to i32
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @setPrevContext(i32* nocapture writeonly %0, i32* %1) {
%3 = ptrtoint i32* %1 to i64
%4 = trunc i64 %3 to i32
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
ret void
}
void NV12ToRGB565Row_NEON() {}


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

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

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

LLVM IR (-O2):
define void @NV12ToRGB565Row_NEON() {
ret void
}
/* Variables and functions */
int get_int(int /*<<< orphan*/ *);
int GetInt(void) { return get_int(NULL); }


x86 assembly (clang, -O0):
<GetInt>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <get_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetInt>:
xor    %edi,%edi
jmp    1030 <get_int@plt>

LLVM IR (-O0):
define i32 @GetInt() {
%1 = call i32 @get_int(i32* null)
ret i32 %1
}

LLVM IR (-O2):
define i32 @GetInt() {
%1 = tail call i32 @get_int(i32* null)
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t setbits(uint32_t value, uint8_t position, uint8_t no_bits,
                 uint32_t val2) {
  return value & ~(~(~0 << no_bits) << (position + 1 - no_bits)) |
         (val2 & ~(~0 << no_bits)) << (position + 1 - no_bits);
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%esi
shl    %cl,%esi
mov    %esi,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%edx
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%r8d
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
sub    %edx,%esi
lea    0x1(%rsi),%ecx
mov    %eax,%edx
shl    %cl,%edx
not    %edx
and    %edi,%edx
and    %r8d,%eax
shl    %cl,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbits(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* %7
%11 = shl i32 -1, %10
%12 = xor i32 %11, -1
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = load i32, i32* %7
%16 = sub nsw i32 %14, %15
%17 = shl i32 %12, %16
%18 = xor i32 %17, -1
%19 = and i32 %9, %18
%20 = load i32, i32* %8
%21 = load i32, i32* %7
%22 = shl i32 -1, %21
%23 = xor i32 %22, -1
%24 = and i32 %20, %23
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
%27 = load i32, i32* %7
%28 = sub nsw i32 %26, %27
%29 = shl i32 %24, %28
%30 = or i32 %19, %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = add nsw i32 %1, 1
%8 = sub i32 %7, %2
%9 = shl i32 %6, %8
%10 = xor i32 %9, -1
%11 = and i32 %10, %0
%12 = and i32 %6, %3
%13 = shl i32 %12, %8
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void isay(int i) {
  printf("%d ", i);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<isay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isay>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
@stdout = global i32 0
define void @isay(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  exit(7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 7)
unreachable
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 7)
unreachable
}
/* Variables and functions */
int natstrcompare(char const *, char const *, int /*<<< orphan*/);
int natstrcmp(const char *str1, const char *str2) {
  return natstrcompare(str1, str2, 0);
}


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

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

LLVM IR (-O0):
define i32 @natstrcmp(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 i32 @natstrcompare(i8* %5, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @natstrcmp(i8* %0, i8* %1) {
%3 = tail call i32 @natstrcompare(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ move_X(int);
void Xmove(int dir, unsigned int Nsteps) {
  if (Nsteps == 0) {
    move_X(dir);
  } else {
  }
}


x86 assembly (clang, -O0):
<Xmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1135 <Xmove+0x25>
mov    -0x4(%rbp),%edi
call   1030 <move_X@plt>
jmp    113a <Xmove+0x2a>
jmp    113a <Xmove+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xmove>:
test   %esi,%esi
je     1115 <Xmove+0x5>
ret
jmp    1030 <move_X@plt>

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

LLVM IR (-O2):
define void @Xmove(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @move_X(i32 %0)
br label %6
6: ; preds = %2, %4
ret void
}
/* Variables and functions */
unsigned short JOY_waitPressTime(int, int, unsigned short);
unsigned short JOY_waitPressBtnTime(unsigned short time) {
  return JOY_waitPressTime(0xFFFF, 0x0FF0, time);
}


x86 assembly (clang, -O0):
<JOY_waitPressBtnTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0xffff,%edi
mov    $0xff0,%esi
movzwl -0x2(%rbp),%edx
call   1030 <JOY_waitPressTime@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<JOY_waitPressBtnTime>:
mov    %edi,%edx
mov    $0xffff,%edi
mov    $0xff0,%esi
jmp    1030 <JOY_waitPressTime@plt>

LLVM IR (-O0):
define zeroext i16 @JOY_waitPressBtnTime(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @JOY_waitPressTime(i32 65535, i32 4080, i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @JOY_waitPressBtnTime(i16 zeroext %0) {
%2 = tail call zeroext i16 @JOY_waitPressTime(i32 65535, i32 4080, i16 zeroext %0)
ret i16 %2
}
int Cyc_List_ptrequal(void *x, void *y) {
  int _T0;
  int _T1;
  _T0 = x == y;
  _T1 = !_T0;
  return _T1;
}


x86 assembly (clang, -O0):
<Cyc_List_ptrequal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_List_ptrequal>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @Cyc_List_ptrequal(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 = load i8*, i8** %4
%9 = icmp eq i8* %7, %8
%10 = zext i1 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @Cyc_List_ptrequal(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int random();
int rand_num(int range) { return (range == 0 ? 0 : random() % range); }


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <rand_num+0x1f>
xor    %edx,%edx
mov    %edx,-0x8(%rbp)
jmp    113d <rand_num+0x2d>
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
test   %edi,%edi
je     1125 <rand_num+0x15>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rand_num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = call i32 (...) @random()
%8 = load i32, i32* %2
%9 = srem i32 %7, %8
br label %10
10: ; preds = %6, %5
%11 = phi i32 [ 0, %5 ], [ %9, %6 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @rand_num(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @random()
%5 = srem i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
void pthread_attr_setstacksize() {}


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

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

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

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