xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ checkPalindrome(char *);
int main() {
  checkPalindrome("palindromeemordnilap");
  checkPalindrome("wataw");
  checkPalindrome("palindrom");
  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 <checkPalindrome@plt>
lea    0xee3(%rip),%rdi
call   1030 <checkPalindrome@plt>
lea    0xedd(%rip),%rdi
call   1030 <checkPalindrome@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"palindromeemordnilap\00"
@.str.1 = [6 x i8] c"wataw\00"
@.str.2 = [10 x i8] c"palindrom\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @checkPalindrome(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @checkPalindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @checkPalindrome(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"palindromeemordnilap\00"
@.str.1 = [6 x i8] c"wataw\00"
@.str.2 = [10 x i8] c"palindrom\00"
define i32 @main() {
%1 = tail call i32 @checkPalindrome(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @checkPalindrome(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @checkPalindrome(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *strcat(char *, char const *);
char *strcatch(char str[], char c) {
  const char buf[2] = {c, '\0'};
  return strcat(str, buf);
}


x86 assembly (clang, -O0):
<strcatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xb(%rbp)
movb   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcatch>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %sil,0xe(%rsp)
movb   $0x0,0xf(%rsp)
lea    0xe(%rsp),%rsi
call   1030 <strcat@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strcatch(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [2 x i8]
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = load i8, i8* %4
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%11 = call i8* @strcat(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcatch(i8* returned %0, i8 signext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %5
%6 = call i8* @strcat(i8* dereferenceable(1) %0, i8* %4)
ret i8* %0
}
float glutGet(int code) { return 0.f; }


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

x86 assembly (clang, -O2):
<glutGet>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @glutGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @glutGet(i32 %0) {
ret float 0.000000e+00
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
void ThreadTerminate(void *Handle) {
  if (Handle) {
    pthread_join(*(pthread_t *)Handle, NULL);
    free((pthread_t *)Handle);
  }
}


x86 assembly (clang, -O0):
<ThreadTerminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <ThreadTerminate+0x2f>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_join@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreadTerminate>:
test   %rdi,%rdi
je     113b <ThreadTerminate+0x1b>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
xor    %esi,%esi
call   1040 <pthread_join@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @ThreadTerminate(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @pthread_join(i32 %5, i32* null)
%7 = tail call i32 @free(i32* %4)
br label %8
8: ; preds = %3, %1
ret void
}
char *hide_hide(char *buff) {
  int i;
  char *p;
  for (p = buff, i = 0; *p; p++, i++)
    *p = *p - 16 + (i %= 10);
  return buff;
}


x86 assembly (clang, -O0):
<hide_hide>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <hide_hide+0x66>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
sub    $0x10,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x1c(%rbp),%eax
mov    %edx,-0xc(%rbp)
add    %edx,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <hide_hide+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_hide>:
mov    %rdi,%rax
mov    (%rdi),%r8b
test   %r8b,%r8b
je     115f <hide_hide+0x5f>
lea    0x1(%rax),%rcx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movslq %esi,%rsi
imul   $0x66666667,%rsi,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    %edi,%edi
lea    (%rdi,%rdi,4),%edx
mov    %esi,%edi
sub    %edx,%edi
add    %r8b,%dil
add    $0xf0,%dil
mov    %dil,-0x1(%rcx)
neg    %edx
add    %edx,%esi
add    $0x1,%esi
movzbl (%rcx),%r8d
add    $0x1,%rcx
test   %r8b,%r8b
jne    1120 <hide_hide+0x20>
ret

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

LLVM IR (-O2):
define i8* @hide_hide(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %14, %4 ], [ %2, %1 ]
%6 = phi i8* [ %12, %4 ], [ %0, %1 ]
%7 = phi i32 [ %13, %4 ], [ 0, %1 ]
%8 = srem i32 %7, 10
%9 = trunc i32 %8 to i8
%10 = add nsw i8 %9, -16
%11 = add i8 %10, %5
store i8 %11, i8* %6
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = add nsw i32 %8, 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
ret i8* %0
}
float vdot(const float *v1, const float *v2) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<vdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @vdot(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 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @vdot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Variables and functions */
int fpclassifyf(float);
int __pruabi_fpclassifyf(float a) { return fpclassifyf(a); }


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

x86 assembly (clang, -O2):
<__pruabi_fpclassifyf>:
jmp    1030 <fpclassifyf@plt>

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

LLVM IR (-O2):
define i32 @__pruabi_fpclassifyf(float %0) {
%2 = tail call i32 @fpclassifyf(float %0)
ret i32 %2
}
/* Variables and functions */
double sqrt(int);
extern double CommonGetDistance(int ay, int ax, int by, int bx) {
  return sqrt((ay - by) * (ay - by) + (ax - bx) * (ax - bx));
}


x86 assembly (clang, -O0):
<CommonGetDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
mov    -0x4(%rbp),%eax
sub    -0xc(%rbp),%eax
imul   %eax,%edi
mov    -0x8(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
add    %eax,%edi
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommonGetDistance>:
sub    %edx,%edi
imul   %edi,%edi
sub    %ecx,%esi
imul   %esi,%esi
add    %esi,%edi
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @CommonGetDistance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %7
%14 = sub nsw i32 %12, %13
%15 = mul nsw i32 %11, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = sub nsw i32 %16, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %8
%21 = sub nsw i32 %19, %20
%22 = mul nsw i32 %18, %21
%23 = add nsw i32 %15, %22
%24 = call double @sqrt(i32 %23)
ret double %24
}

LLVM IR (-O2):
define double @CommonGetDistance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = mul nsw i32 %5, %5
%7 = sub nsw i32 %1, %3
%8 = mul nsw i32 %7, %7
%9 = add nuw nsw i32 %8, %6
%10 = tail call double @sqrt(i32 %9)
ret double %10
}
void declare_interval(char *name, int count) {}


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

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

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

LLVM IR (-O2):
define void @declare_interval(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int lrint(double);
int double_to_d6(double x) { return lrint(x * 64); }


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

x86 assembly (clang, -O2):
<double_to_d6>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <lrint@plt>

LLVM IR (-O0):
define i32 @double_to_d6(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 6.400000e+01
%5 = call i32 @lrint(double %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @double_to_d6(double %0) {
%2 = fmul double %0, 6.400000e+01
%3 = tail call i32 @lrint(double %2)
ret i32 %3
}
unsigned short int f5(unsigned short int x, unsigned int y) {
  return (x << y) | (x >> (8 * 2 - y));
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
movzwl -0x2(%rbp),%edx
mov    $0x10,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%ax
ret

LLVM IR (-O0):
define zeroext i16 @f5(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = load i16, i16* %3
%10 = zext i16 %9 to i32
%11 = load i32, i32* %4
%12 = sub i32 16, %11
%13 = ashr i32 %10, %12
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @f5(i16 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i16
%4 = tail call i16 @llvm.fshl.i16(i16 %0, i16 %0, i16 %3)
ret i16 %4
}
void kverror(char *s) {}


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

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

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

LLVM IR (-O2):
define void @kverror(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int is_dir(const char *path) {
  struct stat st;
  if (path && stat(path, &st) >= 0)
    return S_ISDIR(st.st_mode);
  return 0;
}


x86 assembly (clang, -O0):
<is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <is_dir+0x3e>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
jl     115e <is_dir+0x3e>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,-0x4(%rbp)
jmp    1165 <is_dir+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dir>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
test   %rdi,%rdi
je     1146 <is_dir+0x26>
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
test   %rax,%rax
js     1146 <is_dir+0x26>
mov    0x8(%rsp),%edi
call   1030 <S_ISDIR@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @is_dir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %12, label %5
5: ; preds = %1
%6 = call i64 @stat(i8* %0, %struct.stat* %2)
%7 = icmp sgt i64 %6, -1
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @S_ISDIR(i32 %10)
br label %12
12: ; preds = %1, %5, %8
%13 = phi i32 [ %11, %8 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ uproc_protresult_free(void *);
void map_list_protresult_free(void *value, void *opaque) {
  (void)opaque;
  uproc_protresult_free(value);
}


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

x86 assembly (clang, -O2):
<map_list_protresult_free>:
jmp    1030 <uproc_protresult_free@plt>

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

LLVM IR (-O2):
define void @map_list_protresult_free(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32 @uproc_protresult_free(i8* %0)
ret void
}
/* Variables and functions */
float Cos(float);
float Sin(float);
float RotatePointY(float x, float y, float centerX, float centerY,
                   float degrees) {
  float dx = x - centerX;
  float dy = y - centerY;
  return (Sin(degrees) * dx) - (Cos(degrees) * dy) + centerY;
}


x86 assembly (clang, -O0):
<RotatePointY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
call   1030 <Sin@plt>
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
call   1040 <Cos@plt>
movss  -0x24(%rbp),%xmm2
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RotatePointY>:
sub    $0x18,%rsp
movss  %xmm4,0x4(%rsp)
movss  %xmm3,0x14(%rsp)
subss  %xmm2,%xmm0
movss  %xmm0,0x10(%rsp)
subss  %xmm3,%xmm1
movss  %xmm1,0xc(%rsp)
movaps %xmm4,%xmm0
call   1030 <Sin@plt>
movss  %xmm0,0x8(%rsp)
movss  0x4(%rsp),%xmm0
call   1040 <Cos@plt>
mulss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mulss  0x10(%rsp),%xmm1
subss  %xmm0,%xmm1
addss  0x14(%rsp),%xmm1
movaps %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @RotatePointY(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%13 = load float, float* %6
%14 = load float, float* %8
%15 = fsub float %13, %14
store float %15, float* %11
%16 = load float, float* %7
%17 = load float, float* %9
%18 = fsub float %16, %17
store float %18, float* %12
%19 = load float, float* %10
%20 = call float @Sin(float %19)
%21 = load float, float* %11
%22 = load float, float* %10
%23 = call float @Cos(float %22)
%24 = load float, float* %12
%25 = fmul float %23, %24
%26 = fneg float %25
%27 = call float @llvm.fmuladd.f32(float %20, float %21, float %26)
%28 = load float, float* %9
%29 = fadd float %27, %28
ret float %29
}

LLVM IR (-O2):
define float @RotatePointY(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %0, %2
%7 = fsub float %1, %3
%8 = tail call float @Sin(float %4)
%9 = tail call float @Cos(float %4)
%10 = fneg float %9
%11 = fmul float %7, %10
%12 = tail call float @llvm.fmuladd.f32(float %8, float %6, float %11)
%13 = fadd float %12, %3
ret float %13
}
/* Variables and functions */
int U_WMRCORENONE_get(char *);
int U_WMR6B_get(void) { return U_WMRCORENONE_get("U_WMR6B"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR6B\00"
define i32 @U_WMR6B_get() {
%1 = call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR6B\00"
define i32 @U_WMR6B_get() {
%1 = tail call i32 @U_WMRCORENONE_get(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
unsigned long long __readeflags();
int /*<<< orphan*/ __writeeflags(unsigned long long);
int /*<<< orphan*/ abort();
int main() {
  unsigned long long int flags = 0xD7;
  __writeeflags(flags);
  flags = __readeflags();
  if ((flags & 0xFF) != 0xD7)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xd7,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <__writeeflags@plt>
mov    $0x0,%al
call   1050 <__readeflags@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xff,%rax
cmp    $0xd7,%rax
je     1178 <main+0x48>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xd7,%edi
call   1040 <__writeeflags@plt>
xor    %eax,%eax
call   1050 <__readeflags@plt>
cmp    $0xd7,%al
jne    114a <main+0x1a>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 215, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @__writeeflags(i64 %3)
%5 = call i64 (...) @__readeflags()
store i64 %5, i64* %2
%6 = load i64, i64* %2
%7 = and i64 %6, 255
%8 = icmp ne i64 %7, 215
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__writeeflags(i64 215)
%2 = tail call i64 (...) @__readeflags()
%3 = and i64 %2, 255
%4 = icmp eq i64 %3, 215
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}
/* Variables and functions */
char *GetCRDelineatedString(char *, char *, int);
const char *GetMonthAbbrevString(int iMonth) {
  const char *p = GetCRDelineatedString("INGAMETEXT", "MONTHS", iMonth);
  return p ? p : "Jan";
}


x86 assembly (clang, -O0):
<GetMonthAbbrevString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1030 <GetCRDelineatedString@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <GetMonthAbbrevString+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    115d <GetMonthAbbrevString+0x4d>
lea    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    115d <GetMonthAbbrevString+0x4d>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMonthAbbrevString>:
push   %rax
mov    %edi,%edx
lea    0xee6(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1030 <GetCRDelineatedString@plt>
test   %rax,%rax
lea    0xee2(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"INGAMETEXT\00"
@.str.1 = [7 x i8] c"MONTHS\00"
@.str.2 = [4 x i8] c"Jan\00"
define i8* @GetMonthAbbrevString(i32 %0) {
%2 = tail call i8* @GetCRDelineatedString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %2
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() { printf("%cHello world\n", 12); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"%cHello world\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%cHello world\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
ret i32 0
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t u32REV(u_int32_t x) {
  return (x << 24) | (x >> 24) | ((x << 8) & 0x00ff0000) |
         ((x >> 8) & 0x0000ff00);
}


x86 assembly (clang, -O0):
<u32REV>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u32REV>:
mov    %edi,%eax
shl    $0x18,%eax
mov    %edi,%ecx
sar    $0x18,%ecx
or     %eax,%ecx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %ecx,%eax
shr    $0x8,%edi
and    $0xff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @u32REV(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = ashr i32 %5, 24
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = shl i32 %8, 8
%10 = and i32 %9, 16711680
%11 = or i32 %7, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 8
%14 = and i32 %13, 65280
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @u32REV(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr i32 %0, 24
%4 = or i32 %2, %3
%5 = shl i32 %0, 8
%6 = and i32 %5, 16711680
%7 = or i32 %4, %6
%8 = lshr i32 %0, 8
%9 = and i32 %8, 65280
%10 = or i32 %7, %9
ret i32 %10
}
void h_cpin(char *name, int argc, char **argv, void *user_data) {
  printf("Called: %s\n", __FUNCTION__);
}


x86 assembly (clang, -O0):
<h_cpin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xed2(%rip),%rdi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_cpin>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cpin = [7 x i8] c"h_cpin\00"
define void @h_cpin(i8* %0, i32 %1, i8** %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cpin, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Called: %s\0A\00"
@__FUNCTION__.h_cpin = [7 x i8] c"h_cpin\00"
define void @h_cpin(i8* nocapture readnone %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.h_cpin, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_tagstruct_put_usec() {
  printf("NOT IMPLEMENTED:"
         "pa_tagstruct_put_usec"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_tagstruct_put_usec\00"
define i32 @pa_tagstruct_put_usec() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void latex_print_depedge(int h, int m) {
  printf("\\depedge{%d}{%d}{}\n", h, m);
}


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

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

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

LLVM IR (-O2):
@.str = [20 x i8] c"\\depedge{%d}{%d}{}\0A\00"
define void @latex_print_depedge(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void SteamAPI_ISteamInput_RunFrame(void *self) {
  xlogf("%s(self = %p)", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_ISteamInput_RunFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_ISteamInput_RunFrame>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s(self = %p)\00"
@__func__.SteamAPI_ISteamInput_RunFrame = [30 x i8] c"SteamAPI_ISteamInput_RunFrame\00"
define void @SteamAPI_ISteamInput_RunFrame(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__func__.SteamAPI_ISteamInput_RunFrame, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s(self = %p)\00"
@__func__.SteamAPI_ISteamInput_RunFrame = [30 x i8] c"SteamAPI_ISteamInput_RunFrame\00"
define void @SteamAPI_ISteamInput_RunFrame(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @__func__.SteamAPI_ISteamInput_RunFrame, i64 0, i64 0), i8* %0)
ret void
}
int power_management_start_reading(int interval) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @power_management_start_reading(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "%s\n%s\n",
          "usage: truncate [-c] -s [+|-]size[K|k|M|m|G|g|T|t] file ...",
          "       truncate [-c] -r rfile file ...");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xf01(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xecf(%rip),%rdx
lea    0xf04(%rip),%rcx
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [60 x i8] c"usage: truncate [-c] -s [+|-]size[K|k|M|m|G|g|T|t] file ...\00"
@.str.2 = [39 x i8] c" truncate [-c] -r rfile file ...\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"%s\0A%s\0A\00"
@.str.1 = [60 x i8] c"usage: truncate [-c] -s [+|-]size[K|k|M|m|G|g|T|t] file ...\00"
@.str.2 = [39 x i8] c" truncate [-c] -r rfile file ...\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
double LSKeyframeAnimationFunctionEaseInBack(double t, double b, double c,
                                             double d) {
  const double s = 1.70158;
  return c * (t /= d) * t * ((s + 1) * t - s) + b;
}


x86 assembly (clang, -O0):
<LSKeyframeAnimationFunctionEaseInBack>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  0xef0(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,-0x8(%rbp)
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xead(%rip),%xmm1
mulsd  %xmm1,%xmm2
movsd  0xea9(%rip),%xmm1
addsd  %xmm1,%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LSKeyframeAnimationFunctionEaseInBack>:
divsd  %xmm3,%xmm0
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  0xeec(%rip),%xmm0
addsd  0xeec(%rip),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @LSKeyframeAnimationFunctionEaseInBack(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
store double 1.701580e+00, double* %9
%10 = load double, double* %7
%11 = load double, double* %8
%12 = load double, double* %5
%13 = fdiv double %12, %11
store double %13, double* %5
%14 = fmul double %10, %13
%15 = load double, double* %5
%16 = fmul double %14, %15
%17 = load double, double* %5
%18 = call double @llvm.fmuladd.f64(double 2.701580e+00, double %17, double -1.701580e+00)
%19 = load double, double* %6
%20 = call double @llvm.fmuladd.f64(double %16, double %18, double %19)
ret double %20
}

LLVM IR (-O2):
define double @LSKeyframeAnimationFunctionEaseInBack(double %0, double %1, double %2, double %3) {
%5 = fdiv double %0, %3
%6 = fmul double %5, %2
%7 = fmul double %5, %6
%8 = tail call double @llvm.fmuladd.f64(double %5, double 2.701580e+00, double -1.701580e+00)
%9 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %1)
ret double %9
}
unsigned int CombineByte(unsigned int lowByte, unsigned int lowByteLength,
                         unsigned int highByte, unsigned int highByteLength) {
  return (highByte << lowByteLength) + lowByte;
}


x86 assembly (clang, -O0):
<CombineByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CombineByte>:
mov    %esi,%ecx
shl    %cl,%edx
lea    (%rdx,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @CombineByte(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %2, %1
%6 = add i32 %5, %0
ret i32 %6
}
int test_imm_43int16_reg(short val) {
  return ((val) & (-0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffffbd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_43int16_reg>:
test   $0xffbd,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_43int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -67
%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_43int16_reg(i16 signext %0) {
%2 = and i16 %0, -67
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x12() {
  Assert_real((isxdigit(18) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              95, ("isxdigit should be 0 for 0x12"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x12>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x5f,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x12>:
push   %rax
mov    $0x12,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x5f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x12\00"
define void @t_isxdigit_0x12() {
%1 = call i64 @isxdigit(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0x12\00"
define void @t_isxdigit_0x12() {
%1 = tail call i64 @isxdigit(i32 18)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ NewOldGame(int);
int /*<<< orphan*/ player_game_ended(int);
int game_finish(int g0) {
  player_game_ended(g0);
  NewOldGame(g0);
  return 0;
}


x86 assembly (clang, -O0):
<game_finish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <player_game_ended@plt>
mov    -0x4(%rbp),%edi
call   1030 <NewOldGame@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_finish>:
push   %rbx
mov    %edi,%ebx
call   1040 <player_game_ended@plt>
mov    %ebx,%edi
call   1030 <NewOldGame@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @game_finish(i32 %0) {
%2 = tail call i32 @player_game_ended(i32 %0)
%3 = tail call i32 @NewOldGame(i32 %0)
ret i32 0
}
short contac(register char *s, char c) {
  short n = 0;
  while (*s)
    if (*s++ == c)
      n++;
  return n;
}


x86 assembly (clang, -O0):
<contac>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movw   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <contac+0x50>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114b <contac+0x4b>
mov    -0xc(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xc(%rbp)
jmp    1114 <contac+0x14>
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<contac>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <contac+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <contac+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i16 @contac(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i16 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = icmp eq i8 %6, %1
%11 = zext i1 %10 to i16
%12 = add i16 %7, %11
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i16 [ 0, %2 ], [ %12, %5 ]
ret i16 %16
}
/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ sleep(int);
int tcflush(int, int /*<<< orphan*/);
int serial_flush(int fd) {
  sleep(2);
  return tcflush(fd, TCIOFLUSH);
}


x86 assembly (clang, -O0):
<serial_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
call   1030 <tcflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_flush>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1040 <sleep@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tcflush@plt>

LLVM IR (-O0):
@TCIOFLUSH = global i32 0
define i32 @serial_flush(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sleep(i32 2)
%4 = load i32, i32* %2
%5 = load i32, i32* @TCIOFLUSH
%6 = call i32 @tcflush(i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@TCIOFLUSH = global i32 0
define i32 @serial_flush(i32 %0) {
%2 = tail call i32 @sleep(i32 2)
%3 = load i32, i32* @TCIOFLUSH
%4 = tail call i32 @tcflush(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
int f39(int *);
int f40(int *p) { return f39(p); }


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

x86 assembly (clang, -O2):
<f40>:
jmp    1030 <f39@plt>

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

LLVM IR (-O2):
define i32 @f40(i32* %0) {
%2 = tail call i32 @f39(i32* %0)
ret i32 %2
}
void nodebug(int l, const char *m, ...) {}


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

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

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

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