xunge/DecIR huggingface dataset:
/* Variables and functions */
int strcmp(char *, char *);
int xstrcmp(char *a, char *b) { return strcmp(a, b); }


x86 assembly (clang, -O0):
<xstrcmp>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @xstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ lgamma(double);
int /*<<< orphan*/ lgammaf(float);
int /*<<< orphan*/ lgammal(long double);
void uninitvar_lgamma(void) {
  float f;
  (void)lgammaf(f);
  double d;
  (void)lgamma(d);
  long double ld;
  (void)lgammal(ld);
}


x86 assembly (clang, -O0):
<uninitvar_lgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  -0x4(%rbp),%xmm0
call   1050 <lgammaf@plt>
movsd  -0x10(%rbp),%xmm0
call   1040 <lgamma@plt>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <lgammal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_lgamma>:
sub    $0x18,%rsp
call   1050 <lgammaf@plt>
call   1040 <lgamma@plt>
call   1030 <lgammal@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @uninitvar_lgamma() {
%1 = alloca float
%2 = alloca double
%3 = alloca x86_fp80
%4 = load float, float* %1
%5 = call i32 @lgammaf(float %4)
%6 = load double, double* %2
%7 = call i32 @lgamma(double %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = call i32 @lgammal(x86_fp80 %8)
ret void
}

LLVM IR (-O2):
define void @uninitvar_lgamma() {
%1 = tail call i32 @lgammaf(float undef)
%2 = tail call i32 @lgamma(double undef)
%3 = tail call i32 @lgammal(x86_fp80 undef)
ret void
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ memcpy(int *, int *, int);
int *copy_ints(int *src, int len) {
  int *tmp = malloc(sizeof(int) * len);
  memcpy(tmp, src, len * sizeof(int));
  return tmp;
}


x86 assembly (clang, -O0):
<copy_ints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_ints>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x0(,%rsi,4),%ebp
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @copy_ints(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 4, %7
%9 = trunc i64 %8 to i32
%10 = call i32* @malloc(i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 4
%16 = trunc i64 %15 to i32
%17 = call i32 @memcpy(i32* %11, i32* %12, i32 %16)
%18 = load i32*, i32** %5
ret i32* %18
}

LLVM IR (-O2):
define i32* @copy_ints(i32* %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = tail call i32* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i32* %4, i32* %0, i32 %3)
ret i32* %4
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *_strdup(char *s) {
  char *p;
  p = malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <_strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <_strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
char *strcpy(char *dest, const char *src) {
  for (; *src; *dest++ = *src++)
    ;
  *dest = 0;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <strcpy+0x45>
jmp    111e <strcpy+0x1e>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %14
}
void benchmark_MixColumn(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @answer_name() {
ret void
}
void RasterSoftWareClkEnable(unsigned int baseAddr) {
  (*((volatile unsigned int *)(baseAddr + (0x6C)))) |= (0x00000001u);
}


x86 assembly (clang, -O0):
<RasterSoftWareClkEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x6c,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RasterSoftWareClkEnable>:
add    $0x6c,%edi
orl    $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @RasterSoftWareClkEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, 108
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = or i32 %7, 1
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @RasterSoftWareClkEnable(i32 %0) {
%2 = add i32 %0, 108
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = or i32 %5, 1
store volatile i32 %6, i32* %4
ret void
}
int is_enter(int key) { return key == 0xa; }


x86 assembly (clang, -O0):
<is_enter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_enter>:
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_enter(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 10
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @is_enter(i32 %0) {
%2 = icmp eq i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct can_filter {
  int /*<<< orphan*/ can_mask;
  int /*<<< orphan*/ can_id;
};
typedef int /*<<< orphan*/ canid_t;

/* Variables and functions */
int /*<<< orphan*/ CAN_EFF_MASK;
int /*<<< orphan*/ CAN_RAW_FILTER;
int /*<<< orphan*/ SOL_CAN_RAW;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, struct can_filter *,
               int);
int can_set_filter(int fd, canid_t addr) {
  struct can_filter filter;
  filter.can_id = addr;
  filter.can_mask = CAN_EFF_MASK;
  return setsockopt(fd, SOL_CAN_RAW, CAN_RAW_FILTER, &filter,
                    sizeof(struct can_filter));
}


x86 assembly (clang, -O0):
<can_set_filter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea6(%rip),%rax
mov    (%rax),%esi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<can_set_filter>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2e9f(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
mov    $0x8,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.can_filter = type { i32, i32 }
@CAN_EFF_MASK = global i32 0
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @can_set_filter(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.can_filter
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %5, i32 0, i32 1
store i32 %6, i32* %7
%8 = load i32, i32* @CAN_EFF_MASK
%9 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %5, i32 0, i32 0
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = load i32, i32* @SOL_CAN_RAW
%12 = load i32, i32* @CAN_RAW_FILTER
%13 = call i32 @setsockopt(i32 %10, i32 %11, i32 %12, %struct.can_filter* %5, i32 8)
ret i32 %13
}

LLVM IR (-O2):
%struct.can_filter = type { i32, i32 }
@CAN_EFF_MASK = global i32 0
@SOL_CAN_RAW = global i32 0
@CAN_RAW_FILTER = global i32 0
define i32 @can_set_filter(i32 %0, i32 %1) {
%3 = alloca %struct.can_filter
%4 = bitcast %struct.can_filter* %3 to i8*
%5 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %3, i64 0, i32 1
store i32 %1, i32* %5
%6 = load i32, i32* @CAN_EFF_MASK
%7 = getelementptr inbounds %struct.can_filter, %struct.can_filter* %3, i64 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* @SOL_CAN_RAW
%9 = load i32, i32* @CAN_RAW_FILTER
%10 = call i32 @setsockopt(i32 %0, i32 %8, i32 %9, %struct.can_filter* %3, i32 8)
ret i32 %10
}
/* Type definitions */
struct xs_prng {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ xs1024_next(struct xs_prng *);
void xs1024_warmup(struct xs_prng *rng) {
  int i;
  for (i = 0; i < 1000; i++) {
    xs1024_next(rng);
  }
}


x86 assembly (clang, -O0):
<xs1024_warmup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3e8,-0xc(%rbp)
jge    1147 <xs1024_warmup+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <xs1024_next@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <xs1024_warmup+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xs1024_warmup>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x3e8,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <xs1024_next@plt>
add    $0xffffffff,%ebp
jne    1120 <xs1024_warmup+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.xs_prng = type { i32 }
define void @xs1024_warmup(%struct.xs_prng* %0) {
%2 = alloca %struct.xs_prng*
%3 = alloca i32
store %struct.xs_prng* %0, %struct.xs_prng** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1000
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load %struct.xs_prng*, %struct.xs_prng** %2
%9 = call i32 @xs1024_next(%struct.xs_prng* %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.xs_prng = type { i32 }
define void @xs1024_warmup(%struct.xs_prng* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @xs1024_next(%struct.xs_prng* %0)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 1000
br i1 %6, label %7, label %2
7: ; preds = %2
ret void
}
int input_getc_complicated(struct input_ty *x) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.input_ty = type opaque
define i32 @input_getc_complicated(%struct.input_ty* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int VIDDummyInit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @VIDDummyInit() {
ret i32 0
}
int int_array_cmp_func(const void *a, const void *b) {
  return *((long *)a) - *((long *)b);
}


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

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

LLVM IR (-O0):
define i32 @int_array_cmp_func(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = sub nsw i64 %7, %10
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @int_array_cmp_func(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = sub nsw i64 %4, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *needHugeMem(size_t);
void *needHugeZeroedMem(size_t size) {
  void *v;
  v = needHugeMem(size);
  memset(v, 0, size);
  return v;
}


x86 assembly (clang, -O0):
<needHugeZeroedMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <needHugeMem@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<needHugeZeroedMem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <needHugeMem@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @needHugeZeroedMem(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @needHugeMem(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @needHugeZeroedMem(i64 %0) {
%2 = tail call i8* @needHugeMem(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ log_init(char *);
void amf_su_init(void) { log_init("AMF"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"AMF\00"
define void @amf_su_init() {
%1 = call i32 @log_init(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"AMF\00"
define void @amf_su_init() {
%1 = tail call i32 @log_init(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int wchar_t;

/* Variables and functions */
wchar_t test20(void) { return L'\v'; }


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

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

LLVM IR (-O0):
define i32 @test20() {
ret i32 11
}

LLVM IR (-O2):
define i32 @test20() {
ret i32 11
}
/* Type definitions */
typedef int /*<<< orphan*/ d;

/* Variables and functions */
int /*<<< orphan*/ oled_SendCommand(unsigned char *, int);
void SetVCOMDeselectLevel(char a) {
  unsigned char d[] = {0xDB, a & 0x7F};
  oled_SendCommand(d, sizeof(d));
}


x86 assembly (clang, -O0):
<SetVCOMDeselectLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0xdb,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x7f,%eax
mov    %al,-0x2(%rbp)
lea    -0x3(%rbp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetVCOMDeselectLevel>:
push   %rax
movb   $0xdb,0x6(%rsp)
and    $0x7f,%dil
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <oled_SendCommand@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @SetVCOMDeselectLevel(i8 signext %0) {
%2 = alloca i8
%3 = alloca [2 x i8]
store i8 %0, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -37, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = and i32 %7, 127
%9 = trunc i32 %8 to i8
store i8 %9, i8* %5
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%11 = call i32 @oled_SendCommand(i8* %10, i32 2)
ret void
}

LLVM IR (-O2):
define void @SetVCOMDeselectLevel(i8 signext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -37, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = and i8 %0, 127
store i8 %5, i8* %4
%6 = call i32 @oled_SendCommand(i8* %3, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ print_cards(int /*<<< orphan*/ *, int *, int);
int /*<<< orphan*/ update_cards(char *, int *, int);
int /*<<< orphan*/ update_zone_view(char *);
void handle_one(FILE *outf, char *query, int *arr, int len) {
  if (len > 0) {
    update_cards(query, arr, len);
    print_cards(outf, arr, len);
    update_zone_view("");
  }
}


x86 assembly (clang, -O0):
<handle_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    117d <handle_one+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <update_cards@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <print_cards@plt>
lea    0xe88(%rip),%rdi
call   1050 <update_zone_view@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_one>:
test   %ecx,%ecx
jle    116c <handle_one+0x3c>
push   %r15
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %rdx,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
call   1030 <update_cards@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <print_cards@plt>
lea    0xe9e(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <update_zone_view@plt>
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @handle_one(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %4
%12 = load i8*, i8** %6
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32 @update_cards(i8* %12, i32* %13, i32 %14)
%16 = load i32*, i32** %5
%17 = load i32*, i32** %7
%18 = load i32, i32* %8
%19 = call i32 @print_cards(i32* %16, i32* %17, i32 %18)
%20 = call i32 @update_zone_view(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @handle_one(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %10
6: ; preds = %4
%7 = tail call i32 @update_cards(i8* %1, i32* %2, i32 %3)
%8 = tail call i32 @print_cards(i32* %0, i32* %2, i32 %3)
%9 = tail call i32 @update_zone_view(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fl_fgetpos(void *, unsigned long *);
long fl_ftell(void *f) {
  unsigned long pos = 0;
  fl_fgetpos(f, &pos);
  return (long)pos;
}


x86 assembly (clang, -O0):
<fl_ftell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <fl_fgetpos@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fl_ftell>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <fl_fgetpos@plt>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @fl_ftell(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = call i32 @fl_fgetpos(i8* %0, i64* %2)
%5 = load i64, i64* %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int lib_interface(void) { printf("Hello world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @lib_interface() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int count_even(int a, int b) {
  int ret = b - a;
  if (ret < 0)
    ret += 10;
  return ret + '0';
}


x86 assembly (clang, -O0):
<count_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1126 <count_even+0x26>
mov    -0xc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_even>:
sub    %edi,%esi
lea    0xa(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
add    $0x30,%eax
ret

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

LLVM IR (-O2):
define i32 @count_even(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = icmp slt i32 %3, 0
%5 = add nsw i32 %3, 10
%6 = select i1 %4, i32 %5, i32 %3
%7 = add nsw i32 %6, 48
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ knuth_shuffle(int *, int, int);
int /*<<< orphan*/ quicksort_rec(int *, int /*<<< orphan*/, int);
void quicksort(int *items, int size, int seed) {
  knuth_shuffle(items, size, seed);
  quicksort_rec(items, 0, size - 1);
}


x86 assembly (clang, -O0):
<quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <knuth_shuffle@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <quicksort_rec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quicksort>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1040 <knuth_shuffle@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <quicksort_rec@plt>

LLVM IR (-O0):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @knuth_shuffle(i32* %7, i32 %8, i32 %9)
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = call i32 @quicksort_rec(i32* %11, i32 0, i32 %13)
ret void
}

LLVM IR (-O2):
define void @quicksort(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @knuth_shuffle(i32* %0, i32 %1, i32 %2)
%5 = add nsw i32 %1, -1
%6 = tail call i32 @quicksort_rec(i32* %0, i32 0, i32 %5)
ret void
}
/* Variables and functions */
int ID0socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ PF_INET6;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
int ipv6_available(void) {
  int s;
  if ((s = ID0socket(PF_INET6, SOCK_DGRAM, 0)) == -1)
    return 0;
  close(s);
  return 1;
}


x86 assembly (clang, -O0):
<ipv6_available>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <ID0socket@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    1159 <ipv6_available+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1168 <ipv6_available+0x48>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipv6_available>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <ID0socket@plt>
cmp    $0xffffffff,%eax
je     114d <ipv6_available+0x2d>
mov    %eax,%edi
call   1040 <close@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@PF_INET6 = global i32 0
@SOCK_DGRAM = global i32 0
define i32 @ipv6_available() {
%1 = load i32, i32* @PF_INET6
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @ID0socket(i32 %1, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @close(i32 %3)
br label %7
7: ; preds = %0, %5
%8 = phi i32 [ 1, %5 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x, y;
  printf("x is: %d\n", x);
  printf("y is: %d\n", y);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"x is: %d\0A\00"
@.str.1 = [10 x i8] c"y is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ show_file(char *);
void show_tracers(void) { show_file("available_tracers"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"available_tracers\00"
define void @show_tracers() {
%1 = call i32 @show_file(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"available_tracers\00"
define void @show_tracers() {
%1 = tail call i32 @show_file(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
adr0reg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if ((*((int *)10000000)) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adr0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    $0x989680,%eax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
jg     1134 <adr0reg1+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <adr0reg1+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0reg1>:
xor    %eax,%eax
cmp    %esi,0x989680
setle  %al
ret

LLVM IR (-O0):
define i32 @adr0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* inttoptr (i64 10000000 to i32*)
%15 = load i32, i32* %9
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @adr0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = load i32, i32* inttoptr (i64 10000000 to i32*)
%8 = icmp sle i32 %7, %1
%9 = zext i1 %8 to i32
ret i32 %9
}
void RTTestSkipAndDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTestSkipAndDestroy() {
ret void
}
double XoVLength(x, y, z)
float x, y, z;
{
  double r = x * x + y * y + z * z;
  if (r > 0)
    return (sqrt(r));
  return (0.0);
}


x86 assembly (clang, -O0):
<XoVLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm2,-0x28(%rbp)
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
cvtsd2ss %xmm2,%xmm2
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm2,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    119d <XoVLength+0x8d>
movsd  -0x20(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    11a5 <XoVLength+0x95>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XoVLength>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm3
xorps  %xmm1,%xmm1
cvtsd2ss %xmm2,%xmm1
mulss  %xmm3,%xmm3
mulss  %xmm0,%xmm0
addss  %xmm3,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    1152 <XoVLength+0x42>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1153 <XoVLength+0x43>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @XoVLength(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca double
%9 = fptrunc double %0 to float
%10 = fptrunc double %1 to float
%11 = fptrunc double %2 to float
store float %9, float* %5
store float %10, float* %6
store float %11, float* %7
%12 = load float, float* %5
%13 = load float, float* %5
%14 = load float, float* %6
%15 = load float, float* %6
%16 = fmul float %14, %15
%17 = call float @llvm.fmuladd.f32(float %12, float %13, float %16)
%18 = load float, float* %7
%19 = load float, float* %7
%20 = call float @llvm.fmuladd.f32(float %18, float %19, float %17)
%21 = fpext float %20 to double
store double %21, double* %8
%22 = load double, double* %8
%23 = fcmp ogt double %22, 0.000000e+00
br i1 %23, label %24, label %27
24: ; preds = %3
%25 = load double, double* %8
%26 = call double @sqrt(double %25)
store double %26, double* %4
br label %28
27: ; preds = %3
store double 0.000000e+00, double* %4
br label %28
28: ; preds = %27, %24
%29 = load double, double* %4
ret double %29
}

LLVM IR (-O2):
define double @XoVLength(double %0, double %1, double %2) {
%4 = fptrunc double %0 to float
%5 = fptrunc double %1 to float
%6 = fptrunc double %2 to float
%7 = fmul float %5, %5
%8 = tail call float @llvm.fmuladd.f32(float %4, float %4, float %7)
%9 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %8)
%10 = fcmp ogt float %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = fpext float %9 to double
%13 = tail call double @sqrt(double %12)
br label %14
14: ; preds = %3, %11
%15 = phi double [ %13, %11 ], [ 0.000000e+00, %3 ]
ret double %15
}
int add_time_lct_he(void) {
  int len = 0;
  return len;
}


x86 assembly (clang, -O0):
<add_time_lct_he>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @add_time_lct_he() {
ret i32 0
}
void gtk_action_create_tool_item() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_create_tool_item() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dumpAll();
int /*<<< orphan*/ gpioSet(int, int /*<<< orphan*/);
int /*<<< orphan*/ output(int, char *);
void shutdownChip() {
  output(1, "Shutting down chip.\n");
  dumpAll();
  gpioSet(81, 0);
  gpioSet(3, 0);
  gpioSet(53, 0);
  gpioSet(71, 0);
  gpioSet(124, 0);
  gpioSet(114, 0);
  dumpAll();
}


x86 assembly (clang, -O0):
<shutdownChip>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xec0(%rip),%rsi
call   1030 <output@plt>
mov    $0x0,%al
call   1050 <dumpAll@plt>
mov    $0x51,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x35,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x47,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x7c,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x72,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x0,%al
call   1050 <dumpAll@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<shutdownChip>:
push   %rax
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <output@plt>
xor    %eax,%eax
call   1050 <dumpAll@plt>
mov    $0x51,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x35,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x47,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x7c,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
mov    $0x72,%edi
xor    %esi,%esi
call   1040 <gpioSet@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <dumpAll@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Shutting down chip.\0A\00"
define void @shutdownChip() {
%1 = call i32 @output(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @dumpAll()
%3 = call i32 @gpioSet(i32 81, i32 0)
%4 = call i32 @gpioSet(i32 3, i32 0)
%5 = call i32 @gpioSet(i32 53, i32 0)
%6 = call i32 @gpioSet(i32 71, i32 0)
%7 = call i32 @gpioSet(i32 124, i32 0)
%8 = call i32 @gpioSet(i32 114, i32 0)
%9 = call i32 (...) @dumpAll()
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Shutting down chip.\0A\00"
define void @shutdownChip() {
%1 = tail call i32 @output(i32 1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @dumpAll()
%3 = tail call i32 @gpioSet(i32 81, i32 0)
%4 = tail call i32 @gpioSet(i32 3, i32 0)
%5 = tail call i32 @gpioSet(i32 53, i32 0)
%6 = tail call i32 @gpioSet(i32 71, i32 0)
%7 = tail call i32 @gpioSet(i32 124, i32 0)
%8 = tail call i32 @gpioSet(i32 114, i32 0)
%9 = tail call i32 (...) @dumpAll()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
scalar_t__ glinject_handle_x11_event(int /*<<< orphan*/ *);
int glinject_real_XMaskEvent(int /*<<< orphan*/ *, long, int /*<<< orphan*/ *);
int XMaskEvent(Display *dpy, long mask, XEvent *event) {
  int return_val;
  do {
    return_val = glinject_real_XMaskEvent(dpy, mask, event);
  } while (glinject_handle_x11_event(event));
  return return_val;
}


x86 assembly (clang, -O0):
<XMaskEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <glinject_real_XMaskEvent@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <glinject_handle_x11_event@plt>
cmp    $0x0,%rax
jne    1134 <XMaskEvent+0x14>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XMaskEvent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <glinject_real_XMaskEvent@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <glinject_handle_x11_event@plt>
test   %rax,%rax
jne    1130 <XMaskEvent+0x10>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @XMaskEvent(i32* %0, i64 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
br label %8
8: ; preds = %13, %3
%9 = load i32*, i32** %4
%10 = load i64, i64* %5
%11 = load i32*, i32** %6
%12 = call i32 @glinject_real_XMaskEvent(i32* %9, i64 %10, i32* %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32*, i32** %6
%15 = call i64 @glinject_handle_x11_event(i32* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %8, label %17
17: ; preds = %13
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @XMaskEvent(i32* %0, i64 %1, i32* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @glinject_real_XMaskEvent(i32* %0, i64 %1, i32* %2)
%6 = tail call i64 @glinject_handle_x11_event(i32* %2)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void my_putline(FILE *f, char *l) {
  int x;
  for (x = 0; l[x]; x++)
    fputc(l[x], f);
  fputc('\n', f);
}


x86 assembly (clang, -O0):
<my_putline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115e <my_putline+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1030 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <my_putline+0x17>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%al
test   %al,%al
je     1146 <my_putline+0x36>
mov    %rsi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <my_putline+0x20>
mov    $0xa,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
define void @my_putline(i32* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = tail call i32 @fputc(i8 signext %7, i32* %0)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 @fputc(i8 signext 10, i32* %0)
ret void
}
void solution(struct battle_char *origin, struct battle_char *target) {}


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

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

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

LLVM IR (-O2):
%struct.battle_char = type opaque
define void @solution(%struct.battle_char* nocapture %0, %struct.battle_char* nocapture %1) {
ret void
}
int cntstr(char *b) {
  int i = 0;
  while (*b != '\0') {
    i++;
    b++;
  }
  return i;
}


x86 assembly (clang, -O0):
<cntstr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <cntstr+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <cntstr+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cntstr>:
cmpb   $0x0,(%rdi)
je     111c <cntstr+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <cntstr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @cntstr(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 i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
long long bit62() { return 0x4000000000000000LL; }


x86 assembly (clang, -O0):
<bit62>:
push   %rbp
mov    %rsp,%rbp
movabs $0x4000000000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit62>:
movabs $0x4000000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit62() {
ret i64 4611686018427387904
}

LLVM IR (-O2):
define i64 @bit62() {
ret i64 4611686018427387904
}