xunge/DecIR huggingface dataset:
/* Type definitions */
struct cache_queue_policy_ {
  int dummy;
};
struct cache_policy_ {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_cache_queue_policy(struct cache_queue_policy_ *);
void destroy_cache_lru_policy(struct cache_policy_ *policy) {
  struct cache_queue_policy_ *queue_policy;
  (void)0;
  queue_policy = (struct cache_queue_policy_ *)policy;
  destroy_cache_queue_policy(queue_policy);
  (void)0;
}


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

x86 assembly (clang, -O2):
<destroy_cache_lru_policy>:
jmp    1030 <destroy_cache_queue_policy@plt>

LLVM IR (-O0):
%struct.cache_policy_ = type { i32 }
%struct.cache_queue_policy_ = type { i32 }
define void @destroy_cache_lru_policy(%struct.cache_policy_* %0) {
%2 = alloca %struct.cache_policy_*
%3 = alloca %struct.cache_queue_policy_*
store %struct.cache_policy_* %0, %struct.cache_policy_** %2
%4 = load %struct.cache_policy_*, %struct.cache_policy_** %2
%5 = bitcast %struct.cache_policy_* %4 to %struct.cache_queue_policy_*
store %struct.cache_queue_policy_* %5, %struct.cache_queue_policy_** %3
%6 = load %struct.cache_queue_policy_*, %struct.cache_queue_policy_** %3
%7 = call i32 @destroy_cache_queue_policy(%struct.cache_queue_policy_* %6)
ret void
}

LLVM IR (-O2):
%struct.cache_policy_ = type { i32 }
%struct.cache_queue_policy_ = type { i32 }
define void @destroy_cache_lru_policy(%struct.cache_policy_* %0) {
%2 = bitcast %struct.cache_policy_* %0 to %struct.cache_queue_policy_*
%3 = tail call i32 @destroy_cache_queue_policy(%struct.cache_queue_policy_* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ mode;
};
typedef TYPE_1__ XEnterWindowEvent;

/* Variables and functions */
int get_XEnterWindowEvent_mode(void *_p) {
  return (int)((XEnterWindowEvent *)_p)->mode;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEnterWindowEvent_mode(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *calloc(size_t count, size_t size) {
  void *block = malloc(count * size);
  if (block != NULL) {
    memset(block, 0, count * size);
  }
  return block;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <calloc+0x41>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <calloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(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 = mul i64 %6, %7
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
%17 = call i32 @memset(i8* %13, i32 0, i64 %16)
br label %18
18: ; preds = %12, %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
unsigned int fastUnsignedPower10(int power) {
  static unsigned int powers[10] = {1,         10,        100,     1000,
                                    10000,     100000,    1000000, 10000000,
                                    100000000, 1000000000};
  return powers[power];
}


x86 assembly (clang, -O0):
<fastUnsignedPower10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
lea    0x2f1e(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastUnsignedPower10>:
movslq %edi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@fastUnsignedPower10.powers = internal global [10 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000]
define i32 @fastUnsignedPower10(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [10 x i32], [10 x i32]* @fastUnsignedPower10.powers, i64 0, i64 %4
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
@fastUnsignedPower10.powers = internal unnamed_addr constant [10 x i32] [i32 1, i32 10, i32 100, i32 1000, i32 10000, i32 100000, i32 1000000, i32 10000000, i32 100000000, i32 1000000000]
define i32 @fastUnsignedPower10(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [10 x i32], [10 x i32]* @fastUnsignedPower10.powers, i64 0, i64 %2
%4 = load i32, i32* %3
ret i32 %4
}
int test_imm_AFint8_mem(signed char *val) {
  return ((*val) & (0xAF << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AFint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 175
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_AFint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -81
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
int sarwaitbar_update(int percent) {
  printf("\r%d.000000", percent);
  fflush(stdout);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"\0D%d.000000\00"
@stdout = global i32 0
define i32 @sarwaitbar_update(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret i32 0
}
int fun984() { return 984; }


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

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

LLVM IR (-O0):
define i32 @fun984() {
ret i32 984
}

LLVM IR (-O2):
define i32 @fun984() {
ret i32 984
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ printf(char *);
void keycontrol(int sig) {
  if (sig == SIGINT)
    printf("\nCTRL+C pressed\n");
}


x86 assembly (clang, -O0):
<keycontrol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <keycontrol+0x29>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keycontrol>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <keycontrol+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [17 x i8] c"\0ACTRL+C pressed\0A\00"
define void @keycontrol(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [16 x i8] c"\0ACTRL+C pressed\00"
define void @keycontrol(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int mktime(struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int MySAR_current_time() {
  struct tm ntime;
  time_t set;
  time(&set);
  ntime = *localtime(&set);
  return mktime(&ntime);
}


x86 assembly (clang, -O0):
<MySAR_current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <mktime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MySAR_current_time>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
mov    (%rax),%eax
mov    %eax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <mktime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @MySAR_current_time() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = call i32 @time(i32* %2)
%4 = call %struct.tm* @localtime(i32* %2)
%5 = bitcast %struct.tm* %1 to i8*
%6 = bitcast %struct.tm* %4 to i8*
%7 = call i32 @mktime(%struct.tm* %1)
ret i32 %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @MySAR_current_time() {
%1 = alloca %struct.tm
%2 = alloca i32
%3 = bitcast %struct.tm* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @time(i32* %2)
%6 = call %struct.tm* @localtime(i32* %2)
%7 = getelementptr %struct.tm, %struct.tm* %6, i64 0, i32 0
%8 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%9 = load i32, i32* %7
store i32 %9, i32* %8
%10 = call i32 @mktime(%struct.tm* %1)
ret i32 %10
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int bit_ctz_general(unsigned int v) {
  static const int MultiplyDeBruijnBitPosition[32] = {
      0,  1,  28, 2,  29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4,  8,
      31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6,  11, 5,  10, 9};
  return MultiplyDeBruijnBitPosition[((uint32_t)((v & -(int)v) *
                                                 0x077CB531U)) >>
                                     27];
}


x86 assembly (clang, -O0):
<bit_ctz_general>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x4(%rbp),%ecx
and    %ecx,%eax
imul   $0x77cb531,%eax,%eax
sar    $0x1b,%eax
movslq %eax,%rcx
lea    0xedc(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_ctz_general>:
mov    %edi,%eax
neg    %eax
and    %edi,%eax
imul   $0x77cb531,%eax,%eax
sar    $0x1b,%eax
cltq
lea    0xee8(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@bit_ctz_general.MultiplyDeBruijnBitPosition = internal constant [32 x i32] [i32 0, i32 1, i32 28, i32 2, i32 29, i32 14, i32 24, i32 3, i32 30, i32 22, i32 20, i32 15, i32 25, i32 17, i32 4, i32 8, i32 31, i32 27, i32 13, i32 23, i32 21, i32 19, i32 16, i32 7, i32 26, i32 12, i32 18, i32 6, i32 11, i32 5, i32 10, i32 9]
define i32 @bit_ctz_general(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 0, %4
%6 = and i32 %3, %5
%7 = mul i32 %6, 125613361
%8 = ashr i32 %7, 27
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [32 x i32], [32 x i32]* @bit_ctz_general.MultiplyDeBruijnBitPosition, i64 0, i64 %9
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
@bit_ctz_general.MultiplyDeBruijnBitPosition = internal unnamed_addr constant [32 x i32] [i32 0, i32 1, i32 28, i32 2, i32 29, i32 14, i32 24, i32 3, i32 30, i32 22, i32 20, i32 15, i32 25, i32 17, i32 4, i32 8, i32 31, i32 27, i32 13, i32 23, i32 21, i32 19, i32 16, i32 7, i32 26, i32 12, i32 18, i32 6, i32 11, i32 5, i32 10, i32 9]
define i32 @bit_ctz_general(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = mul i32 %3, 125613361
%5 = ashr i32 %4, 27
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [32 x i32], [32 x i32]* @bit_ctz_general.MultiplyDeBruijnBitPosition, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *rar_malloc(size_t size) {
  void *alloc;
  if (!size || size > 1024 * 1024 * 32) {
    return NULL;
  }
  alloc = malloc(size);
  if (!alloc) {
    perror("malloc_problem");
    return NULL;
  } else
    return alloc;
}


x86 assembly (clang, -O0):
<rar_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1145 <rar_malloc+0x25>
cmpq   $0x2000000,-0x10(%rbp)
02
jbe    1152 <rar_malloc+0x32>
movq   $0x0,-0x8(%rbp)
jmp    118b <rar_malloc+0x6b>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1183 <rar_malloc+0x63>
lea    0xe8f(%rip),%rdi
call   1040 <perror@plt>
movq   $0x0,-0x8(%rbp)
jmp    118b <rar_malloc+0x6b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rar_malloc>:
push   %rax
lea    -0x2000001(%rdi),%rax
cmp    $0xfffffffffe000000,%rax
jae    1134 <rar_malloc+0x14>
xor    %eax,%eax
jmp    113e <rar_malloc+0x1e>
call   1030 <malloc@plt>
test   %rax,%rax
je     1140 <rar_malloc+0x20>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
call   1040 <perror@plt>
jmp    1130 <rar_malloc+0x10>

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

LLVM IR (-O2):
@.str = [15 x i8] c"malloc_problem\00"
define noalias i8* @rar_malloc(i64 %0) {
%2 = add i64 %0, -33554433
%3 = icmp ult i64 %2, -33554432
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i8* @malloc(i64 %0)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %4, %1, %7
%10 = phi i8* [ null, %7 ], [ null, %1 ], [ %5, %4 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_licence_message(void) {
  puts("nyancat-console"
       " "
       "0.0.8"
       " Copyright 2011-2012 Daniel Carl\n");
  puts("nyancat-console"
       " comes with ABSOLUTELY NO WARRANTY; for details");
  puts("see LICENSE file. This is free software, and you are welcome to");
  puts("redistribute it under the terms of the GNU General Public License.");
}


x86 assembly (clang, -O0):
<print_licence_message>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf10(%rip),%rdi
call   1030 <puts@plt>
lea    0xf43(%rip),%rdi
call   1030 <puts@plt>
lea    0xf77(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_licence_message>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xf46(%rip),%rdi
call   1030 <puts@plt>
lea    0xf7a(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"nyancat-console 0.0.8 Copyright 2011-2012 Daniel Carl\0A\00"
@.str.1 = [63 x i8] c"nyancat-console comes with ABSOLUTELY NO WARRANTY; for details\00"
@.str.2 = [64 x i8] c"see LICENSE file. This is free software, and you are welcome to\00"
@.str.3 = [67 x i8] c"redistribute it under the terms of the GNU General Public License.\00"
define void @print_licence_message() {
%1 = call i32 @puts(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"nyancat-console 0.0.8 Copyright 2011-2012 Daniel Carl\0A\00"
@.str.1 = [63 x i8] c"nyancat-console comes with ABSOLUTELY NO WARRANTY; for details\00"
@.str.2 = [64 x i8] c"see LICENSE file. This is free software, and you are welcome to\00"
@.str.3 = [67 x i8] c"redistribute it under the terms of the GNU General Public License.\00"
define void @print_licence_message() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InitEInt0();
int /*<<< orphan*/ InitEInt2();
void InitExtInt(void) {
  InitEInt0();
  InitEInt2();
}


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

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

LLVM IR (-O0):
define void @InitExtInt() {
%1 = call i32 (...) @InitEInt0()
%2 = call i32 (...) @InitEInt2()
ret void
}

LLVM IR (-O2):
define void @InitExtInt() {
%1 = tail call i32 (...) @InitEInt0()
%2 = tail call i32 (...) @InitEInt2()
ret void
}
/* Variables and functions */
double __nv_log10(double);
double log10(double __a) { return __nv_log10(__a); }


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

x86 assembly (clang, -O2):
<log10>:
jmp    1030 <__nv_log10@plt>

LLVM IR (-O0):
define double @log10(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__nv_log10(double %3)
ret double %4
}

LLVM IR (-O2):
define double @log10(double %0) {
%2 = tail call double @__nv_log10(double %0)
ret double %2
}
void getRidOfLNK4221_224() {}


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

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

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

LLVM IR (-O2):
define void @getRidOfLNK4221_224() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
gen_divide_by_two() { output_line("sra\t$v0, 2"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"sra\09$v0, 2\00"
define i32 @gen_divide_by_two() {
%1 = alloca i32
%2 = call i32 @output_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [11 x i8] c"sra\09$v0, 2\00"
define i32 @gen_divide_by_two() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void foo390() {}


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

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

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

LLVM IR (-O2):
define void @foo390() {
ret void
}
int c029(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c029() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ setlinebuf(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void bufferlines_() {
  setlinebuf(stdout);
  return;
}


x86 assembly (clang, -O0):
<bufferlines_>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <setlinebuf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufferlines_>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <setlinebuf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @bufferlines_() {
%1 = load i32, i32* @stdout
%2 = call i32 @setlinebuf(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @bufferlines_() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @setlinebuf(i32 %1)
ret void
}
void _vector3_scale(float *v, float s) {
  int k;
  for (k = 0; k < 3; k++)
    v[k] *= s;
}


x86 assembly (clang, -O0):
<_vector3_scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1143 <_vector3_scale+0x43>
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <_vector3_scale+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_vector3_scale(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fmul float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fmul float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fmul float %9, %1
store float %10, float* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/
DisseminationEngineImplP__DisseminationCache__newData(unsigned int);
void DisseminatorP__0__DisseminationCache__newData(void) {
  DisseminationEngineImplP__DisseminationCache__newData(170U);
}


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

x86 assembly (clang, -O2):
<DisseminatorP__0__DisseminationCache__newData>:
mov    $0xaa,%edi
jmp    1030 <DisseminationEngineImplP__DisseminationCache__newData@plt>

LLVM IR (-O0):
define void @DisseminatorP__0__DisseminationCache__newData() {
%1 = call i32 @DisseminationEngineImplP__DisseminationCache__newData(i32 170)
ret void
}

LLVM IR (-O2):
define void @DisseminatorP__0__DisseminationCache__newData() {
%1 = tail call i32 @DisseminationEngineImplP__DisseminationCache__newData(i32 170)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closefrom(int);
void xclosefrom(int lowfd) { closefrom(lowfd); }


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

x86 assembly (clang, -O2):
<xclosefrom>:
jmp    1030 <closefrom@plt>

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

LLVM IR (-O2):
define void @xclosefrom(i32 %0) {
%2 = tail call i32 @closefrom(i32 %0)
ret void
}
void UI_get_string_type(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_get_string_type() {
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i > 0) {
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1141 <main+0x31>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %2
%9 = add nsw i32 %8, 1
store i32 %9, i32* %2
br label %4
10: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int PAPI_multiplex_init();
void papif_multiplex_init__(int *check) { *check = PAPI_multiplex_init(); }


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

x86 assembly (clang, -O2):
<papif_multiplex_init__>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <PAPI_multiplex_init@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_multiplex_init__(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @PAPI_multiplex_init()
store i32 %2, i32* %0
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int SPI_Read(int);
uint16_t recv_size(void) {
  return ((SPI_Read(0x0426) & 0x00FF) << 8) + SPI_Read(0x0426 + 1);
}


x86 assembly (clang, -O0):
<recv_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x426,%edi
call   1030 <SPI_Read@plt>
and    $0xff,%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    $0x427,%edi
call   1030 <SPI_Read@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recv_size>:
push   %rbx
mov    $0x426,%edi
call   1030 <SPI_Read@plt>
shl    $0x8,%eax
movzwl %ax,%ebx
mov    $0x427,%edi
call   1030 <SPI_Read@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @recv_size() {
%1 = call i32 @SPI_Read(i32 1062)
%2 = and i32 %1, 255
%3 = shl i32 %2, 8
%4 = call i32 @SPI_Read(i32 1063)
%5 = add nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @recv_size() {
%1 = tail call i32 @SPI_Read(i32 1062)
%2 = shl i32 %1, 8
%3 = and i32 %2, 65280
%4 = tail call i32 @SPI_Read(i32 1063)
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ errx(int const, char *);
void usage(const int ec) {
  errx(ec, "usage: bkd [-h46dsk] -r dir [-a host] -p port");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"usage: bkd [-h46dsk] -r dir [-a host] -p port\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @errx(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"usage: bkd [-h46dsk] -r dir [-a host] -p port\00"
define void @usage(i32 %0) {
%2 = tail call i32 @errx(i32 %0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}
void delay() {
  volatile int i;
  for (i = 0; i < 100; i++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0x64,%eax
jge    112a <delay+0x2a>
jmp    111c <delay+0x1c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x63,%eax
jg     112e <delay+0x2e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0x64,%eax
jl     1120 <delay+0x20>
ret

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store volatile i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load volatile i32, i32* %1
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp slt i32 %3, 100
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add nsw i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp slt i32 %8, 100
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ run_threads(int /*<<< orphan*/);
int main(int argc, char *argv[]) { run_threads(atoi(argv[1])); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @run_threads(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch;
  printf("please input a char:\n");
  scanf("%c", &ch);
  if (ch >= 48 && ch <= 57)
    printf("YES");
  else
    printf("NO");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1176 <main+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1176 <main+0x56>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
jmp    1182 <main+0x62>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
add    $0xd0,%al
cmp    $0xa,%al
lea    0xea6(%rip),%rax
lea    0xea3(%rip),%rdi
cmovb  %rax,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"please input a char:\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"YES\00"
@.str.3 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 48
br i1 %7, label %8, label %14
8: ; preds = %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 57
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %8, %0
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [4 x i8] c"YES\00"
@.str.3 = [3 x i8] c"NO\00"
@str = [21 x i8] c"please input a char:\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = select i1 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __llvm_profile_reset_counters();
int /*<<< orphan*/ foo(int);
int main(void) {
  foo(0);
  __llvm_profile_reset_counters();
  foo(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1040 <foo@plt>
mov    $0x0,%al
call   1030 <__llvm_profile_reset_counters@plt>
mov    $0x1,%edi
call   1040 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 0)
%3 = call i32 (...) @__llvm_profile_reset_counters()
%4 = call i32 @foo(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 (...) @__llvm_profile_reset_counters()
%3 = tail call i32 @foo(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void *thread_func(void *arg) {
  (void)arg;
  while (1)
    write(1, "test message\n", strlen("test message\n"));
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xeba(%rip),%rsi
call   1030 <write@plt>
jmp    112c <thread_func+0xc>

x86 assembly (clang, -O2):
<thread_func>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
jmp    1130 <thread_func+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"test message\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
br label %4
4: ; preds = %1, %4
%5 = call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %4
}

LLVM IR (-O2):
@.str = [14 x i8] c"test message\0A\00"
define noalias i8* @thread_func(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void badvpn_write_le8(uint8_t x, char *c_ptr) {
  uint8_t *ptr = (uint8_t *)c_ptr;
  ptr[0] = x >> 0;
}


x86 assembly (clang, -O0):
<badvpn_write_le8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<badvpn_write_le8>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @badvpn_write_le8(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %3
%9 = ashr i32 %8, 0
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
ret void
}

LLVM IR (-O2):
define void @badvpn_write_le8(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
store i32 %0, i32* %3
ret void
}
/* Variables and functions */
int standardize_cell(double **, double **, int *, int const, double const,
                     double const);
int spgat_refine_cell(double lattice[3][3], double position[][3], int types[],
                      const int num_atom, const double symprec,
                      const double angle_tolerance) {
  return standardize_cell(lattice, position, types, num_atom, symprec,
                          angle_tolerance);
}


x86 assembly (clang, -O0):
<spgat_refine_cell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1030 <standardize_cell@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spgat_refine_cell>:
jmp    1030 <standardize_cell@plt>

LLVM IR (-O0):
define i32 @spgat_refine_cell([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4, double %5) {
%7 = alloca [3 x double]*
%8 = alloca [3 x double]*
%9 = alloca i32*
%10 = alloca i32
%11 = alloca double
%12 = alloca double
store [3 x double]* %0, [3 x double]** %7
store [3 x double]* %1, [3 x double]** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store double %4, double* %11
store double %5, double* %12
%13 = load [3 x double]*, [3 x double]** %7
%14 = bitcast [3 x double]* %13 to double**
%15 = load [3 x double]*, [3 x double]** %8
%16 = bitcast [3 x double]* %15 to double**
%17 = load i32*, i32** %9
%18 = load i32, i32* %10
%19 = load double, double* %11
%20 = load double, double* %12
%21 = call i32 @standardize_cell(double** %14, double** %16, i32* %17, i32 %18, double %19, double %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @spgat_refine_cell([3 x double]* %0, [3 x double]* %1, i32* %2, i32 %3, double %4, double %5) {
%7 = bitcast [3 x double]* %0 to double**
%8 = bitcast [3 x double]* %1 to double**
%9 = tail call i32 @standardize_cell(double** %7, double** %8, i32* %2, i32 %3, double %4, double %5)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: packchr [--nametable-base=NUM] [--null-tile=NUM]\n"
         "               [--character-output=FILE] [--nametable-output=FILE]\n"
         "               [--character-size=SIZE] [--verbose]\n"
         "               [--help] [--usage] [--version]\n"
         "                FILE\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [242 x i8] c"Usage: packchr [--nametable-base=NUM] [--null-tile=NUM]\0A [--character-output=FILE] [--nametable-output=FILE]\0A [--character-size=SIZE] [--verbose]\0A [--help] [--usage] [--version]\0A FILE\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([242 x i8], [242 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [241 x i8] c"Usage: packchr [--nametable-base=NUM] [--null-tile=NUM]\0A [--character-output=FILE] [--nametable-output=FILE]\0A [--character-size=SIZE] [--verbose]\0A [--help] [--usage] [--version]\0A FILE\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([241 x i8], [241 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ write(int, char *, int);
int net_callback(int sock, void *params) {
  char buffer[256];
  read(sock, buffer, 255);
  printf("%s\n", buffer);
  write(sock, "hello\n", 6);
  return 0;
}


x86 assembly (clang, -O0):
<net_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0xff,%edx
call   1050 <read@plt>
lea    -0x110(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
lea    0xe91(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_callback>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0xff,%edx
call   1050 <read@plt>
lea    0xead(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
lea    0xea2(%rip),%rsi
mov    %ebx,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"hello\0A\00"
define i32 @net_callback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = call i32 @read(i32 %6, i8* %7, i32 255)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* %3
%12 = call i32 @write(i32 %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [7 x i8] c"hello\0A\00"
define i32 @net_callback(i32 %0, i8* nocapture readnone %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 %0, i8* %4, i32 255)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 @write(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void RunDecryptionKeySchedule(uint8_t *key, uint8_t *roundKeys) {}


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

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

LLVM IR (-O0):
define void @RunDecryptionKeySchedule(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
define void @RunDecryptionKeySchedule(i32* nocapture %0, i32* nocapture %1) {
ret void
}