xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ draw_filled_rectangle(int, int, int, int, int);
void draw_block(int y, int x, int color) {
  draw_filled_rectangle(y * 132 / 16, x * 132 / 16, 132 / 16, 132 / 16, color);
}


x86 assembly (clang, -O0):
<draw_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0x84,-0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
imul   $0x84,-0x8(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%r8d
mov    $0x8,%ecx
mov    %ecx,%edx
call   1030 <draw_filled_rectangle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_block>:
mov    %edi,%eax
shl    $0x7,%eax
lea    (%rax,%rdi,4),%ecx
lea    (%rax,%rdi,4),%edi
add    $0xf,%edi
test   %ecx,%ecx
cmovns %ecx,%edi
sar    $0x4,%edi
mov    %esi,%eax
shl    $0x7,%eax
lea    (%rax,%rsi,4),%ecx
lea    (%rax,%rsi,4),%esi
add    $0xf,%esi
test   %ecx,%ecx
cmovns %ecx,%esi
mov    %edx,%r8d
sar    $0x4,%esi
mov    $0x8,%edx
mov    $0x8,%ecx
jmp    1030 <draw_filled_rectangle@plt>

LLVM IR (-O0):
define void @draw_block(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 132
%9 = sdiv i32 %8, 16
%10 = load i32, i32* %5
%11 = mul nsw i32 %10, 132
%12 = sdiv i32 %11, 16
%13 = load i32, i32* %6
%14 = call i32 @draw_filled_rectangle(i32 %9, i32 %12, i32 8, i32 8, i32 %13)
ret void
}

LLVM IR (-O2):
define void @draw_block(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 132
%5 = sdiv i32 %4, 16
%6 = mul nsw i32 %1, 132
%7 = sdiv i32 %6, 16
%8 = tail call i32 @draw_filled_rectangle(i32 %5, i32 %7, i32 8, i32 8, i32 %2)
ret void
}
void asm_mfence(void) { __asm__ __volatile__("mfence"); }


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

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

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

LLVM IR (-O2):
define void @asm_mfence() {
tail call void asm sideeffect "mfence", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
unsigned long long int
unsignedlonglongint_ignoring_signedshortint(unsigned long long int x,
                                            signed short int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlonglongint_ignoring_signedshortint(i64 %0, i16 signext %1) {
%3 = alloca i64
%4 = alloca i16
store i64 %0, i64* %3
store i16 %1, i16* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_signedshortint(i64 returned %0, i16 signext %1) {
ret i64 %0
}
signed long fastrange(signed long argx, signed long argy) {
  signed long rs0, rs1;
  rs0 = argx;
  rs1 = argy;
  if (rs0 < 0) {
    rs0 = -rs0;
  }
  if (rs1 < 0) {
    rs1 = -rs1;
  }
  if (rs0 > rs1) {
    return rs0;
  } else {
    return rs1;
  }
}


x86 assembly (clang, -O0):
<fastrange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jge    1131 <fastrange+0x31>
xor    %eax,%eax
sub    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x28(%rbp)
jge    1146 <fastrange+0x46>
xor    %eax,%eax
sub    -0x28(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    1161 <fastrange+0x61>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <fastrange+0x69>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastrange>:
mov    %rdi,%rcx
neg    %rcx
cmovs  %rdi,%rcx
mov    %rsi,%rax
neg    %rax
cmovs  %rsi,%rax
cmp    %rax,%rcx
cmova  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @fastrange(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %4
store i64 %8, i64* %6
%9 = load i64, i64* %5
store i64 %9, i64* %7
%10 = load i64, i64* %6
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i64, i64* %6
%14 = sub nsw i64 0, %13
store i64 %14, i64* %6
br label %15
15: ; preds = %12, %2
%16 = load i64, i64* %7
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = load i64, i64* %7
%20 = sub nsw i64 0, %19
store i64 %20, i64* %7
br label %21
21: ; preds = %18, %15
%22 = load i64, i64* %6
%23 = load i64, i64* %7
%24 = icmp sgt i64 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = load i64, i64* %6
store i64 %26, i64* %3
br label %29
27: ; preds = %21
%28 = load i64, i64* %7
store i64 %28, i64* %3
br label %29
29: ; preds = %27, %25
%30 = load i64, i64* %3
ret i64 %30
}

LLVM IR (-O2):
define i64 @fastrange(i64 %0, i64 %1) {
%3 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
%4 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%5 = icmp ugt i64 %3, %4
%6 = select i1 %5, i64 %3, i64 %4
ret i64 %6
}
int test_imm_5Buint16_reg(unsigned short val) {
  return ((val) & (0x5B << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Buint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 91
%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_5Buint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 91
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ con_clear_to_bottom();
int /*<<< orphan*/ con_goto(int /*<<< orphan*/, int /*<<< orphan*/);
void con_clear(void) {
  con_goto(0, 0);
  con_clear_to_bottom();
}


x86 assembly (clang, -O0):
<con_clear>:
push   %rbp
mov    %rsp,%rbp
xor    %esi,%esi
mov    %esi,%edi
call   1030 <con_goto@plt>
mov    $0x0,%al
call   1040 <con_clear_to_bottom@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_clear>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <con_goto@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <con_clear_to_bottom@plt>

LLVM IR (-O0):
define void @con_clear() {
%1 = call i32 @con_goto(i32 0, i32 0)
%2 = call i32 (...) @con_clear_to_bottom()
ret void
}

LLVM IR (-O2):
define void @con_clear() {
%1 = tail call i32 @con_goto(i32 0, i32 0)
%2 = tail call i32 (...) @con_clear_to_bottom()
ret void
}
unsigned int bitsPerLong(void) { return sizeof(long) * 8; }


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

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

LLVM IR (-O0):
define i32 @bitsPerLong() {
ret i32 64
}

LLVM IR (-O2):
define i32 @bitsPerLong() {
ret i32 64
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_four_decimals() {
  char *str = "1234.0001";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 100000);
}


x86 assembly (clang, -O0):
<test_four_decimals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1175 <test_four_decimals+0x55>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x186a0,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_four_decimals>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"1234.0001\00"
define void @test_four_decimals() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 100000
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"1234.0001\00"
define void @test_four_decimals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_get_prop_int_array() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_get_prop_int_array"
         "\n");
}


x86 assembly (clang, -O0):
<pa_format_info_get_prop_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [51 x i8] c"NOT IMPLEMENTED:pa_format_info_get_prop_int_array\0A\00"
define i32 @pa_format_info_get_prop_int_array() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [50 x i8] c"NOT IMPLEMENTED:pa_format_info_get_prop_int_array\00"
define i32 @pa_format_info_get_prop_int_array() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void __attribute__((warning(
    "curl_easy_setopt expects a struct curl_slist* argument for this option")))
__attribute__((unused)) __attribute__((no))
_curl_easy_setopt_err_curl_slist(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_curl_slist() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int string_hash(char *, int);
unsigned verybighash(char *s) { return string_hash(s, 100003); }


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

x86 assembly (clang, -O2):
<verybighash>:
mov    $0x186a3,%esi
jmp    1030 <string_hash@plt>

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

LLVM IR (-O2):
define i32 @verybighash(i8* %0) {
%2 = tail call i32 @string_hash(i8* %0, i32 100003)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int main() {
  void *memory = malloc(8);
  free(memory);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 8)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @free(i8* %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int sl_make_server_socket_ex(char *, int, int);
int sl_make_server_socket(int port) {
  return sl_make_server_socket_ex("0.0.0.0", port, 1);
}


x86 assembly (clang, -O0):
<sl_make_server_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
mov    $0x1,%edx
call   1030 <sl_make_server_socket_ex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_make_server_socket>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
mov    $0x1,%edx
jmp    1030 <sl_make_server_socket_ex@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"0.0.0.0\00"
define i32 @sl_make_server_socket(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sl_make_server_socket_ex(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"0.0.0.0\00"
define i32 @sl_make_server_socket(i32 %0) {
%2 = tail call i32 @sl_make_server_socket_ex(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_PRIO_INHERIT;
int pthread_mutexattr_init(int /*<<< orphan*/ *);
int pthread_mutexattr_setprotocol(int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(void) {
  int ret;
  pthread_mutexattr_t mutex_attr;
  ret = pthread_mutexattr_init(&mutex_attr);
  if (ret)
    ret = pthread_mutexattr_setprotocol(&mutex_attr, PTHREAD_PRIO_INHERIT);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <pthread_mutexattr_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115a <main+0x3a>
mov    0x2e94(%rip),%rax
mov    (%rax),%esi
lea    -0xc(%rbp),%rdi
call   1040 <pthread_mutexattr_setprotocol@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <pthread_mutexattr_init@plt>
test   %eax,%eax
je     1144 <main+0x24>
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1040 <pthread_mutexattr_setprotocol@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PTHREAD_PRIO_INHERIT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @pthread_mutexattr_init(i32* %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* @PTHREAD_PRIO_INHERIT
%9 = call i32 @pthread_mutexattr_setprotocol(i32* %3, i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %0
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@PTHREAD_PRIO_INHERIT = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_mutexattr_init(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = load i32, i32* @PTHREAD_PRIO_INHERIT
%7 = call i32 @pthread_mutexattr_setprotocol(i32* %1, i32 %6)
br label %8
8: ; preds = %5, %0
%9 = phi i32 [ %7, %5 ], [ 0, %0 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ floor(int /*<<< orphan*/);
int /*<<< orphan*/ wPopNumber();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasFix() { wPushNumber(floor(wPopNumber())); }


x86 assembly (clang, -O0):
<wBasFix>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wPopNumber@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    %eax,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFix>:
push   %rax
xor    %eax,%eax
call   1040 <wPopNumber@plt>
mov    %eax,%edi
call   1050 <floor@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasFix() {
%1 = call i32 (...) @wPopNumber()
%2 = call i32 @floor(i32 %1)
%3 = call i32 @wPushNumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @wBasFix() {
%1 = tail call i32 (...) @wPopNumber()
%2 = tail call i32 @floor(i32 %1)
%3 = tail call i32 @wPushNumber(i32 %2)
ret void
}
char *cstrcat(char *s, const char *append) {
  char *save = s;
  for (; *s; ++s)
    ;
  while ((*s++ = *append++) != '\0')
    ;
  return (save);
}


x86 assembly (clang, -O0):
<cstrcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1137 <cstrcat+0x37>
jmp    1126 <cstrcat+0x26>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <cstrcat+0x14>
jmp    113c <cstrcat+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <cstrcat+0x6f>
jmp    113c <cstrcat+0x3c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cstrcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <cstrcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <cstrcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @cstrcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ get_unit_number();
int /*<<< orphan*/ test();
extern int dummy2() {
  test();
  get_unit_number();
}


x86 assembly (clang, -O0):
<dummy2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <test@plt>
mov    $0x0,%al
call   1030 <get_unit_number@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @dummy2() {
%1 = alloca i32
%2 = call i32 (...) @test()
%3 = call i32 (...) @get_unit_number()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @dummy2() {
%1 = tail call i32 (...) @test()
%2 = tail call i32 (...) @get_unit_number()
ret i32 undef
}
void eglCreatePbufferSurface(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglCreatePbufferSurface() {
ret void
}
void check_segment(char **str) {}


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

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

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

LLVM IR (-O2):
define void @check_segment(i8** nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int x27_teardown() {
  char cmd[256];
  sprintf(cmd,
          "iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags "
          "SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d",
          1);
  system(cmd);
  return 0;
}


x86 assembly (clang, -O0):
<x27_teardown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    -0x100(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x1,%edx
call   1040 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x27_teardown>:
push   %rbx
sub    $0x100,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x27_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%5 = call i32 @system(i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [106 x i8] c"iptables -D INPUT -p tcp -m multiport --sport 53,80 --tcp-flags SYN,ACK SYN,ACK -j NFQUEUE --queue-num %d\00"
define i32 @x27_teardown() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = call i32 @system(i8* %2)
ret i32 0
}
void init_secret(void) {}


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

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

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

LLVM IR (-O2):
define void @init_secret() {
ret void
}
void __attribute__((no)) HEX00_streamsInit(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @HEX00_streamsInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CmdCurArg(char *);
int strlen(int /*<<< orphan*/);
int CmdHasArg(char *arg) { return strlen(CmdCurArg(arg)); }


x86 assembly (clang, -O0):
<CmdHasArg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <CmdCurArg@plt>
mov    %eax,%edi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdHasArg>:
push   %rax
call   1040 <CmdCurArg@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @CmdHasArg(i8* %0) {
%2 = tail call i32 @CmdCurArg(i8* %0)
%3 = tail call i32 @strlen(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ exit(int);
int msgctl(int, int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int workq_destroy_(int *msqids) {
  int i;
  for (i = 0; i < 1; i++) {
    if (msgctl(msqids[i], IPC_RMID, NULL) == -1) {
      perror("msgctl");
      exit(1);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<workq_destroy_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    119c <workq_destroy_+0x6c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2e81(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <msgctl@plt>
cmp    $0xffffffff,%eax
jne    1189 <workq_destroy_+0x59>
lea    0xe86(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    118e <workq_destroy_+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <workq_destroy_+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<workq_destroy_>:
push   %rax
mov    (%rdi),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <msgctl@plt>
cmp    $0xffffffff,%eax
je     114c <workq_destroy_+0x1c>
xor    %eax,%eax
pop    %rcx
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"msgctl\00"
define i32 @workq_destroy_(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = load i32, i32* @IPC_RMID
%14 = call i32 @msgctl(i32 %12, i32 %13, i32* null)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %7
%17 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %7
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
@.str = [7 x i8] c"msgctl\00"
define i32 @workq_destroy_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = load i32, i32* @IPC_RMID
%4 = tail call i32 @msgctl(i32 %2, i32 %3, i32* null)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret i32 0
}
/* Type definitions */
struct pstat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct pstat *);
void pstat_free(struct pstat *ps) { free(ps); }


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

x86 assembly (clang, -O2):
<pstat_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.pstat = type { i32 }
define void @pstat_free(%struct.pstat* %0) {
%2 = alloca %struct.pstat*
store %struct.pstat* %0, %struct.pstat** %2
%3 = load %struct.pstat*, %struct.pstat** %2
%4 = call i32 @free(%struct.pstat* %3)
ret void
}

LLVM IR (-O2):
%struct.pstat = type { i32 }
define void @pstat_free(%struct.pstat* nocapture %0) {
%2 = tail call i32 @free(%struct.pstat* %0)
ret void
}
/* Variables and functions */
void int_swap(size_t i, size_t j, int *array) {
  int hold;
  hold = array[i];
  array[i] = array[j];
  array[j] = hold;
}


x86 assembly (clang, -O0):
<int_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @int_swap(i64 %0, i64 %1, i32* nocapture %2) {
%4 = getelementptr inbounds i32, i32* %2, i64 %0
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %2, i64 %1
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 %5, i32* %6
ret void
}
void HalfFloatRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @HalfFloatRow_NEON() {
ret void
}
/* Variables and functions */
char *my_normalize(char const *);
char *FN_normalize(const char *relpath) {
  char *tmp;
  tmp = my_normalize(relpath);
  return tmp;
}


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

x86 assembly (clang, -O2):
<FN_normalize>:
jmp    1030 <my_normalize@plt>

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

LLVM IR (-O2):
define i8* @FN_normalize(i8* %0) {
%2 = tail call i8* @my_normalize(i8* %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
void makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...) {
  __set_errno(ENOSYS);
}


x86 assembly (clang, -O0):
<makecontext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makecontext>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <__set_errno@plt>

LLVM IR (-O0):
@ENOSYS = global i32 0
define void @makecontext(i32* %0, void ()* %1, i32 %2, ...) {
%4 = alloca i32*
%5 = alloca void ()*
%6 = alloca i32
store i32* %0, i32** %4
store void ()* %1, void ()** %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret void
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define void @makecontext(i32* nocapture readnone %0, void ()* nocapture readnone %1, i32 %2, ...) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret void
}
int modulo_euclidian(int a, int b) {
  int m;
  m = a % b;
  if (m < 0)
    m = (b < 0) ? m - b : m + b;
  return m;
}


x86 assembly (clang, -O0):
<modulo_euclidian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1145 <modulo_euclidian+0x45>
cmpl   $0x0,-0x8(%rbp)
jge    1136 <modulo_euclidian+0x36>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    113f <modulo_euclidian+0x3f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo_euclidian>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
mov    %edx,%eax
sar    $0x1f,%eax
and    %ecx,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @modulo_euclidian(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = tail call i32 @llvm.abs.i32(i32 %1, i1 false)
%6 = select i1 %4, i32 %5, i32 0
%7 = add i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ fftss_cleanup_threads();
void FFTSS_CLEANUP_THREADS(void) { fftss_cleanup_threads(); }


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

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

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

LLVM IR (-O2):
define void @FFTSS_CLEANUP_THREADS() {
%1 = tail call i32 (...) @fftss_cleanup_threads()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ interrupt_handler_unregister(int);
void switch_handler_unregister(void) { interrupt_handler_unregister(32); }


x86 assembly (clang, -O0):
<switch_handler_unregister>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <interrupt_handler_unregister@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_handler_unregister>:
mov    $0x20,%edi
jmp    1030 <interrupt_handler_unregister@plt>

LLVM IR (-O0):
define void @switch_handler_unregister() {
%1 = call i32 @interrupt_handler_unregister(i32 32)
ret void
}

LLVM IR (-O2):
define void @switch_handler_unregister() {
%1 = tail call i32 @interrupt_handler_unregister(i32 32)
ret void
}
/* Variables and functions */
int s2qci();
int s2qci_() { return s2qci(); }


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

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

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

LLVM IR (-O2):
define i32 @s2qci_() {
%1 = tail call i32 (...) @s2qci()
ret i32 %1
}
/* Variables and functions */
scalar_t__ printf(char *);
void main() {
  if (printf("Hello World.")) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%rax
je     112f <main+0x1f>
jmp    112f <main+0x1f>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World.\00"
define void @main() {
%1 = call i64 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %4
4: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World.\00"
define void @main() {
%1 = tail call i64 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void RTLogPrintf(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogPrintf() {
ret void
}
/* Type definitions */
struct parsed_opr {
  int dummy;
};
struct parsed_op {
  int dummy;
};

/* Variables and functions */
char *out_src_opr(char *, size_t, struct parsed_op *, struct parsed_opr *,
                  int /*<<< orphan*/ *, int /*<<< orphan*/);
char *out_src_opr_u32(char *buf, size_t buf_size, struct parsed_op *po,
                      struct parsed_opr *popr) {
  return out_src_opr(buf, buf_size, po, popr, NULL, 0);
}


x86 assembly (clang, -O0):
<out_src_opr_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <out_src_opr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_src_opr_u32>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <out_src_opr@plt>

LLVM IR (-O0):
%struct.parsed_op = type { i32 }
%struct.parsed_opr = type { i32 }
define i8* @out_src_opr_u32(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.parsed_op*
%8 = alloca %struct.parsed_opr*
store i8* %0, i8** %5
store i64 %1, i64* %6
store %struct.parsed_op* %2, %struct.parsed_op** %7
store %struct.parsed_opr* %3, %struct.parsed_opr** %8
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = load %struct.parsed_op*, %struct.parsed_op** %7
%12 = load %struct.parsed_opr*, %struct.parsed_opr** %8
%13 = call i8* @out_src_opr(i8* %9, i64 %10, %struct.parsed_op* %11, %struct.parsed_opr* %12, i32* null, i32 0)
ret i8* %13
}

LLVM IR (-O2):
%struct.parsed_op = type { i32 }
%struct.parsed_opr = type { i32 }
define i8* @out_src_opr_u32(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3) {
%5 = tail call i8* @out_src_opr(i8* %0, i64 %1, %struct.parsed_op* %2, %struct.parsed_opr* %3, i32* null, i32 0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cleanfc(void) { printf(".fc\n"); }


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

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

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

LLVM IR (-O2):
@str = [4 x i8] c".fc\00"
define void @cleanfc() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_bi_epel_h4_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_h4_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ stderr;
int strlen(char *);
int sock_recv_string(int fd, char *dest, size_t maxlen) {
  char *err;
  int i;
  return -1;
  if (!dest)
    return -1;
  if (maxlen <= 0)
    return 0;
  for (i = 0; (size_t)i < maxlen && (read(fd, dest + i, 1) > 0); i++)
    if (dest[i] == 0 || dest[i] == '\n')
      break;
  if (err == NULL) {
    fprintf(stderr, "sock_recv_string: socket read error\n");
    return -1;
  }
  printf("sock_recv_string: Got message \"%s\"\n", dest);
  return strlen(dest);
}


x86 assembly (clang, -O0):
<sock_recv_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
define i32 @sock_recv_string(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
define i32 @sock_recv_string(i32 %0, i8* nocapture readnone %1, i64 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ karma_add_name(char const *);
void karma_join(const char *chan, const char *name) { karma_add_name(name); }


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

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

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

LLVM IR (-O2):
define void @karma_join(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @karma_add_name(i8* %1)
ret void
}
/* Variables and functions */
int strlen(char const *);
int url2int(const char *url) {
  int h = 0, i = 0;
  for (i = 0; i < strlen(url); i++) {
    h = 31 * h + url[i];
  }
  return h;
}


x86 assembly (clang, -O0):
<url2int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jge    1170 <url2int+0x60>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1131 <url2int+0x21>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<url2int>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1153 <url2int+0x43>
xor    %ebx,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%eax
shl    $0x5,%eax
sub    %ebp,%eax
movsbl (%r14,%rbx,1),%ebp
add    %eax,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1130 <url2int+0x20>
jmp    1155 <url2int+0x45>
xor    %ebp,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @url2int(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %16
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = mul nsw i32 %6, 31
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = add nsw i32 %7, %10
%12 = add nuw nsw i64 %5, 1
%13 = tail call i32 @strlen(i8* %0)
%14 = sext i32 %13 to i64
%15 = icmp slt i64 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
INSTRUCTION(l_cust4) {}


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

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

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

LLVM IR (-O2):
define i32 @INSTRUCTION(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(char *, char *, int);
int /*<<< orphan*/ clang_analyzer_eval(int);
void bcopy0() {
  char src[] = {1, 2, 3, 4};
  char dst[4] = {0};
  bcopy(src, dst, 4);
  clang_analyzer_eval(dst[0] != 0);
}


x86 assembly (clang, -O0):
<bcopy0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xec2(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <bcopy@plt>
movsbl -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcopy0>:
mov    $0x1,%edi
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@__const.bcopy0.src = [4 x i8] c"\01\02\03\04"
define void @bcopy0() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i32 @bcopy(i8* %5, i8* %6, i32 4)
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @clang_analyzer_eval(i32 %12)
ret void
}

LLVM IR (-O2):
define void @bcopy0() {
%1 = tail call i32 @clang_analyzer_eval(i32 1)
ret void
}
void func_ok(int arr[10]) { arr[9] = 42; }


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

x86 assembly (clang, -O2):
<func_ok>:
movl   $0x2a,0x24(%rdi)
ret

LLVM IR (-O0):
define void @func_ok(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 9
store i32 42, i32* %4
ret void
}

LLVM IR (-O2):
define void @func_ok(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
store i32 42, i32* %2
ret void
}