xunge/DecIR huggingface dataset:
/* Variables and functions */
char tolower(char);
char *strlowcase(char *str) {
  int i;
  i = 0;
  while (str[i]) {
    str[i] = tolower(str[i]);
    ++i;
  }
  return (str);
}


x86 assembly (clang, -O0):
<strlowcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <strlowcase+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strlowcase+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlowcase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strlowcase+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlowcase+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlowcase(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void c45_node_release_string(char *pointer) { free(pointer); }


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

x86 assembly (clang, -O2):
<c45_node_release_string>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @c45_node_release_string(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void av_twofish_crypt() {}


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

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

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

LLVM IR (-O2):
define void @av_twofish_crypt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
__attribute__((assume("baz:def1,baz:def2"))) void baz(void) { foo(); }


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

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

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

LLVM IR (-O2):
define void @baz() {
%1 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Gamma_Function(double);
double Gamma_Function_Max_Arg();
double log(int /*<<< orphan*/);
scalar_t__ xLnGamma_Asymptotic_Expansion(long double);
double Ln_Gamma_Function(double x) {
  if (x <= Gamma_Function_Max_Arg())
    return log(Gamma_Function(x));
  return (double)xLnGamma_Asymptotic_Expansion((long double)x);
}


x86 assembly (clang, -O0):
<Ln_Gamma_Function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <Gamma_Function_Max_Arg@plt>
movsd  -0x18(%rbp),%xmm1
ucomisd %xmm1,%xmm0
jb     1188 <Ln_Gamma_Function+0x48>
movsd  -0x10(%rbp),%xmm0
call   1030 <Gamma_Function@plt>
mov    %eax,%edi
call   1050 <log@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    119f <Ln_Gamma_Function+0x5f>
fldl   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1060 <xLnGamma_Asymptotic_Expansion@plt>
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ln_Gamma_Function>:
sub    $0x28,%rsp
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   1040 <Gamma_Function_Max_Arg@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm0
jae    1180 <Ln_Gamma_Function+0x40>
movsd  %xmm0,0x20(%rsp)
fldl   0x20(%rsp)
fstpt  (%rsp)
call   1060 <xLnGamma_Asymptotic_Expansion@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
add    $0x28,%rsp
ret
call   1030 <Gamma_Function@plt>
mov    %eax,%edi
add    $0x28,%rsp
jmp    1050 <log@plt>

LLVM IR (-O0):
define double @Ln_Gamma_Function(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call double (...) @Gamma_Function_Max_Arg()
%6 = fcmp ole double %4, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load double, double* %3
%9 = call i32 @Gamma_Function(double %8)
%10 = call double @log(i32 %9)
store double %10, double* %2
br label %16
11: ; preds = %1
%12 = load double, double* %3
%13 = fpext double %12 to x86_fp80
%14 = call i64 @xLnGamma_Asymptotic_Expansion(x86_fp80 %13)
%15 = sitofp i64 %14 to double
store double %15, double* %2
br label %16
16: ; preds = %11, %7
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @Ln_Gamma_Function(double %0) {
%2 = tail call double (...) @Gamma_Function_Max_Arg()
%3 = fcmp ult double %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @Gamma_Function(double %0)
%6 = tail call double @log(i32 %5)
br label %11
7: ; preds = %1
%8 = fpext double %0 to x86_fp80
%9 = tail call i64 @xLnGamma_Asymptotic_Expansion(x86_fp80 %8)
%10 = sitofp i64 %9 to double
br label %11
11: ; preds = %7, %4
%12 = phi double [ %6, %4 ], [ %10, %7 ]
ret double %12
}
float FastInvSqrt(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f3759df - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - (xhalf * x * x));
  return x;
}


x86 assembly (clang, -O0):
<FastInvSqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f3759df,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FastInvSqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f3759df,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @FastInvSqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463007, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @FastInvSqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463007, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XIMText;
struct TYPE_2__ {
  int /*<<< orphan*/ *text;
};
typedef TYPE_1__ XIMPreeditDrawCallbackStruct;

/* Variables and functions */
void set_XIMPreeditDrawCallbackStruct_text(void *_p, void *_v) {
  ((XIMPreeditDrawCallbackStruct *)_p)->text = (XIMText *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32* }
define void @set_XIMPreeditDrawCallbackStruct_text(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 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_2__*
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32* %6, i32** %9
ret void
}

LLVM IR (-O2):
define void @set_XIMPreeditDrawCallbackStruct_text(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OAL_OBTAIN_SEMAPHORE();
int /*<<< orphan*/ OAL_RELEASE_SEMAPHORE();
int spi_bulkread(void *, unsigned short, unsigned char, unsigned char *, int);
int fc8150_spib_byteread(void *hDevice, unsigned short addr,
                         unsigned char *data) {
  int res;
  unsigned char command = 0x40;
  OAL_OBTAIN_SEMAPHORE();
  res = spi_bulkread(hDevice, addr, command, data, 1);
  OAL_RELEASE_SEMAPHORE();
  return res;
}


x86 assembly (clang, -O0):
<fc8150_spib_byteread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
movb   $0x40,-0x1d(%rbp)
mov    $0x0,%al
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%dx
mov    -0x1d(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
movzwl %dx,%esi
movzbl %al,%edx
call   1040 <spi_bulkread@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8150_spib_byteread>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <OAL_OBTAIN_SEMAPHORE@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x40,%edx
mov    %r14,%rcx
mov    $0x1,%r8d
call   1040 <spi_bulkread@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <OAL_RELEASE_SEMAPHORE@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fc8150_spib_byteread(i8* %0, i16 zeroext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
store i8 64, i8* %8
%9 = call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%10 = load i8*, i8** %4
%11 = load i16, i16* %5
%12 = load i8, i8* %8
%13 = load i8*, i8** %6
%14 = call i32 @spi_bulkread(i8* %10, i16 zeroext %11, i8 zeroext %12, i8* %13, i32 1)
store i32 %14, i32* %7
%15 = call i32 (...) @OAL_RELEASE_SEMAPHORE()
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
define i32 @fc8150_spib_byteread(i8* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 (...) @OAL_OBTAIN_SEMAPHORE()
%5 = tail call i32 @spi_bulkread(i8* %0, i16 zeroext %1, i8 zeroext 64, i8* %2, i32 1)
%6 = tail call i32 (...) @OAL_RELEASE_SEMAPHORE()
ret i32 %5
}
const char *picosat_copyright(void) {
  return "Copyright (c) 2006 - 2010 Armin Biere JKU Linz";
}


x86 assembly (clang, -O0):
<picosat_copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<picosat_copyright>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Copyright (c) 2006 - 2010 Armin Biere JKU Linz\00"
define i8* @picosat_copyright() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"Copyright (c) 2006 - 2010 Armin Biere JKU Linz\00"
define i8* @picosat_copyright() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
usage(char *progname) {
  fprintf(stderr, "USAGE: %s <keylength>\n", progname);
  fprintf(stderr, "       keylength must be a positive integer\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee3(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"USAGE: %s <keylength>\0A\00"
@.str.1 = [45 x i8] c" keylength must be a positive integer\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %3
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"USAGE: %s <keylength>\0A\00"
@.str.1 = [45 x i8] c" keylength must be a positive integer\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
char *procprt_NOTAVAIL_6(struct tstat *curstat, int avgval, int nsecs) {
  return "     ?";
}


x86 assembly (clang, -O0):
<procprt_NOTAVAIL_6>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_NOTAVAIL_6>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [7 x i8] c" ?\00"
define i8* @procprt_NOTAVAIL_6(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [7 x i8] c" ?\00"
define i8* @procprt_NOTAVAIL_6(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int read_pid(char *pidfile) {
  FILE *f;
  int pid;
  if (!(f = fopen(pidfile, "r")))
    return 0;
  fscanf(f, "%d", &pid);
  fclose(f);
  return pid;
}


x86 assembly (clang, -O0):
<read_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1166 <read_pid+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1189 <read_pid+0x59>
mov    -0x18(%rbp),%rdi
lea    0xe91(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_pid>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116b <read_pid+0x3b>
mov    %rax,%rbx
lea    0xeb2(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
jmp    116d <read_pid+0x3d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @read_pid(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32* %4, null
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%8 = call i32 @fclose(i32* %4)
%9 = load i32, i32* %2
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
int mult(int x, int y) { return x * y; }


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
mov    %edi,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @mult(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 = mul nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ do_stuff();
noargs() { do_stuff(); }


x86 assembly (clang, -O0):
<noargs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <do_stuff@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @noargs() {
%1 = alloca i32
%2 = call i32 (...) @do_stuff()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @noargs() {
%1 = tail call i32 (...) @do_stuff()
ret i32 undef
}
/* Type definitions */
struct svc_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int *printmessage_1_svc(char *arg1, struct svc_req *rqstp) {
  static int result = 73;
  printf("%s\n", arg1);
  return &result;
}


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

x86 assembly (clang, -O2):
<printmessage_1_svc>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0x2f01(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.svc_req = type { i32 }
@printmessage_1_svc.result = internal global i32 73
@.str = [4 x i8] c"%s\0A\00"
define i32* @printmessage_1_svc(i8* %0, %struct.svc_req* %1) {
%3 = alloca i8*
%4 = alloca %struct.svc_req*
store i8* %0, i8** %3
store %struct.svc_req* %1, %struct.svc_req** %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32* @printmessage_1_svc.result
}

LLVM IR (-O2):
%struct.svc_req = type { i32 }
@printmessage_1_svc.result = internal global i32 73
@.str = [4 x i8] c"%s\0A\00"
define i32* @printmessage_1_svc(i8* %0, %struct.svc_req* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32* @printmessage_1_svc.result
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Programming is fun!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Programming is fun!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int);
int putGame(int T) {
  putchar(71);
  putchar(97);
  putchar(109);
  putchar(101);
  putchar(32);
  putint(T);
  putchar(58);
  putchar(32);
  return 0;
}


x86 assembly (clang, -O0):
<putGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x47,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x6d,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%edi
call   1040 <putint@plt>
mov    $0x3a,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putGame>:
push   %rbx
mov    %edi,%ebx
mov    $0x47,%edi
call   1030 <putchar@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
mov    $0x6d,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1040 <putint@plt>
mov    $0x3a,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @putGame(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @putchar(i32 71)
%4 = call i32 @putchar(i32 97)
%5 = call i32 @putchar(i32 109)
%6 = call i32 @putchar(i32 101)
%7 = call i32 @putchar(i32 32)
%8 = load i32, i32* %2
%9 = call i32 @putint(i32 %8)
%10 = call i32 @putchar(i32 58)
%11 = call i32 @putchar(i32 32)
ret i32 0
}

LLVM IR (-O2):
define i32 @putGame(i32 %0) {
%2 = tail call i32 @putchar(i32 71)
%3 = tail call i32 @putchar(i32 97)
%4 = tail call i32 @putchar(i32 109)
%5 = tail call i32 @putchar(i32 101)
%6 = tail call i32 @putchar(i32 32)
%7 = tail call i32 @putint(i32 %0)
%8 = tail call i32 @putchar(i32 58)
%9 = tail call i32 @putchar(i32 32)
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ width;
};
typedef TYPE_1__ XResizeRequestEvent;

/* Variables and functions */
int get_XResizeRequestEvent_width(void *_p) {
  return (int)((XResizeRequestEvent *)_p)->width;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XResizeRequestEvent_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int fun318() { return 318; }


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

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

LLVM IR (-O0):
define i32 @fun318() {
ret i32 318
}

LLVM IR (-O2):
define i32 @fun318() {
ret i32 318
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t __hsail_bytealign(uint64_t lower, uint64_t upper,
                           uint32_t shift_amount) {
  shift_amount = (shift_amount & 3) * 8;
  uint64_t packed_value = (upper << 32) | lower;
  return (packed_value >> shift_amount) & 0xFFFFFFFF;
}


x86 assembly (clang, -O0):
<__hsail_bytealign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__hsail_bytealign(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = and i32 %8, 3
%10 = mul nsw i32 %9, 8
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = shl i32 %11, 32
%13 = load i32, i32* %4
%14 = or i32 %12, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = load i32, i32* %6
%17 = ashr i32 %15, %16
%18 = and i32 %17, -1
ret i32 %18
}

LLVM IR (-O2):
define i32 @__hsail_bytealign(i32 %0, i32 %1, i32 %2) {
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int assert_equal(int expect, int given, char *msg) {
  if (expect != given) {
    printf("%s\n", msg);
    exit(1);
  }
  return 1;
}


x86 assembly (clang, -O0):
<assert_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1158 <assert_equal+0x38>
mov    -0x10(%rbp),%rsi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_equal>:
cmp    %esi,%edi
jne    112a <assert_equal+0xa>
mov    $0x1,%eax
ret
push   %rax
lea    0xece(%rip),%rdi
mov    %rdx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @assert_equal(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %3
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ inet_close(int);
int /*<<< orphan*/ inet_write(int, char *);
void mpd_close(int sock) {
  inet_write(sock, "close\n");
  inet_close(sock);
}


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

x86 assembly (clang, -O2):
<mpd_close>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
call   1030 <inet_write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <inet_close@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"close\0A\00"
define void @mpd_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @inet_write(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @inet_close(i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"close\0A\00"
define void @mpd_close(i32 %0) {
%2 = tail call i32 @inet_write(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @inet_close(i32 %0)
ret void
}
void et_drive_align(int ticks_per_second) {}


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

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

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

LLVM IR (-O2):
define void @et_drive_align(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ memcpy(void *, void *, int);
void troca(void *a, void *b, int tam_estr) {
  void *tmp = malloc(tam_estr);
  memcpy(tmp, a, tam_estr);
  memcpy(a, b, tam_estr);
  memcpy(b, tmp, tam_estr);
  free(tmp);
}


x86 assembly (clang, -O0):
<troca>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<troca>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%edi
call   1050 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
mov    %r12,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @troca(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = call i32 @memcpy(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @memcpy(i8* %14, i8* %15, i32 %16)
%18 = load i8*, i8** %5
%19 = load i8*, i8** %7
%20 = load i32, i32* %6
%21 = call i32 @memcpy(i8* %18, i8* %19, i32 %20)
%22 = load i8*, i8** %7
%23 = call i32 @free(i8* %22)
ret void
}

LLVM IR (-O2):
define void @troca(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @malloc(i32 %2)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %2)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%7 = tail call i32 @memcpy(i8* %1, i8* %4, i32 %2)
%8 = tail call i32 @free(i8* %4)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t make_vgaentry(char c, uint8_t color) {
  return ((uint16_t)c | (uint16_t)color << 8);
}


x86 assembly (clang, -O0):
<make_vgaentry>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_vgaentry>:
mov    %rsi,%rax
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_vgaentry(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @make_vgaentry(i8 signext %0, i64 %1) {
%3 = sext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 8
%6 = or i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void date_time(char *dt) {
  time_t date = time(NULL);
  strftime(dt, 20, "%Y/%m/%d %H:%M:%S", localtime(&date));
}


x86 assembly (clang, -O0):
<date_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%ecx
mov    $0x14,%esi
lea    0xe95(%rip),%rdx
call   1050 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xeac(%rip),%rdx
mov    %rbx,%rdi
mov    $0x14,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"%Y/%m/%d %H:%M:%S\00"
define void @date_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* %5, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%Y/%m/%d %H:%M:%S\00"
define void @date_time(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32* null)
store i32 %4, i32* %2
%5 = call i32 @localtime(i32* %2)
%6 = call i32 @strftime(i8* %0, i32 20, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put_byte(int, int);
__attribute__((always_)) void patch_CAS_3_0_2_1791_extra(void) {
  put_byte(0x100791A3, 0xEA);
}


x86 assembly (clang, -O0):
<patch_CAS_3_0_2_1791_extra>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100791a3,%edi
mov    $0xea,%esi
call   1030 <put_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<patch_CAS_3_0_2_1791_extra>:
mov    $0x100791a3,%edi
mov    $0xea,%esi
jmp    1030 <put_byte@plt>

LLVM IR (-O0):
define void @patch_CAS_3_0_2_1791_extra() {
%1 = call i32 @put_byte(i32 268931491, i32 234)
ret void
}

LLVM IR (-O2):
define void @patch_CAS_3_0_2_1791_extra() {
%1 = tail call i32 @put_byte(i32 268931491, i32 234)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void json_escape(int c, FILE *out) {
  putc(0x5C, out);
  putc(c, out);
}


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

x86 assembly (clang, -O2):
<json_escape>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x5c,%edi
call   1030 <putc@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @json_escape(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = call i32 @putc(i32 92, i32* %5)
%7 = load i32, i32* %3
%8 = load i32*, i32** %4
%9 = call i32 @putc(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
define void @json_escape(i32 %0, i32* nocapture %1) {
%3 = tail call i32 @putc(i32 92, i32* %1)
%4 = tail call i32 @putc(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPIFI0_DriverIRQHandler();
__attribute__((weak)) void SPIFI0_IRQHandler(void) {
  SPIFI0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @SPIFI0_IRQHandler() {
%1 = call i32 (...) @SPIFI0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @SPIFI0_IRQHandler() {
%1 = tail call i32 (...) @SPIFI0_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/ *);
void OutputEntry(FILE *fp, const char *user, const char *pass) {
  fputs("Username : ", fp);
  fputs(user, fp);
  fputs("\t\tPassword : ", fp);
  fputs(pass, fp);
  fputs("\n", fp);
}


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

x86 assembly (clang, -O2):
<OutputEntry>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xebb(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
lea    0xea3(%rip),%rdi
mov    $0xd,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <fputs@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Username : \00"
@.str.1 = [14 x i8] c"\09\09Password : \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @OutputEntry(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32*, i32** %4
%8 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %7)
%9 = load i8*, i8** %5
%10 = load i32*, i32** %4
%11 = call i32 @fputs(i8* %9, i32* %10)
%12 = load i32*, i32** %4
%13 = call i32 @fputs(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%14 = load i8*, i8** %6
%15 = load i32*, i32** %4
%16 = call i32 @fputs(i8* %14, i32* %15)
%17 = load i32*, i32** %4
%18 = call i32 @fputs(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %17)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Username : \00"
@.str.1 = [14 x i8] c"\09\09Password : \00"
define void @OutputEntry(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %0)
%5 = tail call i32 @fputs(i8* %1, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 13, i64 1, i32* %0)
%7 = tail call i32 @fputs(i8* %2, i32* %0)
%8 = tail call i32 @fputc(i32 10, i32* %0)
ret void
}
double tst_exp_moving_avg(double alpha, long sample, double prev_avg) {
  return alpha * sample + (1.0 - alpha) * prev_avg;
}


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

x86 assembly (clang, -O2):
<tst_exp_moving_avg>:
cvtsi2sd %rdi,%xmm2
movsd  0xef3(%rip),%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @tst_exp_moving_avg(double %0, i64 %1, double %2) {
%4 = alloca double
%5 = alloca i64
%6 = alloca double
store double %0, double* %4
store i64 %1, i64* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load i64, i64* %5
%9 = sitofp i64 %8 to double
%10 = load double, double* %4
%11 = fsub double 1.000000e+00, %10
%12 = load double, double* %6
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %7, double %9, double %13)
ret double %14
}

LLVM IR (-O2):
define double @tst_exp_moving_avg(double %0, i64 %1, double %2) {
%4 = sitofp i64 %1 to double
%5 = fsub double 1.000000e+00, %0
%6 = fmul double %5, %2
%7 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %6)
ret double %7
}
/* Variables and functions */
int u8isspacei(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8isspacec(char *c) { return u8isspacei(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8isspacec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8isspacei@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isspacec>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isspacei@plt>

LLVM IR (-O0):
define i32 @u8isspacec(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @u8tointc(i8* %3)
%5 = call i32 @u8isspacei(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @u8isspacec(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8isspacei(i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ M_PI;
float __builtin_sinf(float);
float Sleef_sinpif_u05(float x) { return __builtin_sinf(x * (float)M_PI); }


x86 assembly (clang, -O0):
<Sleef_sinpif_u05>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
call   1030 <sinf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sleef_sinpif_u05>:
mov    0x2ed1(%rip),%rax
cvtsi2ssq (%rax),%xmm1
mulss  %xmm1,%xmm0
jmp    1030 <sinf@plt>

LLVM IR (-O0):
@M_PI = global i64 0
define float @Sleef_sinpif_u05(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load i64, i64* @M_PI
%5 = sitofp i64 %4 to float
%6 = fmul float %3, %5
%7 = call float @sinf(float %6)
ret float %7
}

LLVM IR (-O2):
@M_PI = global i64 0
define float @Sleef_sinpif_u05(float %0) {
%2 = load i64, i64* @M_PI
%3 = sitofp i64 %2 to float
%4 = fmul float %3, %0
%5 = tail call float @sinf(float %4)
ret float %5
}
int patternMode(int isForeground, char bit) {
  if ((bit < '0') || (bit > '7'))
    return (0x00);
  return (isForeground ? (0x10) : (0x20)) | (bit - '0');
}


x86 assembly (clang, -O0):
<patternMode>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jl     1127 <patternMode+0x27>
movsbl -0x9(%rbp),%eax
cmp    $0x37,%eax
jle    1133 <patternMode+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1152 <patternMode+0x52>
mov    -0x8(%rbp),%edx
mov    $0x20,%eax
mov    $0x10,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl -0x9(%rbp),%ecx
sub    $0x30,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<patternMode>:
lea    -0x38(%rsi),%ecx
xor    %eax,%eax
cmp    $0xf8,%cl
jb     1120 <patternMode+0x20>
movzbl %sil,%eax
xor    %ecx,%ecx
test   %edi,%edi
sete   %cl
shl    $0x4,%ecx
add    $0x10,%ecx
add    $0xffffffd0,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @patternMode(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 48
br i1 %8, label %13, label %9
9: ; preds = %2
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp sgt i32 %11, 55
br i1 %12, label %13, label %14
13: ; preds = %9, %2
store i32 0, i32* %3
br label %23
14: ; preds = %9
%15 = load i32, i32* %4
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 16, i32 32
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = sub nsw i32 %20, 48
%22 = or i32 %18, %21
store i32 %22, i32* %3
br label %23
23: ; preds = %14, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @patternMode(i32 %0, i8 signext %1) {
%3 = add i8 %1, -56
%4 = icmp ult i8 %3, -8
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = zext i8 %1 to i32
%7 = icmp eq i32 %0, 0
%8 = select i1 %7, i32 32, i32 16
%9 = add nsw i32 %6, -48
%10 = or i32 %9, %8
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ 0, %2 ]
ret i32 %12
}