xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t strlen(const char *s) {
  size_t n = 0;
  while (*s++ != '\0')
    ++n;
  return n;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ syscall(int, int *, int *);
int khits(int *requests, int *hits) { syscall(58, requests, hits); }


x86 assembly (clang, -O0):
<khits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3a,%edi
call   1030 <syscall@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<khits>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x3a,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @khits(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %4
%7 = load i32*, i32** %5
%8 = call i32 @syscall(i32 58, i32* %6, i32* %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @khits(i32* %0, i32* %1) {
%3 = tail call i32 @syscall(i32 58, i32* %0, i32* %1)
ret i32 undef
}
int shlibtest2(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @shlibtest2() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ i430hx_write(int /*<<< orphan*/, int, int,
                                int /*<<< orphan*/ *);
void i430hx_pci_reset(void) {
  i430hx_write(0, 0x59, 0x00, NULL);
  i430hx_write(0, 0x72, 0x02, NULL);
}


x86 assembly (clang, -O0):
<i430hx_pci_reset>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    $0x59,%esi
xor    %eax,%eax
mov    %eax,%ecx
mov    %edx,%edi
call   1030 <i430hx_write@plt>
xor    %edi,%edi
mov    $0x72,%esi
mov    $0x2,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <i430hx_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i430hx_pci_reset>:
push   %rax
xor    %edi,%edi
mov    $0x59,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <i430hx_write@plt>
xor    %edi,%edi
mov    $0x72,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1030 <i430hx_write@plt>

LLVM IR (-O0):
define void @i430hx_pci_reset() {
%1 = call i32 @i430hx_write(i32 0, i32 89, i32 0, i32* null)
%2 = call i32 @i430hx_write(i32 0, i32 114, i32 2, i32* null)
ret void
}

LLVM IR (-O2):
define void @i430hx_pci_reset() {
%1 = tail call i32 @i430hx_write(i32 0, i32 89, i32 0, i32* null)
%2 = tail call i32 @i430hx_write(i32 0, i32 114, i32 2, i32* null)
ret void
}
int returns_zero() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @returns_zero() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() {
  printf("Built with Hoedown "
         "1.0.0"
         ".\n");
}


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

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

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

LLVM IR (-O2):
@str = [26 x i8] c"Built with Hoedown 1.0.0.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
ret void
}
double asin(double x) { return 4; }


x86 assembly (clang, -O0):
<asin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<asin>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
store double %0, double* %2
ret double 4.000000e+00
}

LLVM IR (-O2):
define double @asin(double %0) {
ret double 4.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_add_ss(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 __attribute__((no, unused)) test(__m128 s1, __m128 s2) {
  return _mm_add_ss(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_add_ss@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_add_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct crc_config {
  int dummy;
};
struct bigint {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ bigint_load_zeros(struct bigint *);
int /*<<< orphan*/ crc_bits(struct crc_config const *, void const *,
                            int /*<<< orphan*/, int, struct bigint *);
void crc(const struct crc_config *crc, const void *msg, size_t len,
         struct bigint *checksum) {
  bigint_load_zeros(checksum);
  crc_bits(crc, msg, 0, 8 * len, checksum);
}


x86 assembly (clang, -O0):
<crc>:
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    -0x20(%rbp),%rdi
call   1040 <bigint_load_zeros@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%r8
xor    %edx,%edx
call   1030 <crc_bits@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r12
mov    %rcx,%rdi
call   1040 <bigint_load_zeros@plt>
shl    $0x3,%ebx
mov    %r12,%rdi
mov    %r15,%rsi
xor    %edx,%edx
mov    %ebx,%ecx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <crc_bits@plt>

LLVM IR (-O0):
%struct.crc_config = type { i32 }
%struct.bigint = type { i32 }
define void @crc(%struct.crc_config* %0, i8* %1, i64 %2, %struct.bigint* %3) {
%5 = alloca %struct.crc_config*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.bigint*
store %struct.crc_config* %0, %struct.crc_config** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.bigint* %3, %struct.bigint** %8
%9 = load %struct.bigint*, %struct.bigint** %8
%10 = call i32 @bigint_load_zeros(%struct.bigint* %9)
%11 = load %struct.crc_config*, %struct.crc_config** %5
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = mul i64 8, %13
%15 = trunc i64 %14 to i32
%16 = load %struct.bigint*, %struct.bigint** %8
%17 = call i32 @crc_bits(%struct.crc_config* %11, i8* %12, i32 0, i32 %15, %struct.bigint* %16)
ret void
}

LLVM IR (-O2):
%struct.crc_config = type { i32 }
%struct.bigint = type { i32 }
define void @crc(%struct.crc_config* %0, i8* %1, i64 %2, %struct.bigint* %3) {
%5 = tail call i32 @bigint_load_zeros(%struct.bigint* %3)
%6 = trunc i64 %2 to i32
%7 = shl i32 %6, 3
%8 = tail call i32 @crc_bits(%struct.crc_config* %0, i8* %1, i32 0, i32 %7, %struct.bigint* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ closedown();
void sigint(int sig) {
  sig = sig;
  closedown();
  _exit(1);
}


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <closedown@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<sigint>:
push   %rax
xor    %eax,%eax
call   1040 <closedown@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
store i32 %3, i32* %2
%4 = call i32 (...) @closedown()
%5 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @sigint(i32 %0) {
%2 = tail call i32 (...) @closedown()
%3 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int EINVAL;
int crypto_gcm_check_authsize(unsigned int authsize) {
  switch (authsize) {
  case 4:
  case 8:
  case 12:
  case 13:
  case 14:
  case 15:
  case 16:
    break;
  default:
    return -EINVAL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<crypto_gcm_check_authsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4,%eax
je     1140 <crypto_gcm_check_authsize+0x40>
jmp    111b <crypto_gcm_check_authsize+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x8,%eax
je     1140 <crypto_gcm_check_authsize+0x40>
jmp    112c <crypto_gcm_check_authsize+0x2c>
mov    -0xc(%rbp),%eax
add    $0xfffffff4,%eax
sub    $0x4,%eax
ja     1145 <crypto_gcm_check_authsize+0x45>
jmp    1140 <crypto_gcm_check_authsize+0x40>
jmp    1158 <crypto_gcm_check_authsize+0x58>
xor    %eax,%eax
mov    0x2e92(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <crypto_gcm_check_authsize+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_gcm_check_authsize>:
add    $0xfffffffc,%edi
cmp    $0xd,%edi
jae    1114 <crypto_gcm_check_authsize+0x14>
xor    %eax,%eax
mov    $0x1f11,%ecx
bt     %edi,%ecx
jb     111f <crypto_gcm_check_authsize+0x1f>
mov    0x2ec5(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @crypto_gcm_check_authsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 4, label %5
i32 8, label %5
i32 12, label %5
i32 13, label %5
i32 14, label %5
i32 15, label %5
i32 16, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1
br label %9
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
store i32 %8, i32* %2
br label %10
9: ; preds = %5
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @crypto_gcm_check_authsize(i32 %0) {
%2 = add i32 %0, -4
%3 = icmp ult i32 %2, 13
br i1 %3, label %7, label %4
4: ; preds = %7, %1
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
br label %12
7: ; preds = %1
%8 = trunc i32 %2 to i16
%9 = lshr i16 7953, %8
%10 = and i16 %9, 1
%11 = icmp eq i16 %10, 0
br i1 %11, label %4, label %12
12: ; preds = %7, %4
%13 = phi i32 [ %6, %4 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void vt100_cursor_fwd(void) {
  printf("\x1B[C");
  fflush(stdout);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[C\00"
@stdout = global i32 0
define void @vt100_cursor_fwd() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
void av_nearer_q() {}


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

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

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

LLVM IR (-O2):
define void @av_nearer_q() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mc_socket_destroy();
int /*<<< orphan*/ mc_time_destroy();
void mc_destroy(void) {
  mc_socket_destroy();
  mc_time_destroy();
}


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

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

LLVM IR (-O0):
define void @mc_destroy() {
%1 = call i32 (...) @mc_socket_destroy()
%2 = call i32 (...) @mc_time_destroy()
ret void
}

LLVM IR (-O2):
define void @mc_destroy() {
%1 = tail call i32 (...) @mc_socket_destroy()
%2 = tail call i32 (...) @mc_time_destroy()
ret void
}
void g_mem_is_system_malloc() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @hware_hand_key() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_mode(int);
int f_v99(int mode, unsigned char **sec, float *data, unsigned int ndata,
          char *inv_out, void **local) {
  set_mode(99);
  return 0;
}


x86 assembly (clang, -O0):
<f_v99>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x63,%edi
call   1030 <set_mode@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_v99>:
push   %rax
mov    $0x63,%edi
call   1030 <set_mode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f_v99(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%13 = call i32 @set_mode(i32 99)
ret i32 0
}

LLVM IR (-O2):
define i32 @f_v99(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5) {
%7 = tail call i32 @set_mode(i32 99)
ret i32 0
}
void neural_layer_upsample_update(const struct Layer *l) { (void)l; }


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

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

LLVM IR (-O0):
%struct.Layer = type opaque
define void @neural_layer_upsample_update(%struct.Layer* %0) {
%2 = alloca %struct.Layer*
store %struct.Layer* %0, %struct.Layer** %2
%3 = load %struct.Layer*, %struct.Layer** %2
ret void
}

LLVM IR (-O2):
%struct.Layer = type opaque
define void @neural_layer_upsample_update(%struct.Layer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_visual_attribs_short_header(void) {
  printf("   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  "
         "cav\n");
  printf(" id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b "
         "eat\n");
  printf("---------------------------------------------------------------------"
         "-\n");
}


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

x86 assembly (clang, -O2):
<print_visual_attribs_short_header>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
lea    0xf5c(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [71 x i8] c" visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav\0A\00"
@.str.1 = [71 x i8] c" id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat\0A\00"
@.str.2 = [72 x i8] c"----------------------------------------------------------------------\0A\00"
define void @print_visual_attribs_short_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [70 x i8] c" visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav\00"
@str.3 = [70 x i8] c" id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat\00"
@str.4 = [71 x i8] c"----------------------------------------------------------------------\00"
define void @print_visual_attribs_short_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int dd, mm, yy;
  printf("Enter a date (mm/dd/yy): ");
  scanf("%d/%d/%d", &mm, &dd, &yy);
  printf("You entered the date: %.4d/%.2d/%.2d\n", yy, mm, dd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0x14(%rsp),%ecx
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter a date (mm/dd/yy): \00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [38 x i8] c"You entered the date: %.4d/%.2d/%.2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %2, i32* %4)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter a date (mm/dd/yy): \00"
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [38 x i8] c"You entered the date: %.4d/%.2d/%.2d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %1, i32* %3)
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = load i32, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, int);
int char_index(char *str, int ch) {
  char *result = strchr(str, ch);
  int return_value = result == NULL ? -1 : (int)(result - str);
  return return_value;
}


x86 assembly (clang, -O0):
<char_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1147 <char_index+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1155 <char_index+0x45>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_index>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @char_index(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i8* @strchr(i8* %7, i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
br label %20
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = trunc i64 %18 to i32
br label %20
20: ; preds = %13, %12
%21 = phi i32 [ -1, %12 ], [ %19, %13 ]
store i32 %21, i32* %6
%22 = load i32, i32* %6
ret i32 %22
}

LLVM IR (-O2):
define i32 @char_index(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ gluPerspective(float, float, float, float);
void Perspective(float fov, float ratio, float near, float far) {
  gluPerspective(fov, ratio, near, far);
}


x86 assembly (clang, -O0):
<Perspective>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <gluPerspective@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Perspective>:
jmp    1030 <gluPerspective@plt>

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

LLVM IR (-O2):
define void @Perspective(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @gluPerspective(float %0, float %1, float %2, float %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
unsigned long sp();
int main(int argc, char **argv) {
  unsigned long esp = sp();
  printf("Stack pointer (ESP : 0x%lx)\n", esp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <sp@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sp@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Stack pointer (ESP : 0x%lx)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 (...) @sp()
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Stack pointer (ESP : 0x%lx)\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @sp()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i32 0
}
extern void prefetch(const void *ptr) { __builtin_prefetch(ptr, 0, 3); }


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

x86 assembly (clang, -O2):
<prefetch>:
prefetcht0 (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetch(i8* nocapture %0) {
tail call void @llvm.prefetch.p0i8(i8* %0, i32 0, i32 3, i32 1)
ret void
}
void ble_rsp_attributes_send(const struct ble_msg_attributes_send_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.ble_msg_attributes_send_rsp_t = type opaque
define void @ble_rsp_attributes_send(%struct.ble_msg_attributes_send_rsp_t* %0) {
%2 = alloca %struct.ble_msg_attributes_send_rsp_t*
store %struct.ble_msg_attributes_send_rsp_t* %0, %struct.ble_msg_attributes_send_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.ble_msg_attributes_send_rsp_t = type opaque
define void @ble_rsp_attributes_send(%struct.ble_msg_attributes_send_rsp_t* nocapture %0) {
ret void
}
void Em_EEPROM_Start(void) {}


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

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

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

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

/* Variables and functions */
int offset(int /*<<< orphan*/, int, int, int);
scalar_t__ owl_escape_value(int);
int autohelperowl_attackpat48(struct pattern *patt, int transformation,
                              int move, int color, int action) {
  int a;
  (void)patt;
  (void)color;
  (void)action;
  a = offset(0, 1, move, transformation);
  return owl_escape_value(a) > 0;
}


x86 assembly (clang, -O0):
<autohelperowl_attackpat48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <offset@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <owl_escape_value@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<autohelperowl_attackpat48>:
push   %rax
mov    %esi,%ecx
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <offset@plt>
mov    %eax,%edi
call   1030 <owl_escape_value@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat48(%struct.pattern* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.pattern*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store %struct.pattern* %0, %struct.pattern** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load %struct.pattern*, %struct.pattern** %6
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = load i32, i32* %7
%17 = call i32 @offset(i32 0, i32 1, i32 %15, i32 %16)
store i32 %17, i32* %11
%18 = load i32, i32* %11
%19 = call i64 @owl_escape_value(i32 %18)
%20 = icmp sgt i64 %19, 0
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
%struct.pattern = type { i32 }
define i32 @autohelperowl_attackpat48(%struct.pattern* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @offset(i32 0, i32 1, i32 %2, i32 %1)
%7 = tail call i64 @owl_escape_value(i32 %6)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ av_log(int, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void out_of_memory() {
  av_log(001, "Out of memory");
  fprintf(stderr, "Out of memory\n");
  exit(127);
}


x86 assembly (clang, -O0):
<out_of_memory>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xec0(%rip),%rsi
call   1050 <av_log@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<out_of_memory>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1050 <av_log@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7f,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"Out of memory\0A\00"
define void @out_of_memory() {
%1 = call i32 @av_log(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @exit(i32 127)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
@stderr = global i32 0
@.str.1 = [15 x i8] c"Out of memory\0A\00"
define void @out_of_memory() {
%1 = tail call i32 @av_log(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @exit(i32 127)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p434_opp(uintptr_t, uintptr_t);
void fiat_p434_opp(uint64_t out1[7], const uint64_t arg1[7]) {
  internal_fiat_p434_opp((uintptr_t)out1, (uintptr_t)arg1);
}


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

x86 assembly (clang, -O2):
<fiat_p434_opp>:
jmp    1030 <internal_fiat_p434_opp@plt>

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

LLVM IR (-O2):
define void @fiat_p434_opp(i32* %0, i32* %1) {
%3 = ptrtoint i32* %0 to i64
%4 = ptrtoint i32* %1 to i64
%5 = tail call i32 @internal_fiat_p434_opp(i64 %3, i64 %4)
ret void
}
int iupStrHasSpace(const char *str) {
  if (!str)
    return 0;
  while (*str) {
    if (*str == ' ')
      return 1;
    str++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<iupStrHasSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <iupStrHasSpace+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1165 <iupStrHasSpace+0x65>
jmp    1124 <iupStrHasSpace+0x24>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <iupStrHasSpace+0x5e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    114d <iupStrHasSpace+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1165 <iupStrHasSpace+0x65>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <iupStrHasSpace+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iupStrHasSpace>:
xor    %eax,%eax
test   %rdi,%rdi
je     1127 <iupStrHasSpace+0x27>
nopw   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
test   %cl,%cl
je     1127 <iupStrHasSpace+0x27>
cmp    $0x20,%cl
je     1122 <iupStrHasSpace+0x22>
add    $0x1,%rdi
jmp    1110 <iupStrHasSpace+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @iupStrHasSpace(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %9
i8 32, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3
br label %9
9: ; preds = %3, %8, %1
%10 = phi i32 [ 0, %1 ], [ 1, %8 ], [ 0, %3 ]
ret i32 %10
}
void push(double **a, double nr, int i) { (*a)[i] = nr; }


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x14(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
mov    (%rdi),%rax
movslq %esi,%rcx
movsd  %xmm0,(%rax,%rcx,8)
ret

LLVM IR (-O0):
define void @push(double** %0, double %1, i32 %2) {
%4 = alloca double**
%5 = alloca double
%6 = alloca i32
store double** %0, double*** %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %5
%8 = load double**, double*** %4
%9 = load double*, double** %8
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds double, double* %9, i64 %11
store double %7, double* %12
ret void
}

LLVM IR (-O2):
define void @push(double** nocapture %0, double %1, i32 %2) {
%4 = load double*, double** %0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds double, double* %4, i64 %5
store double %1, double* %6
ret void
}
void FlushCharArr(char Arr[], int Length) {
  int i;
  for (i = 0; i < Length; i++)
    Arr[i] = 0;
}


x86 assembly (clang, -O0):
<FlushCharArr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <FlushCharArr+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <FlushCharArr+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlushCharArr>:
test   %esi,%esi
jle    1122 <FlushCharArr+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @FlushCharArr(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
char isBlack(char pieceId) { return (pieceId > 50); }


x86 assembly (clang, -O0):
<isBlack>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x32,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isBlack>:
cmp    $0x33,%dil
setge  %al
ret

LLVM IR (-O0):
define signext i8 @isBlack(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sgt i32 %4, 50
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @isBlack(i8 signext %0) {
%2 = icmp sgt i8 %0, 50
%3 = zext i1 %2 to i8
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ socket_put_char(unsigned int);
void socket_put_string(unsigned string[]) {
  unsigned i;
  while (string[i]) {
    socket_put_char(string[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<socket_put_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpl   $0x0,(%rax,%rcx,4)
je     114a <socket_put_string+0x3a>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
call   1030 <socket_put_char@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111c <socket_put_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_put_string>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
test   %edi,%edi
je     1131 <socket_put_string+0x21>
nopl   0x0(%rax)
call   1030 <socket_put_char@plt>
mov    %ebp,%eax
mov    (%rbx,%rax,4),%edi
add    $0x1,%ebp
test   %edi,%edi
jne    1120 <socket_put_string+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @socket_put_string(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %11, %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %20
11: ; preds = %4
%12 = load i32*, i32** %2
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = call i32 @socket_put_char(i32 %16)
%18 = load i32, i32* %3
%19 = add i32 %18, 1
store i32 %19, i32* %3
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @socket_put_string(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ undef, %1 ]
%7 = tail call i32 @socket_put_char(i32 %5)
%8 = add i32 %6, 1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ sys_errmsg(char *);
__attribute__((unused)) void *xcalloc(size_t nmemb, size_t size) {
  void *ptr = calloc(nmemb, size);
  if (ptr == NULL && nmemb != 0 && size != 0)
    sys_errmsg("out of memory");
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116e <xcalloc+0x4e>
cmpq   $0x0,-0x8(%rbp)
je     116e <xcalloc+0x4e>
cmpq   $0x0,-0x10(%rbp)
je     116e <xcalloc+0x4e>
lea    0xe97(%rip),%rdi
call   1040 <sys_errmsg@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <calloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     114e <xcalloc+0x2e>
test   %r15,%r15
je     114e <xcalloc+0x2e>
test   %r14,%r14
jne    114e <xcalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <sys_errmsg@plt>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i64, i64* %3
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i64, i64* %4
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 @sys_errmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %14, %11, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = and i1 %5, %4
%7 = icmp ne i64 %1, 0
%8 = and i1 %7, %6
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @sys_errmsg(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void IRC_WaitEndOfMOTD() { sleep(3); }


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

x86 assembly (clang, -O2):
<IRC_WaitEndOfMOTD>:
mov    $0x3,%edi
jmp    1030 <sleep@plt>

LLVM IR (-O0):
define void @IRC_WaitEndOfMOTD() {
%1 = call i32 @sleep(i32 3)
ret void
}

LLVM IR (-O2):
define void @IRC_WaitEndOfMOTD() {
%1 = tail call i32 @sleep(i32 3)
ret void
}
void pvr_debugfs_cleanup(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @func3() {
ret void
}
int main(void) {
  int var = 0;
  while (var < 10) {
    ++var;
  }
  while (var < 20)
    ++var;
  return var;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    112f <main+0x2f>
cmpl   $0x14,-0x8(%rbp)
jge    1147 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0x2f>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *strdup(char *);
char *role_attribute_exclude_system_string(char *where) {
  char system_string[1024];
  sprintf(system_string, "select.sh '*' attribute_exclude \"%s\" none", where);
  return strdup(system_string);
}


x86 assembly (clang, -O0):
<role_attribute_exclude_system_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<role_attribute_exclude_system_string>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"select.sh '*' attribute_exclude \22%s\22 none\00"
define i8* @role_attribute_exclude_system_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [42 x i8] c"select.sh '*' attribute_exclude \22%s\22 none\00"
define noalias i8* @role_attribute_exclude_system_string(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
unsigned int sse_pfx_idx(const unsigned int pfx) {
  return ((pfx & 0xf) + 1) / 2;
}


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

x86 assembly (clang, -O2):
<sse_pfx_idx>:
and    $0xf,%edi
lea    0x1(%rdi),%eax
shr    %eax
ret

LLVM IR (-O0):
define i32 @sse_pfx_idx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
%5 = add i32 %4, 1
%6 = udiv i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
define i32 @sse_pfx_idx(i32 %0) {
%2 = and i32 %0, 15
%3 = add nuw nsw i32 %2, 1
%4 = lshr i32 %3, 1
ret i32 %4
}