xunge/DecIR huggingface dataset:
/* Type definitions */
typedef size_t uint8_t;

/* Variables and functions */
uint8_t vi_rv(const void *vi, uint8_t i) { return ((uint8_t *)vi)[i]; }


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

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

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

LLVM IR (-O2):
define i64 @vi_rv(i8* nocapture %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 %1
%5 = load i64, i64* %4
ret i64 %5
}
void ff_hevc_put_hevc_uni_qpel_h16_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h16_10_avx2() {
ret void
}
/* Variables and functions */
long double __q_sind(long double *);
long double intr_wrap_067(long double p1) { return __q_sind(&p1); }


x86 assembly (clang, -O0):
<intr_wrap_067>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <__q_sind@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_067>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
mov    %rsp,%rdi
call   1030 <__q_sind@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @intr_wrap_067(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 @__q_sind(x86_fp80* %2)
ret x86_fp80 %3
}

LLVM IR (-O2):
define x86_fp80 @intr_wrap_067(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = call x86_fp80 @__q_sind(x86_fp80* %2)
ret x86_fp80 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Hello world! Welcome to C.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [27 x i8] c"Hello world! Welcome to C.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sync();
void *sync_thread(void *p) {
  sync();
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @sync_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @sync()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sync_thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @sync()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fill_one_span_write(unsigned char *, unsigned char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int fill_cache_write(unsigned char *start_ptr, unsigned char *end_ptr,
                     char *resctrl_val) {
  while (1) {
    fill_one_span_write(start_ptr, end_ptr);
    if (!strncmp(resctrl_val, "cat", sizeof("cat")))
      break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fill_cache_write>:
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
call   1040 <fill_one_span_write@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1164 <fill_cache_write+0x44>
jmp    1169 <fill_cache_write+0x49>
jmp    1134 <fill_cache_write+0x14>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_cache_write>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xec8(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <fill_one_span_write@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1140 <fill_cache_write+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"cat\00"
define i32 @fill_cache_write(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
br label %7
7: ; preds = %3, %15
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @fill_one_span_write(i8* %8, i8* %9)
%11 = load i8*, i8** %6
%12 = call i32 @strncmp(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %7
br label %16
15: ; preds = %7
br label %7
16: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"cat\00"
define i32 @fill_cache_write(i8* %0, i8* %1, i8* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @fill_one_span_write(i8* %0, i8* %1)
%6 = tail call i32 @strncmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, char *, int);
int open(char *, int, int /*<<< orphan*/);
int eopen(char *fname, int flag) {
  int fd;
  if ((fd = open(fname, flag, 0)) < 0)
    eprintf("eopen(%s, %s) failed:", fname, flag);
  return fd;
}


x86 assembly (clang, -O0):
<eopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    115c <eopen+0x3c>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xea9(%rip),%rdi
call   1030 <eprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eopen>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %edx,%edx
call   1040 <open@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    1149 <eopen+0x29>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <eprintf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"eopen(%s, %s) failed:\00"
define i32 @eopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7, i32 0)
store i32 %8, i32* %5
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @eprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"eopen(%s, %s) failed:\00"
define i32 @eopen(i8* %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @eprintf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t maxu32(uint32_t a, uint32_t b) { return ((a) < (b) ? (a) : (b)); }


x86 assembly (clang, -O0):
<maxu32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1127 <maxu32+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <maxu32+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxu32>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovl  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @maxu32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void ctl_current_time(int ct) {}


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

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

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

LLVM IR (-O2):
define void @ctl_current_time(i32 %0) {
ret void
}
int __attribute__((unused)) isxdigit(int c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
         (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isxdigit+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
cmpl   $0x61,-0x4(%rbp)
jl     1139 <isxdigit+0x39>
mov    $0x1,%al
cmpl   $0x66,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isxdigit+0x58>
xor    %eax,%eax
cmpl   $0x41,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isxdigit+0x52>
cmpl   $0x46,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 102
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 65
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 70
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
void *memset(void *dest, int ch, size_t count) {
  unsigned char *ptr = (unsigned char *)dest;
  for (unsigned int i = 0; i < count; i++) {
    ptr[i] = (unsigned char)ch;
  }
  return dest;
}


x86 assembly (clang, -O0):
<memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    1148 <memset+0x48>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    111e <memset+0x1e>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset>:
mov    %rdi,%rax
test   %rdx,%rdx
je     111c <memset+0x1c>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %sil,(%rax,%rcx,1)
add    $0x1,%ecx
cmp    %rdx,%rcx
jb     1110 <memset+0x10>
ret

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

LLVM IR (-O2):
define i8* @memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %8
7: ; preds = %8, %3
ret i8* %0
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %12, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 %6, i8* %10
%11 = add nuw nsw i64 %9, 1
%12 = and i64 %11, 4294967295
%13 = icmp ult i64 %12, %2
br i1 %13, label %8, label %7
}
void pmv2s_(x, y) short *x, *y;
{ pmv((float)*x, (float)*y, 0.0); }


x86 assembly (clang, -O0):
<pmv2s_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pmv@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmv2s_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
xorps  %xmm2,%xmm2
mov    $0x3,%al
jmp    1030 <pmv@plt>

LLVM IR (-O0):
define void @pmv2s_(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
store i16* %0, i16** %3
store i16* %1, i16** %4
%5 = load i16*, i16** %3
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = fpext float %7 to double
%9 = load i16*, i16** %4
%10 = load i16, i16* %9
%11 = sitofp i16 %10 to float
%12 = fpext float %11 to double
%13 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %8, double %12, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @pmv2s_(i16* nocapture %0, i16* nocapture %1) {
%3 = load i16, i16* %0
%4 = sitofp i16 %3 to double
%5 = load i16, i16* %1
%6 = sitofp i16 %5 to double
%7 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %4, double %6, double 0.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse(char *);
int main(void) {
  char s[] = "asedf";
  reverse(s);
  printf("%s\n", s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <reverse@plt>
lea    -0xa(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x66,0xc(%rsp)
movl   $0x64657361,0x8(%rsp)
64
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <reverse@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.main.s = [6 x i8] c"asedf\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
__typeof__(isgraph("")) test_isgraph_32(void) { return isgraph(""); }


x86 assembly (clang, -O0):
<test_isgraph_32>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <isgraph@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_isgraph_32() {
%1 = call i32 @isgraph(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_isgraph_32() {
%1 = tail call i32 @isgraph(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf33(int f, int n) { return (cbuf(f, n, 33)); }


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

x86 assembly (clang, -O2):
<cbuf33>:
mov    $0x21,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf33(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 33)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gui_color_init_pairs();
int /*<<< orphan*/ gui_color_init_weechat();
scalar_t__ has_colors();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ use_default_colors();
void gui_color_init() {
  if (has_colors()) {
    start_color();
    use_default_colors();
  }
  gui_color_init_pairs();
  gui_color_init_weechat();
}


x86 assembly (clang, -O0):
<gui_color_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <has_colors@plt>
cmp    $0x0,%rax
je     1173 <gui_color_init+0x23>
mov    $0x0,%al
call   1050 <start_color@plt>
mov    $0x0,%al
call   1030 <use_default_colors@plt>
mov    $0x0,%al
call   1060 <gui_color_init_pairs@plt>
mov    $0x0,%al
call   1070 <gui_color_init_weechat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_color_init>:
push   %rax
xor    %eax,%eax
call   1040 <has_colors@plt>
test   %rax,%rax
je     116b <gui_color_init+0x1b>
xor    %eax,%eax
call   1050 <start_color@plt>
xor    %eax,%eax
call   1030 <use_default_colors@plt>
xor    %eax,%eax
call   1060 <gui_color_init_pairs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <gui_color_init_weechat@plt>

LLVM IR (-O0):
define void @gui_color_init() {
%1 = call i64 (...) @has_colors()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @start_color()
%5 = call i32 (...) @use_default_colors()
br label %6
6: ; preds = %3, %0
%7 = call i32 (...) @gui_color_init_pairs()
%8 = call i32 (...) @gui_color_init_weechat()
ret void
}

LLVM IR (-O2):
define void @gui_color_init() {
%1 = tail call i64 (...) @has_colors()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @start_color()
%5 = tail call i32 (...) @use_default_colors()
br label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @gui_color_init_pairs()
%8 = tail call i32 (...) @gui_color_init_weechat()
ret void
}
void rotate(s) unsigned short *s;
{
  unsigned char c1, c2;
  c2 = (unsigned char)(*s % 256);
  c1 = (unsigned char)(*s >> 8);
  *s = (unsigned short)c2;
  *s = *s << 8;
  *s += (unsigned short)c1;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
sar    $0x8,%eax
mov    %al,-0x9(%rbp)
movzbl -0xa(%rbp),%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
shl    $0x8,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,(%rax)
movzbl -0x9(%rbp),%eax
movzwl %ax,%edx
mov    -0x8(%rbp),%rax
movzwl (%rax),%ecx
add    %edx,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
rolw   $0x8,(%rdi)
ret

LLVM IR (-O0):
define void @rotate(i16* %0) {
%2 = alloca i16*
%3 = alloca i8
%4 = alloca i8
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = srem i32 %7, 256
%9 = trunc i32 %8 to i8
store i8 %9, i8* %4
%10 = load i16*, i16** %2
%11 = load i16, i16* %10
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 8
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = load i8, i8* %4
%16 = zext i8 %15 to i16
%17 = load i16*, i16** %2
store i16 %16, i16* %17
%18 = load i16*, i16** %2
%19 = load i16, i16* %18
%20 = zext i16 %19 to i32
%21 = shl i32 %20, 8
%22 = trunc i32 %21 to i16
%23 = load i16*, i16** %2
store i16 %22, i16* %23
%24 = load i8, i8* %3
%25 = zext i8 %24 to i16
%26 = zext i16 %25 to i32
%27 = load i16*, i16** %2
%28 = load i16, i16* %27
%29 = zext i16 %28 to i32
%30 = add nsw i32 %29, %26
%31 = trunc i32 %30 to i16
store i16 %31, i16* %27
ret void
}

LLVM IR (-O2):
define void @rotate(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
store i16 %3, i16* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Toggle();
void WaterPumpC__Leds__led1Toggle(void) { LedsP__Leds__led1Toggle(); }


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

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

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

LLVM IR (-O2):
define void @WaterPumpC__Leds__led1Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}
int compute(left, right, sign) {
  switch (sign) {
  case '+':
    return left + right;
  case '-':
    return left - right;
  case '*':
    return left * right;
  case '/':
    return left / right;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffd6,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     1170 <compute+0x70>
mov    -0x18(%rbp),%rax
lea    0xed3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <compute+0x77>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <compute+0x77>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <compute+0x77>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1177 <compute+0x77>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute>:
xor    %eax,%eax
add    $0xffffffd6,%edx
cmp    $0x5,%edx
ja     112f <compute+0x2f>
lea    0xeef(%rip),%rcx
movslq (%rcx,%rdx,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
imul   %edi,%esi
mov    %esi,%eax
ret
add    %edi,%esi
mov    %esi,%eax
ret
sub    %esi,%edi
mov    %edi,%eax
ret
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @compute(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
switch i32 %8, label %25 [
i32 43, label %9
i32 45, label %13
i32 42, label %17
i32 47, label %21
]
9: ; preds = %3
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
store i32 %12, i32* %4
br label %26
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %4
br label %26
17: ; preds = %3
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = mul nsw i32 %18, %19
store i32 %20, i32* %4
br label %26
21: ; preds = %3
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = sdiv i32 %22, %23
store i32 %24, i32* %4
br label %26
25: ; preds = %3
store i32 0, i32* %4
br label %26
26: ; preds = %25, %21, %17, %13, %9
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @compute(i32 %0, i32 %1, i32 %2) {
switch i32 %2, label %12 [
i32 43, label %4
i32 45, label %6
i32 42, label %8
i32 47, label %10
]
4: ; preds = %3
%5 = add nsw i32 %1, %0
br label %12
6: ; preds = %3
%7 = sub nsw i32 %0, %1
br label %12
8: ; preds = %3
%9 = mul nsw i32 %1, %0
br label %12
10: ; preds = %3
%11 = sdiv i32 %0, %1
br label %12
12: ; preds = %3, %10, %8, %6, %4
%13 = phi i32 [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ foo3();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("in main\n");
  foo();
  foo3();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <foo@plt>
mov    $0x0,%al
call   1050 <foo3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <foo@plt>
xor    %eax,%eax
call   1050 <foo3@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"in main\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @foo()
%4 = call i32 (...) @foo3()
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"in main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo3()
ret i32 0
}
char minusculas(char x) {
  x += 32;
  return x;
}


x86 assembly (clang, -O0):
<minusculas>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minusculas>:
lea    0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @minusculas(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = add nsw i32 %4, 32
%6 = trunc i32 %5 to i8
store i8 %6, i8* %2
%7 = load i8, i8* %2
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @minusculas(i8 signext %0) {
%2 = add i8 %0, 32
ret i8 %2
}
int test_imm_50int8_mem(signed char *val) {
  return ((*val) & (-0x50 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_50int8_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, -80
%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_50int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -80
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
unsigned long __get_free_page(unsigned int flags) {
  return (unsigned long)malloc((4096));
}


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

x86 assembly (clang, -O2):
<__get_free_page>:
mov    $0x1000,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i64 @__get_free_page(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 @malloc(i32 4096)
ret i64 %3
}

LLVM IR (-O2):
define i64 @__get_free_page(i32 %0) {
%2 = tail call i64 @malloc(i32 4096)
ret i64 %2
}
int toupper(int x) { return x + 32; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
lea    0x20(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add nsw i32 %0, 32
ret i32 %2
}
int hash(char c) {
  switch (c) {
  case '(':
    return 0;
  case '[':
    return 1;
  case '{':
    return 2;
  case ')':
    return 3;
  case ']':
    return 4;
  default:
    return 5;
  }
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x28,%eax
je     1163 <hash+0x63>
jmp    111f <hash+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x29,%eax
je     1187 <hash+0x87>
jmp    1130 <hash+0x30>
mov    -0xc(%rbp),%eax
sub    $0x5b,%eax
je     116f <hash+0x6f>
jmp    1141 <hash+0x41>
mov    -0xc(%rbp),%eax
sub    $0x5d,%eax
je     1193 <hash+0x93>
jmp    1152 <hash+0x52>
mov    -0xc(%rbp),%eax
sub    $0x7b,%eax
je     117b <hash+0x7b>
jmp    119f <hash+0x9f>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <hash+0xa6>
movl   $0x1,-0x4(%rbp)
jmp    11a6 <hash+0xa6>
movl   $0x2,-0x4(%rbp)
jmp    11a6 <hash+0xa6>
movl   $0x3,-0x4(%rbp)
jmp    11a6 <hash+0xa6>
movl   $0x4,-0x4(%rbp)
jmp    11a6 <hash+0xa6>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
cmp    $0x5a,%edi
jle    111a <hash+0x1a>
cmp    $0x7b,%edi
je     112c <hash+0x2c>
cmp    $0x5d,%edi
je     1132 <hash+0x32>
cmp    $0x5b,%edi
jne    1138 <hash+0x38>
mov    $0x1,%eax
ret
xor    %eax,%eax
cmp    $0x28,%edi
je     113d <hash+0x3d>
cmp    $0x29,%edi
jne    1138 <hash+0x38>
mov    $0x3,%eax
ret
mov    $0x2,%eax
ret
mov    $0x4,%eax
ret
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %11 [
i32 40, label %6
i32 91, label %7
i32 123, label %8
i32 41, label %9
i32 93, label %10
]
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
store i32 1, i32* %2
br label %12
8: ; preds = %1
store i32 2, i32* %2
br label %12
9: ; preds = %1
store i32 3, i32* %2
br label %12
10: ; preds = %1
store i32 4, i32* %2
br label %12
11: ; preds = %1
store i32 5, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %7 [
i32 40, label %8
i32 91, label %3
i32 123, label %4
i32 41, label %5
i32 93, label %6
]
3: ; preds = %1
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4, %3
%9 = phi i32 [ 5, %7 ], [ 4, %6 ], [ 3, %5 ], [ 2, %4 ], [ 1, %3 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ C_FILENO(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  C_FILENO(stdin);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <C_FILENO@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stdin
%3 = call i32 @C_FILENO(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @C_FILENO(i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fsetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void pc_resetsrc(void *handle, void *position) {
  assert(handle != NULL);
  fsetpos((FILE *)handle, (fpos_t *)position);
}


x86 assembly (clang, -O0):
<pc_resetsrc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fsetpos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pc_resetsrc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fsetpos@plt>

LLVM IR (-O0):
define void @pc_resetsrc(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 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i32*
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i32*
%13 = call i32 @fsetpos(i32* %10, i32* %12)
ret void
}

LLVM IR (-O2):
define void @pc_resetsrc(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast i8* %0 to i32*
%7 = bitcast i8* %1 to i32*
%8 = tail call i32 @fsetpos(i32* %6, i32* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ blah();
void foo(int value) {
  switch (value) {
  case 40:
  case 42:
    if (value != 42)
      abort();
  case 50:
    blah();
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x28,%eax
je     1161 <foo+0x41>
jmp    113f <foo+0x1f>
mov    -0x8(%rbp),%eax
sub    $0x2a,%eax
je     1161 <foo+0x41>
jmp    1150 <foo+0x30>
mov    -0x8(%rbp),%eax
sub    $0x32,%eax
je     1177 <foo+0x57>
jmp    117e <foo+0x5e>
cmpl   $0x2a,-0x4(%rbp)
je     1172 <foo+0x52>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1177 <foo+0x57>
mov    $0x0,%al
call   1040 <blah@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmp    $0x2a,%edi
je     1130 <foo+0x10>
cmp    $0x32,%edi
je     1130 <foo+0x10>
cmp    $0x28,%edi
je     1137 <foo+0x17>
ret
xor    %eax,%eax
jmp    1040 <blah@plt>
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %12 [
i32 40, label %4
i32 42, label %4
i32 50, label %10
]
4: ; preds = %1, %1
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 42
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %4
br label %10
10: ; preds = %1, %9
%11 = call i32 (...) @blah()
br label %12
12: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
switch i32 %0, label %6 [
i32 50, label %4
i32 42, label %4
i32 40, label %2
]
2: ; preds = %1
%3 = tail call i32 (...) @abort()
unreachable
4: ; preds = %1, %1
%5 = tail call i32 (...) @blah()
br label %6
6: ; preds = %1, %4
ret void
}
int execute_stime() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_stime() {
ret i32 0
}
double f(double x, double y, double z) { return x + y + z; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = load double, double* %6
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @f(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int i;
  for (i = 5000; i >= 0; i = i - 1) {
    printf("-%d", i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1388,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1388,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"-%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 5000, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"-%d\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 5000, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nsw i32 %2, -1
%5 = icmp eq i32 %2, 0
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int isqrt(int);
int main() {
  int r;
  r = isqrt(17);
  return r;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x11,%edi
jmp    1030 <isqrt@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @isqrt(i32 17)
ret i32 %1
}
/* Variables and functions */
scalar_t__ configure_backtrace_handler(int /*<<< orphan*/);
int /*<<< orphan*/ get_version();
int /*<<< orphan*/ tor_log_reset_sigsafe_err_fds();
int subsys_torerr_initialize(void) {
  if (configure_backtrace_handler(get_version()) < 0)
    return -1;
  tor_log_reset_sigsafe_err_fds();
  return 0;
}


x86 assembly (clang, -O0):
<subsys_torerr_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_version@plt>
mov    %eax,%edi
call   1040 <configure_backtrace_handler@plt>
cmp    $0x0,%rax
jge    115c <subsys_torerr_initialize+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <subsys_torerr_initialize+0x3a>
mov    $0x0,%al
call   1030 <tor_log_reset_sigsafe_err_fds@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<subsys_torerr_initialize>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <get_version@plt>
mov    %eax,%edi
call   1040 <configure_backtrace_handler@plt>
test   %rax,%rax
js     114f <subsys_torerr_initialize+0x1f>
xor    %eax,%eax
call   1030 <tor_log_reset_sigsafe_err_fds@plt>
jmp    1154 <subsys_torerr_initialize+0x24>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @subsys_torerr_initialize() {
%1 = alloca i32
%2 = call i32 (...) @get_version()
%3 = call i64 @configure_backtrace_handler(i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 (...) @tor_log_reset_sigsafe_err_fds()
store i32 0, i32* %1
br label %8
8: ; preds = %6, %5
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @subsys_torerr_initialize() {
%1 = tail call i32 (...) @get_version()
%2 = tail call i64 @configure_backtrace_handler(i32 %1)
%3 = icmp slt i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @tor_log_reset_sigsafe_err_fds()
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ 0, %4 ], [ -1, %0 ]
ret i32 %7
}
const char *_Locale_d_t_fmt(struct _Locale_time *__DUMMY_PAR) { return 0; }


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

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

LLVM IR (-O0):
%struct._Locale_time = type opaque
define i8* @_Locale_d_t_fmt(%struct._Locale_time* %0) {
%2 = alloca %struct._Locale_time*
store %struct._Locale_time* %0, %struct._Locale_time** %2
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_time = type opaque
define noalias i8* @_Locale_d_t_fmt(%struct._Locale_time* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int);
scalar_t__ malloc(unsigned int);
int /*<<< orphan*/ stderr;
char *my_malloc(unsigned int nbytes) {
  char *rv;
  rv = (char *)malloc(nbytes);
  if (rv == NULL) {
    fprintf(stderr, "malloc(%u) failed; aborting.\n", nbytes);
    exit(1);
  }
  return rv;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <my_malloc+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <my_malloc+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"malloc(%u) failed; aborting.\0A\00"
define i8* @my_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = load i32, i32* %2
%12 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"malloc(%u) failed; aborting.\0A\00"
define i8* @my_malloc(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
%9 = inttoptr i64 %2 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: predict [options] test_file model_file output_file\n"
         "options:\n"
         "-b probability_estimates: whether to output probability estimates, 0 "
         "or 1 (default 0); currently for logistic regression only\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [194 x i8] c"Usage: predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to output probability estimates, 0 or 1 (default 0); currently for logistic regression only\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [193 x i8] c"Usage: predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to output probability estimates, 0 or 1 (default 0); currently for logistic regression only\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([193 x i8], [193 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
int stcu_d(out, in, outlen)
char *out;
unsigned int in;
int outlen;
{ return (stc_d(out, in, outlen, 0)); }


x86 assembly (clang, -O0):
<stcu_d>:
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
xor    %ecx,%ecx
mov    $0x0,%al
call   1030 <stc_d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stcu_d>:
xor    %ecx,%ecx
xor    %eax,%eax
jmp    1030 <stc_d@plt>

LLVM IR (-O0):
define i32 @stcu_d(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @stc_d to i32 (i8*, i32, i32, i32, ...)*)(i8* %7, i32 %8, i32 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @stcu_d(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, i32, i32, i32, ...) bitcast (i32 (...)* @stc_d to i32 (i8*, i32, i32, i32, ...)*)(i8* %0, i32 %1, i32 %2, i32 0)
ret i32 %4
}