xunge/DecIR huggingface dataset:
/* Type definitions */
struct statvfs {
  int dummy;
};
struct statfs {
  int dummy;
};

/* Variables and functions */
scalar_t__ __fstatfs(int, struct statfs *);
int /*<<< orphan*/ fixup(struct statvfs *, struct statfs *);
int fstatvfs(int fd, struct statvfs *buf) {
  struct statfs kbuf;
  if (__fstatfs(fd, &kbuf) < 0)
    return -1;
  fixup(buf, &kbuf);
  return 0;
}


x86 assembly (clang, -O0):
<fstatvfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <__fstatfs@plt>
cmp    $0x0,%rax
jge    1151 <fstatvfs+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <fstatvfs+0x45>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <fixup@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatvfs>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1040 <__fstatfs@plt>
test   %rax,%rax
js     1148 <fstatvfs+0x28>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <fixup@plt>
xor    %eax,%eax
jmp    114d <fstatvfs+0x2d>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @fstatvfs(i32 %0, %struct.statvfs* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.statvfs*
%6 = alloca %struct.statfs
store i32 %0, i32* %4
store %struct.statvfs* %1, %struct.statvfs** %5
%7 = load i32, i32* %4
%8 = call i64 @__fstatfs(i32 %7, %struct.statfs* %6)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %14
11: ; preds = %2
%12 = load %struct.statvfs*, %struct.statvfs** %5
%13 = call i32 @fixup(%struct.statvfs* %12, %struct.statfs* %6)
store i32 0, i32* %3
br label %14
14: ; preds = %11, %10
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @fstatvfs(i32 %0, %struct.statvfs* %1) {
%3 = alloca %struct.statfs
%4 = bitcast %struct.statfs* %3 to i8*
%5 = call i64 @__fstatfs(i32 %0, %struct.statfs* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @fixup(%struct.statvfs* %1, %struct.statfs* %3)
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %10
}
void gdk_window_process_all_updates() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_process_all_updates() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, void *, void *);
void __attribute__((no_instrument_function))
__cyg_profile_func_exit(void *func, void *caller) {
  printf("x %p %p\n", func, caller);
}


x86 assembly (clang, -O0):
<__cyg_profile_func_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"x %p %p\0A\00"
define void @__cyg_profile_func_exit(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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"x %p %p\0A\00"
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int c_builtin(const char **wp) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @c_builtin(i8** nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_REQ;
typedef int /*<<< orphan*/ EVP_MD;

/* Variables and functions */
int ASN1_item_digest(int /*<<< orphan*/ *, int /*<<< orphan*/ const *, char *,
                     unsigned char *, unsigned int *);
int /*<<< orphan*/ X509_REQ_it;
int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, unsigned char *md,
                    unsigned int *len) {
  return (ASN1_item_digest(&X509_REQ_it, type, (char *)data, md, len));
}


x86 assembly (clang, -O0):
<X509_REQ_digest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    0x2eb9(%rip),%rdi
call   1030 <ASN1_item_digest@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_REQ_digest>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rdi,%rdx
mov    0x2ed8(%rip),%rdi
jmp    1030 <ASN1_item_digest@plt>

LLVM IR (-O0):
@X509_REQ_it = global i32 0
define i32 @X509_REQ_digest(i32* %0, i32* %1, i8* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = load i32*, i32** %5
%11 = bitcast i32* %10 to i8*
%12 = load i8*, i8** %7
%13 = load i32*, i32** %8
%14 = call i32 @ASN1_item_digest(i32* @X509_REQ_it, i32* %9, i8* %11, i8* %12, i32* %13)
ret i32 %14
}

LLVM IR (-O2):
@X509_REQ_it = global i32 0
define i32 @X509_REQ_digest(i32* %0, i32* %1, i8* %2, i32* %3) {
%5 = bitcast i32* %0 to i8*
%6 = tail call i32 @ASN1_item_digest(i32* @X509_REQ_it, i32* %1, i8* %5, i8* %2, i32* %3)
ret i32 %6
}
/* Variables and functions */
int sqrt(int);
double f(double x) {
  return ((x + sqrt(x)) * ((20 - x) + (sqrt(20 - x))) - 155.55);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <sqrt@plt>
movsd  -0x20(%rbp),%xmm0
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebd(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeab(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %eax,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe77(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xebe(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x8(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
addsd  0xe98(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = call i32 @sqrt(i32 %5)
%7 = sitofp i32 %6 to double
%8 = fadd double %3, %7
%9 = load double, double* %2
%10 = fsub double 2.000000e+01, %9
%11 = load double, double* %2
%12 = fsub double 2.000000e+01, %11
%13 = fptosi double %12 to i32
%14 = call i32 @sqrt(i32 %13)
%15 = sitofp i32 %14 to double
%16 = fadd double %10, %15
%17 = call double @llvm.fmuladd.f64(double %8, double %16, double -1.555500e+02)
ret double %17
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fptosi double %0 to i32
%3 = tail call i32 @sqrt(i32 %2)
%4 = sitofp i32 %3 to double
%5 = fadd double %4, %0
%6 = fsub double 2.000000e+01, %0
%7 = fptosi double %6 to i32
%8 = tail call i32 @sqrt(i32 %7)
%9 = sitofp i32 %8 to double
%10 = fadd double %6, %9
%11 = tail call double @llvm.fmuladd.f64(double %5, double %10, double -1.555500e+02)
ret double %11
}
int atoi(char *str) {
  int res = 0;
  for (int i = 0; str[i] != '\0'; i += 1) {
    res = res * 10 + str[i] - '0';
  }
  return res;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <atoi+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <atoi+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <atoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %14, %6 ], [ 0, %1 ]
%8 = phi i8 [ %16, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = sext i8 %8 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
void libmsopenh264_init() {}


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

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

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

LLVM IR (-O2):
define void @libmsopenh264_init() {
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
int get_ms(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
}


x86 assembly (clang, -O0):
<get_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ms>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x32,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_ms() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000000
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @get_ms() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000000
%11 = add nsw i32 %10, %7
ret i32 %11
}
int round_own(double d) { return (d - (int)d < 0.5) ? (int)d : (int)d + 1; }


x86 assembly (clang, -O0):
<round_own>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
cvttsd2si -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
subsd  %xmm0,%xmm1
movsd  0xedd(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    113a <round_own+0x3a>
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1145 <round_own+0x45>
cvttsd2si -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_own>:
cvttsd2si %xmm0,%ecx
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
movsd  0xee8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @round_own(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
%6 = sitofp i32 %5 to double
%7 = fsub double %3, %6
%8 = fcmp olt double %7, 5.000000e-01
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load double, double* %2
%11 = fptosi double %10 to i32
br label %16
12: ; preds = %1
%13 = load double, double* %2
%14 = fptosi double %13 to i32
%15 = add nsw i32 %14, 1
br label %16
16: ; preds = %12, %9
%17 = phi i32 [ %11, %9 ], [ %15, %12 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @round_own(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fcmp uge double %4, 5.000000e-01
%6 = zext i1 %5 to i32
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvCaptureFrameToPhysicalAddr(unsigned long ulBoardNum, void **hEvent,
                                 unsigned long ulFlags, unsigned long pPhysAddr,
                                 void *pKrnlAddr) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvCaptureFrameToPhysicalAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureFrameToPhysicalAddr(i64 %0, i8** %1, i64 %2, i64 %3, i8* %4) {
%6 = alloca i64
%7 = alloca i8**
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
store i64 %0, i64* %6
store i8** %1, i8*** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvCaptureFrameToPhysicalAddr(i64 %0, i8** nocapture readnone %1, i64 %2, i64 %3, i8* nocapture readnone %4) {
%6 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ dcac_info_ops(int, int, int /*<<< orphan*/ *, int *, int);
int dcac_get_attr_fd_list(int *buf, int bufsize) {
  return (int)dcac_info_ops(62, -1, NULL, buf, bufsize);
}


x86 assembly (clang, -O0):
<dcac_get_attr_fd_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    $0x3e,%edi
mov    $0xffffffff,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <dcac_info_ops@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcac_get_attr_fd_list>:
mov    %esi,%r8d
mov    %rdi,%rcx
mov    $0x3e,%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
jmp    1030 <dcac_info_ops@plt>

LLVM IR (-O0):
define i32 @dcac_get_attr_fd_list(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 i64 @dcac_info_ops(i32 62, i32 -1, i32* null, i32* %5, i32 %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dcac_get_attr_fd_list(i32* %0, i32 %1) {
%3 = tail call i64 @dcac_info_ops(i32 62, i32 -1, i32* null, i32* %0, i32 %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ qc_imag_writergb(void *, int, unsigned short, unsigned short,
                                    unsigned short);
void qc_imag_writergb10(void *addr, int bpp, unsigned short r, unsigned short g,
                        unsigned short b) {
  qc_imag_writergb(addr, bpp, r >> 2, g >> 2, b >> 2);
}


x86 assembly (clang, -O0):
<qc_imag_writergb10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8w,%ax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %dx,-0xe(%rbp)
mov    %cx,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movzwl -0xe(%rbp),%eax
sar    $0x2,%eax
mov    %ax,%dx
movzwl -0x10(%rbp),%eax
sar    $0x2,%eax
mov    %ax,%cx
movzwl -0x12(%rbp),%eax
sar    $0x2,%eax
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl %ax,%r8d
call   1030 <qc_imag_writergb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qc_imag_writergb10>:
shr    $0x2,%edx
shr    $0x2,%ecx
shr    $0x2,%r8d
jmp    1030 <qc_imag_writergb@plt>

LLVM IR (-O0):
define void @qc_imag_writergb10(i8* %0, i32 %1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i16
store i8* %0, i8** %6
store i32 %1, i32* %7
store i16 %2, i16* %8
store i16 %3, i16* %9
store i16 %4, i16* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i16, i16* %8
%14 = zext i16 %13 to i32
%15 = ashr i32 %14, 2
%16 = trunc i32 %15 to i16
%17 = load i16, i16* %9
%18 = zext i16 %17 to i32
%19 = ashr i32 %18, 2
%20 = trunc i32 %19 to i16
%21 = load i16, i16* %10
%22 = zext i16 %21 to i32
%23 = ashr i32 %22, 2
%24 = trunc i32 %23 to i16
%25 = call i32 @qc_imag_writergb(i8* %11, i32 %12, i16 zeroext %16, i16 zeroext %20, i16 zeroext %24)
ret void
}

LLVM IR (-O2):
define void @qc_imag_writergb10(i8* %0, i32 %1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %4) {
%6 = lshr i16 %2, 2
%7 = lshr i16 %3, 2
%8 = lshr i16 %4, 2
%9 = tail call i32 @qc_imag_writergb(i8* %0, i32 %1, i16 zeroext %6, i16 zeroext %7, i16 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
void button_press(float x, float y) {
  printf("User clicked a button at coordinates (%f, %f)\n", x, y);
}


x86 assembly (clang, -O0):
<button_press>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [47 x i8] c"User clicked a button at coordinates (%f, %f)\0A\00"
define void @button_press(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), float %5, float %6)
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"User clicked a button at coordinates (%f, %f)\0A\00"
define void @button_press(float %0, float %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), float %0, float %1)
ret void
}
void call0e(char c1, long l, char c2, int i, char c3, short s, char c4,
            char c5) {
  c1 = 'a';
  l = 5;
  c2 = 'b';
  i = 7;
  c3 = 'c';
  s = 7;
  c4 = 'f';
  c5 = 'g';
}


x86 assembly (clang, -O0):
<call0e>:
push   %rbp
mov    %rsp,%rbp
mov    %r8d,-0x34(%rbp)
mov    %ecx,%eax
mov    -0x34(%rbp),%ecx
mov    %eax,-0x30(%rbp)
mov    %edx,%eax
mov    -0x30(%rbp),%edx
mov    %eax,-0x2c(%rbp)
mov    %rsi,%rax
mov    -0x2c(%rbp),%esi
mov    %rax,-0x28(%rbp)
mov    %edi,%r8d
mov    -0x28(%rbp),%rdi
mov    %r9w,%ax
mov    0x18(%rbp),%r9b
mov    0x10(%rbp),%r9b
mov    %r8b,-0x1(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    %cl,-0x19(%rbp)
mov    %ax,-0x1c(%rbp)
movb   $0x61,-0x1(%rbp)
movq   $0x5,-0x10(%rbp)
movb   $0x62,-0x11(%rbp)
movl   $0x7,-0x18(%rbp)
movb   $0x63,-0x19(%rbp)
movw   $0x7,-0x1c(%rbp)
movb   $0x66,0x10(%rbp)
movb   $0x67,0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @call0e(i8 signext %0, i64 %1, i8 signext %2, i32 %3, i8 signext %4, i16 signext %5, i8 signext %6, i8 signext %7) {
%9 = alloca i8
%10 = alloca i64
%11 = alloca i8
%12 = alloca i32
%13 = alloca i8
%14 = alloca i16
%15 = alloca i8
%16 = alloca i8
store i8 %0, i8* %9
store i64 %1, i64* %10
store i8 %2, i8* %11
store i32 %3, i32* %12
store i8 %4, i8* %13
store i16 %5, i16* %14
store i8 %6, i8* %15
store i8 %7, i8* %16
store i8 97, i8* %9
store i64 5, i64* %10
store i8 98, i8* %11
store i32 7, i32* %12
store i8 99, i8* %13
store i16 7, i16* %14
store i8 102, i8* %15
store i8 103, i8* %16
ret void
}

LLVM IR (-O2):
define void @call0e(i8 signext %0, i64 %1, i8 signext %2, i32 %3, i8 signext %4, i16 signext %5, i8 signext %6, i8 signext %7) {
ret void
}
int main(int argc, char **argv) {
  int __attribute__((unit(m))) a;
  int b = a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int test_imm_5Aint8_reg(signed char val) {
  return ((val) & (-0x5A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Aint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffffa6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_5Aint8_reg(i8 signext %0) {
%2 = and i8 %0, -90
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double atan(double);
double cos(double);
double sin(double);
double first_angle(double x, double y, double sec_angle) {
  double angle;
  angle = atan(y / x) -
          atan((0.36 * sin(sec_angle)) / (0.36 + 0.36 * cos(sec_angle)));
  return angle;
}


x86 assembly (clang, -O0):
<first_angle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
call   1040 <atan@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xe90(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <cos@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
movsd  0xe6d(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1040 <atan@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first_angle>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <atan@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0xea2(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1050 <cos@plt>
movsd  0xe8a(%rip),%xmm1
mulsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <atan@plt>
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @first_angle(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = call double @atan(double %10)
%12 = load double, double* %6
%13 = call double @sin(double %12)
%14 = fmul double 3.600000e-01, %13
%15 = load double, double* %6
%16 = call double @cos(double %15)
%17 = call double @llvm.fmuladd.f64(double 3.600000e-01, double %16, double 3.600000e-01)
%18 = fdiv double %14, %17
%19 = call double @atan(double %18)
%20 = fsub double %11, %19
store double %20, double* %7
%21 = load double, double* %7
ret double %21
}

LLVM IR (-O2):
define double @first_angle(double %0, double %1, double %2) {
%4 = fdiv double %1, %0
%5 = tail call double @atan(double %4)
%6 = tail call double @sin(double %2)
%7 = fmul double %6, 3.600000e-01
%8 = tail call double @cos(double %2)
%9 = tail call double @llvm.fmuladd.f64(double %8, double 3.600000e-01, double 3.600000e-01)
%10 = fdiv double %7, %9
%11 = tail call double @atan(double %10)
%12 = fsub double %5, %11
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int viewtags_string_match(char *pattern, char *string) {
  if (strstr(string, pattern) == NULL)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<viewtags_string_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
jne    1143 <viewtags_string_match+0x33>
movl   $0x0,-0x4(%rbp)
jmp    114a <viewtags_string_match+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<viewtags_string_match>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @viewtags_string_match(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i8*, i8** %4
%8 = call i32* @strstr(i8* %6, i8* %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %12
11: ; preds = %2
store i32 1, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @viewtags_string_match(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
void WebPInitConvertARGBToYUVNEON(void) {}


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

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

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

LLVM IR (-O2):
define void @WebPInitConvertARGBToYUVNEON() {
ret void
}
/* Variables and functions */
int strlen(char const *);
char next_lastchar(const char *string) {
  int length;
  if (string == NULL)
    return ('\0');
  length = strlen(string);
  if (length >= 2)
    return (string[length - 2]);
  else
    return ('\0');
}


x86 assembly (clang, -O0):
<next_lastchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1130 <next_lastchar+0x20>
movb   $0x0,-0x1(%rbp)
jmp    1162 <next_lastchar+0x52>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jl     115e <next_lastchar+0x4e>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
jmp    1162 <next_lastchar+0x52>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_lastchar>:
push   %rbx
test   %rdi,%rdi
je     112b <next_lastchar+0x1b>
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x2,%eax
jl     112b <next_lastchar+0x1b>
add    $0xfffffffe,%eax
mov    (%rbx,%rax,1),%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @next_lastchar(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp sgt i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = add nsw i32 %4, -2
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
br label %11
11: ; preds = %3, %1, %6
%12 = phi i8 [ %10, %6 ], [ 0, %1 ], [ 0, %3 ]
ret i8 %12
}
int bcmp(from, to, count)
char *from, *to;
int count;
{
  int rtnval = 0;
  while (count-- > 0) {
    if (*from++ != *to++) {
      rtnval = 1;
      break;
    }
  }
  return (rtnval);
}


x86 assembly (clang, -O0):
<bcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
jle    1167 <bcmp+0x67>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1162 <bcmp+0x62>
movl   $0x1,-0x18(%rbp)
jmp    1167 <bcmp+0x67>
jmp    1116 <bcmp+0x16>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcmp>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
test   %edx,%edx
jle    112e <bcmp+0x2e>
add    $0xffffffff,%edx
movzbl (%rdi,%rcx,1),%r8d
lea    0x1(%rcx),%r9
cmp    (%rsi,%rcx,1),%r8b
mov    %r9,%rcx
je     1110 <bcmp+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @bcmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %11, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %10, %9 ]
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = add nsw i32 %7, -1
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %5
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = icmp eq i8 %12, %14
br i1 %15, label %4, label %16
16: ; preds = %9, %4
%17 = phi i32 [ 0, %4 ], [ 1, %9 ]
ret i32 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ HandleProgressiveIntSkippy(int /*<<< orphan*/);
void Push8BitIntegerSkippy(int8_t dat) {
  HandleProgressiveIntSkippy(dat);
  HandleProgressiveIntSkippy(dat);
}


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

x86 assembly (clang, -O2):
<Push8BitIntegerSkippy>:
push   %rbx
mov    %edi,%ebx
call   1030 <HandleProgressiveIntSkippy@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <HandleProgressiveIntSkippy@plt>

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

LLVM IR (-O2):
define void @Push8BitIntegerSkippy(i32 %0) {
%2 = tail call i32 @HandleProgressiveIntSkippy(i32 %0)
%3 = tail call i32 @HandleProgressiveIntSkippy(i32 %0)
ret void
}
int blah() {
  static float test = 0;
  test++;
}


x86 assembly (clang, -O0):
<blah>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
addss  0x2f10(%rip),%xmm0
movss  %xmm0,0x2f08(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<blah>:
movss  0x2f1c(%rip),%xmm0
addss  0xef0(%rip),%xmm0
movss  %xmm0,0x2f0c(%rip)
ret

LLVM IR (-O0):
@blah.test = internal global float 0.000000e+00
define i32 @blah() {
%1 = alloca i32
%2 = load float, float* @blah.test
%3 = fadd float %2, 1.000000e+00
store float %3, float* @blah.test
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@blah.test = internal unnamed_addr global float 0.000000e+00
define i32 @blah() {
%1 = load float, float* @blah.test
%2 = fadd float %1, 1.000000e+00
store float %2, float* @blah.test
ret i32 undef
}
int code2unit(unsigned char code) {
  static int units[] = {13, 5, 3, 11, 15, 7, 1, 9, 14, 6, 4, 12, 16, 8, 2, 10};
  return units[code & 0x0fu];
}


x86 assembly (clang, -O0):
<code2unit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %eax,%eax
mov    %eax,%ecx
lea    0x2f14(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<code2unit>:
and    $0xf,%edi
lea    0xef6(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

LLVM IR (-O0):
@code2unit.units = internal global [16 x i32] [i32 13, i32 5, i32 3, i32 11, i32 15, i32 7, i32 1, i32 9, i32 14, i32 6, i32 4, i32 12, i32 16, i32 8, i32 2, i32 10]
define i32 @code2unit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 15
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [16 x i32], [16 x i32]* @code2unit.units, i64 0, i64 %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
@code2unit.units = internal unnamed_addr constant [16 x i32] [i32 13, i32 5, i32 3, i32 11, i32 15, i32 7, i32 1, i32 9, i32 14, i32 6, i32 4, i32 12, i32 16, i32 8, i32 2, i32 10]
define i32 @code2unit(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = zext i8 %2 to i64
%4 = getelementptr inbounds [16 x i32], [16 x i32]* @code2unit.units, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
double predict(double x, double a, double z) { return x + a * (z - x); }


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

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

LLVM IR (-O0):
define double @predict(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 = load double, double* %6
%10 = load double, double* %4
%11 = fsub double %9, %10
%12 = call double @llvm.fmuladd.f64(double %8, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @predict(double %0, double %1, double %2) {
%4 = fsub double %2, %0
%5 = tail call double @llvm.fmuladd.f64(double %1, double %4, double %0)
ret double %5
}
/* Variables and functions */
scalar_t__ sin(double);
float sinf(float x) { return (float)sin((double)x); }


x86 assembly (clang, -O0):
<sinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @sin(double %4)
%6 = sitofp i64 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @sinf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @sin(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
long exchange(long *src, long dst) {
  long temp = *src;
  *src = dst;
  return temp;
}


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

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

LLVM IR (-O0):
define i64 @exchange(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
store i64 %7, i64* %5
%8 = load i64, i64* %4
%9 = load i64*, i64** %3
store i64 %8, i64* %9
%10 = load i64, i64* %5
ret i64 %10
}

LLVM IR (-O2):
define i64 @exchange(i64* nocapture %0, i64 %1) {
%3 = load i64, i64* %0
store i64 %1, i64* %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  unsigned int i, j;
  switch (i) {
  case 10:
    j = 10;
    break;
  default:;
    j = i + 1;
  }
  assert(j == i + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
jne    113c <main+0x2c>
jmp    1130 <main+0x20>
movl   $0xa,-0xc(%rbp)
jmp    1145 <main+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* %2
switch i32 %4, label %6 [
i32 10, label %5
]
5: ; preds = %0
store i32 10, i32* %3
br label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = add i32 %7, 1
store i32 %8, i32* %3
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = add i32 %11, 1
%13 = icmp eq i32 %10, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int check_exist(char *fname) {
  FILE *fp;
  if ((fp = fopen(fname, "r"))) {
    fclose(fp);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_exist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     115f <check_exist+0x3f>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <check_exist+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_exist>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <check_exist+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @check_exist(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun(int a) { printf("i'm in %d function\n", a); }


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

x86 assembly (clang, -O2):
<fun>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"i'm in %d function\0A\00"
define void @fun(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"i'm in %d function\0A\00"
define void @fun(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int strcmp(char *one, char *another) {
  for (; *one == *another; ++one, ++another)
    if (*one == '\0')
      return 0;
  return *one - *another;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1160 <strcmp+0x60>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113e <strcmp+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1173 <strcmp+0x73>
jmp    1143 <strcmp+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
mov    (%rsi),%cl
cmp    %cl,%al
jne    1124 <strcmp+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %al,%al
je     112d <strcmp+0x2d>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
cmp    %cl,%al
je     1110 <strcmp+0x10>
movsbl %al,%eax
movsbl %cl,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %9, %12
br i1 %13, label %14, label %26
14: ; preds = %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %34
20: ; preds = %14
br label %21
21: ; preds = %20
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
%24 = load i8*, i8** %5
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %5
br label %6
26: ; preds = %6
%27 = load i8*, i8** %4
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %29, %32
store i32 %33, i32* %3
br label %34
34: ; preds = %26, %19
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %11, %2
%18 = phi i8 [ %3, %2 ], [ %14, %11 ]
%19 = phi i8 [ %4, %2 ], [ %15, %11 ]
%20 = sext i8 %18 to i32
%21 = sext i8 %19 to i32
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %6, %17
%24 = phi i32 [ %22, %17 ], [ 0, %6 ]
ret i32 %24
}
/* Variables and functions */
int getchar();
int getch(void) {
  int ch, charactr;
  while ((ch = getchar()) != '\n') {
    charactr = ch;
  }
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1136 <getch+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <getch+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
jne    1120 <getch+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getch() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 undef
}