xunge/DecIR huggingface dataset:
void cpuid(unsigned int index, unsigned int *v1, unsigned int *v2,
           unsigned int *v3, unsigned int *v4) {
  __asm__ __volatile__("xchg %%ebx, %%edi;"
                       "cpuid;"
                       "xchg %%ebx, %%edi;"
                       : "=a"(*v1), "=D"(*v2), "=c"(*v4), "=d"(*v3)
                       : "0"(index));
}


x86 assembly (clang, -O0):
<cpuid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x4(%rbp),%eax
xchg   %edi,%ebx
cpuid
xchg   %edi,%ebx
mov    %eax,%r10d
mov    -0x40(%rbp),%rax
mov    %edi,%r8d
mov    -0x38(%rbp),%rdi
mov    %ecx,%esi
mov    -0x30(%rbp),%rcx
mov    %r10d,(%r9)
mov    %r8d,(%rdi)
mov    %esi,(%rcx)
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid>:
mov    %rcx,%r9
mov    %rdx,%r10
mov    %edi,%eax
xchg   %edi,%ebx
cpuid
xchg   %edi,%ebx
mov    %eax,(%rsi)
mov    %edi,(%r10)
mov    %ecx,(%r8)
mov    %edx,(%r9)
ret

LLVM IR (-O0):
define void @cpuid(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = load i32*, i32** %10
%14 = load i32*, i32** %9
%15 = load i32, i32* %6
%16 = call { i32, i32, i32, i32 } asm sideeffect "xchg %ebx, %edi;cpuid;xchg %ebx, %edi;", "={ax},={di},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %15)
%17 = extractvalue { i32, i32, i32, i32 } %16, 0
%18 = extractvalue { i32, i32, i32, i32 } %16, 1
%19 = extractvalue { i32, i32, i32, i32 } %16, 2
%20 = extractvalue { i32, i32, i32, i32 } %16, 3
store i32 %17, i32* %11
store i32 %18, i32* %12
store i32 %19, i32* %13
store i32 %20, i32* %14
ret void
}

LLVM IR (-O2):
define void @cpuid(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = tail call { i32, i32, i32, i32 } asm sideeffect "xchg %ebx, %edi;cpuid;xchg %ebx, %edi;", "={ax},={di},={cx},={dx},0,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%7 = extractvalue { i32, i32, i32, i32 } %6, 0
%8 = extractvalue { i32, i32, i32, i32 } %6, 1
%9 = extractvalue { i32, i32, i32, i32 } %6, 2
%10 = extractvalue { i32, i32, i32, i32 } %6, 3
store i32 %7, i32* %1
store i32 %8, i32* %2
store i32 %9, i32* %4
store i32 %10, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void test_assert_should_succeed() {
  assert(1 == 1);
  assert(1 & 1);
  assert(1 || 0);
}


x86 assembly (clang, -O0):
<test_assert_should_succeed>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_assert_should_succeed>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_assert_should_succeed() {
%1 = call i32 @assert(i32 1)
%2 = call i32 @assert(i32 1)
%3 = call i32 @assert(i32 1)
ret void
}

LLVM IR (-O2):
define void @test_assert_should_succeed() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
ret void
}
extern int isonum_732(p)
unsigned char *p;
{ return (*p << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; }


x86 assembly (clang, -O0):
<isonum_732>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @isonum_732(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = shl i32 %5, 24
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 16
%12 = or i32 %6, %11
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = or i32 %12, %17
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 3
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = or i32 %18, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @isonum_732(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
float ANTweenTimingFunctionCubicOut(float time, float begin, float change,
                                    float duration) {
  time = time / duration - 1;
  return change * (time * time * time + 1) + begin;
}


x86 assembly (clang, -O0):
<ANTweenTimingFunctionCubicOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
mulss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm2
movss  0xead(%rip),%xmm1
addss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenTimingFunctionCubicOut>:
divss  %xmm3,%xmm0
addss  0xef4(%rip),%xmm0
movaps %xmm0,%xmm3
mulss  %xmm0,%xmm3
mulss  %xmm3,%xmm0
addss  0xee5(%rip),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @ANTweenTimingFunctionCubicOut(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fadd float %5, -1.000000e+00
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %7, float %6, float 1.000000e+00)
%9 = tail call float @llvm.fmuladd.f32(float %2, float %8, float %1)
ret float %9
}
void Common_Init() {}


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

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

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

LLVM IR (-O2):
define void @Common_Init() {
ret void
}
int test_imm_D1int16_mem(short *val) {
  return ((*val) & (0xD1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 209
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, long long);
int main() {
  long long i;
  printf("%d\n", getpid());
  for (i = 0;; ++i) {
    if (i % 100000000 == 0) {
      printf("%lld\n", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
movslq %eax,%rsi
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x5f5e100,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1175 <main+0x55>
mov    -0x10(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
jmp    117a <main+0x5a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114d <main+0x2d>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %r15d,%r15d
xor    %eax,%eax
call   1030 <getpid@plt>
movslq %eax,%rsi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
movabs $0xabcc77118461cefd,%r12
77 cc ab
lea    0xeb2(%rip),%r14
xor    %ebx,%ebx
jmp    1168 <main+0x48>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
mov    %rbx,%rax
mul    %r12
shr    $0x1a,%rdx
imul   $0x5f5e100,%rdx,%rax
add    %r15,%rax
jne    1160 <main+0x40>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1160 <main+0x40>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = call i32 (...) @getpid()
%4 = sext i32 %3 to i64
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %4)
store i64 0, i64* %2
br label %6
6: ; preds = %14, %0
%7 = load i64, i64* %2
%8 = srem i64 %7, 100000000
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i64, i64* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %11)
br label %13
13: ; preds = %10, %6
br label %14
14: ; preds = %13
%15 = load i64, i64* %2
%16 = add nsw i64 %15, 1
store i64 %16, i64* %2
br label %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = sext i32 %1 to i64
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %2)
br label %4
4: ; preds = %10, %0
%5 = phi i64 [ 0, %0 ], [ %11, %10 ]
%6 = urem i64 %5, 100000000
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %5)
br label %10
10: ; preds = %4, %8
%11 = add nuw nsw i64 %5, 1
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ Lcd_Write_Com(unsigned char);
int /*<<< orphan*/ Lcd_Write_Data(unsigned char);
void Lcd_Write_Com_Data(unsigned char com, unsigned char dat) {
  Lcd_Write_Com(com);
  Lcd_Write_Data(dat);
}


x86 assembly (clang, -O0):
<Lcd_Write_Com_Data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <Lcd_Write_Com@plt>
movzbl -0x2(%rbp),%edi
call   1040 <Lcd_Write_Data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd_Write_Com_Data>:
push   %rbx
mov    %esi,%ebx
call   1030 <Lcd_Write_Com@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <Lcd_Write_Data@plt>

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

LLVM IR (-O2):
define void @Lcd_Write_Com_Data(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 @Lcd_Write_Com(i8 zeroext %0)
%4 = tail call i32 @Lcd_Write_Data(i8 zeroext %1)
ret void
}
/* Variables and functions */
double *malloc(int);
double sin(double);
double *sin_degrees_p(double *x) {
  static double *ret;
  ret = malloc(sizeof(double) * 1);
  ret[0] = sin((*x) * 3.14159265359 / 180.0);
  return (ret);
}


x86 assembly (clang, -O0):
<sin_degrees_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,0x2efb(%rip)
mov    -0x8(%rbp),%rax
movsd  0xebf(%rip),%xmm0
mulsd  (%rax),%xmm0
movsd  0xeab(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
mov    0x2ed3(%rip),%rax
movsd  %xmm0,(%rax)
mov    0x2ec8(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sin_degrees_p>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,0x2f03(%rip)
movsd  (%rbx),%xmm0
mulsd  0xebf(%rip),%xmm0
divsd  0xebf(%rip),%xmm0
call   1030 <sin@plt>
mov    0x2ee3(%rip),%rax
movsd  %xmm0,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
@sin_degrees_p.ret = internal global double* null
define double* @sin_degrees_p(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = call double* @malloc(i32 8)
store double* %3, double** @sin_degrees_p.ret
%4 = load double*, double** %2
%5 = load double, double* %4
%6 = fmul double %5, 0x400921FB54442EEA
%7 = fdiv double %6, 1.800000e+02
%8 = call double @sin(double %7)
%9 = load double*, double** @sin_degrees_p.ret
%10 = getelementptr inbounds double, double* %9, i64 0
store double %8, double* %10
%11 = load double*, double** @sin_degrees_p.ret
ret double* %11
}

LLVM IR (-O2):
@sin_degrees_p.ret = internal unnamed_addr global double* null
define double* @sin_degrees_p(double* nocapture %0) {
%2 = tail call double* @malloc(i32 8)
store double* %2, double** @sin_degrees_p.ret
%3 = load double, double* %0
%4 = fmul double %3, 0x400921FB54442EEA
%5 = fdiv double %4, 1.800000e+02
%6 = tail call double @sin(double %5)
%7 = load double*, double** @sin_degrees_p.ret
store double %6, double* %7
ret double* %7
}
unsigned short swap16(unsigned short s) {
  return ((unsigned short)(((s << 8) & 0xff00) | ((s >> 8) & 0x00ff)));
}


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @swap16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = shl i32 %4, 8
%6 = and i32 %5, 65280
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @swap16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_F2MC8(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_F2MC8() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
ugt() { call("ccugt"); }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"ccugt\00"
define i32 @ugt() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printn(int);
void main() {
  int p;
  int x = 2;
  int y = 3;
  int z = 4;
  p = (x * y) + (y * z) + (x * z);
  printn(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <printn@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 2, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = mul nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = mul nsw i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = add nsw i32 %11, %14
store i32 %15, i32* %1
%16 = load i32, i32* %1
%17 = call i32 @printn(i32 %16)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @printn(i32 26)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _at_tf_Errorx(int *);
void _at_ddtf_Errorx(void *_at_input) { _at_tf_Errorx((int *)_at_input); }


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

x86 assembly (clang, -O2):
<_at_ddtf_Errorx>:
jmp    1030 <_at_tf_Errorx@plt>

LLVM IR (-O0):
define void @_at_ddtf_Errorx(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @_at_tf_Errorx(i32* %4)
ret void
}

LLVM IR (-O2):
define void @_at_ddtf_Errorx(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_at_tf_Errorx(i32* %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t decode(uint8_t v) {
  return (v & 0x10) ? (v >> 1 & 0x70) | (v & 0x0F)
                    : (~(v >> 1) & 0x70) | 0x80 | (v & 0x0F);
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
je     112f <decode+0x2f>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x70,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    114b <decode+0x4b>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
xor    $0xffffffff,%eax
and    $0x70,%eax
or     $0x80,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    %edi,%ecx
shr    %ecx
and    $0x70,%ecx
mov    %edi,%eax
and    $0xf,%eax
or     %eax,%ecx
mov    %ecx,%eax
xor    $0xf0,%eax
test   $0x10,%dil
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @decode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %2
%8 = ashr i32 %7, 1
%9 = and i32 %8, 112
%10 = load i32, i32* %2
%11 = and i32 %10, 15
%12 = or i32 %9, %11
br label %22
13: ; preds = %1
%14 = load i32, i32* %2
%15 = ashr i32 %14, 1
%16 = xor i32 %15, -1
%17 = and i32 %16, 112
%18 = or i32 %17, 128
%19 = load i32, i32* %2
%20 = and i32 %19, 15
%21 = or i32 %18, %20
br label %22
22: ; preds = %13, %6
%23 = phi i32 [ %12, %6 ], [ %21, %13 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @decode(i32 %0) {
%2 = and i32 %0, 16
%3 = icmp eq i32 %2, 0
%4 = lshr i32 %0, 1
%5 = and i32 %4, 112
%6 = and i32 %0, 15
%7 = or i32 %5, %6
%8 = xor i32 %7, 240
%9 = select i1 %3, i32 %8, i32 %7
ret i32 %9
}
/* Variables and functions */
scalar_t__ abs(float);
float AbsMax(float lhs, float rhs) {
  if (abs(lhs) > abs(rhs)) {
    return lhs;
  }
  return rhs;
}


x86 assembly (clang, -O0):
<AbsMax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jle    1159 <AbsMax+0x49>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <AbsMax+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AbsMax>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
call   1030 <abs@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
call   1030 <abs@plt>
movss  0xc(%rsp),%xmm0
cmp    %rax,%rbx
jg     1145 <AbsMax+0x35>
movss  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define float @AbsMax(float %0, float %1) {
%3 = tail call i64 @abs(float %0)
%4 = tail call i64 @abs(float %1)
%5 = icmp sgt i64 %3, %4
%6 = select i1 %5, float %0, float %1
ret float %6
}
int main() {
  int x = 2 + 2 + 4;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int syscall(int, int *, int /*<<< orphan*/);
int pipe(int *pd) { return syscall(36, pd, 0); }


x86 assembly (clang, -O0):
<pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x24,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipe>:
mov    %rdi,%rsi
mov    $0x24,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @pipe(i32* %0) {
%2 = tail call i32 @syscall(i32 36, i32* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *return_arg(int *);
int main(void) {
  void *p = (void *)0x87654321;
  int q[] = {1, 2, 3};
  free(p);
  free(return_arg(q));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x87654321,%eax
mov    %rax,-0x10(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    -0x1c(%rbp),%rdi
call   1040 <return_arg@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
mov    $0x87654321,%edi
call   1030 <free@plt>
lea    0x8(%rsp),%rdi
call   1040 <return_arg@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.q = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [3 x i32]
store i32 0, i32* %1
store i8* inttoptr (i64 2271560481 to i8*), i8** %2
%4 = bitcast [3 x i32]* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @free(i8* %5)
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = call i8* @return_arg(i32* %7)
%9 = call i32 @free(i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.q = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = tail call i32 @free(i8* inttoptr (i64 2271560481 to i8*))
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%5 = call i8* @return_arg(i32* %4)
%6 = call i32 @free(i8* %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvttpd_epi32(int /*<<< orphan*/);
__m128i test_mm_cvttpd_epi32(__m128d A) { return _mm_cvttpd_epi32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvttpd_epi32>:
jmp    1030 <_mm_cvttpd_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvttpd_epi32(i32 %0) {
%2 = tail call i32 @_mm_cvttpd_epi32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ p16_adc();
int /*<<< orphan*/ p16_eeprom_2();
int /*<<< orphan*/ p16_int_pin();
int /*<<< orphan*/ p16_int_portb();
int /*<<< orphan*/ p16_mssp();
int /*<<< orphan*/ p16_tmr0();
int /*<<< orphan*/ p16_tmr1();
int /*<<< orphan*/ p16_tmr2();
int /*<<< orphan*/ p16_wdt();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC16F877A_periferic(void) {
  p16_mssp();
  p16_adc();
  p16_int_pin();
  p16_int_portb();
  p16_tmr0();
  p16_wdt();
  p16_eeprom_2();
  p16_tmr1();
  p16_tmr2();
  serial(0);
}


x86 assembly (clang, -O0):
<PIC16F877A_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10b0 <p16_mssp@plt>
mov    $0x0,%al
call   1060 <p16_adc@plt>
mov    $0x0,%al
call   10c0 <p16_int_pin@plt>
mov    $0x0,%al
call   1070 <p16_int_portb@plt>
mov    $0x0,%al
call   1030 <p16_tmr0@plt>
mov    $0x0,%al
call   1090 <p16_wdt@plt>
mov    $0x0,%al
call   10a0 <p16_eeprom_2@plt>
mov    $0x0,%al
call   1080 <p16_tmr1@plt>
mov    $0x0,%al
call   1040 <p16_tmr2@plt>
xor    %edi,%edi
call   1050 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F877A_periferic>:
push   %rax
xor    %eax,%eax
call   10b0 <p16_mssp@plt>
xor    %eax,%eax
call   1060 <p16_adc@plt>
xor    %eax,%eax
call   10c0 <p16_int_pin@plt>
xor    %eax,%eax
call   1070 <p16_int_portb@plt>
xor    %eax,%eax
call   1030 <p16_tmr0@plt>
xor    %eax,%eax
call   1090 <p16_wdt@plt>
xor    %eax,%eax
call   10a0 <p16_eeprom_2@plt>
xor    %eax,%eax
call   1080 <p16_tmr1@plt>
xor    %eax,%eax
call   1040 <p16_tmr2@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <serial@plt>

LLVM IR (-O0):
define void @PIC16F877A_periferic() {
%1 = call i32 (...) @p16_mssp()
%2 = call i32 (...) @p16_adc()
%3 = call i32 (...) @p16_int_pin()
%4 = call i32 (...) @p16_int_portb()
%5 = call i32 (...) @p16_tmr0()
%6 = call i32 (...) @p16_wdt()
%7 = call i32 (...) @p16_eeprom_2()
%8 = call i32 (...) @p16_tmr1()
%9 = call i32 (...) @p16_tmr2()
%10 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F877A_periferic() {
%1 = tail call i32 (...) @p16_mssp()
%2 = tail call i32 (...) @p16_adc()
%3 = tail call i32 (...) @p16_int_pin()
%4 = tail call i32 (...) @p16_int_portb()
%5 = tail call i32 (...) @p16_tmr0()
%6 = tail call i32 (...) @p16_wdt()
%7 = tail call i32 (...) @p16_eeprom_2()
%8 = tail call i32 (...) @p16_tmr1()
%9 = tail call i32 (...) @p16_tmr2()
%10 = tail call i32 @serial(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ forwd(int);
int /*<<< orphan*/ turnright(int);
void star(int len) {
  int i;
  for (i = 0; i < 5; i++) {
    forwd(len);
    turnright(144);
  }
}


x86 assembly (clang, -O0):
<star>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    115c <star+0x3c>
mov    -0x4(%rbp),%edi
call   1040 <forwd@plt>
mov    $0x90,%edi
call   1030 <turnright@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <star+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<star>:
push   %rbx
mov    %edi,%ebx
call   1040 <forwd@plt>
mov    $0x90,%edi
call   1030 <turnright@plt>
mov    %ebx,%edi
call   1040 <forwd@plt>
mov    $0x90,%edi
call   1030 <turnright@plt>
mov    %ebx,%edi
call   1040 <forwd@plt>
mov    $0x90,%edi
call   1030 <turnright@plt>
mov    %ebx,%edi
call   1040 <forwd@plt>
mov    $0x90,%edi
call   1030 <turnright@plt>
mov    %ebx,%edi
call   1040 <forwd@plt>
mov    $0x90,%edi
pop    %rbx
jmp    1030 <turnright@plt>

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

LLVM IR (-O2):
define void @star(i32 %0) {
%2 = tail call i32 @forwd(i32 %0)
%3 = tail call i32 @turnright(i32 144)
%4 = tail call i32 @forwd(i32 %0)
%5 = tail call i32 @turnright(i32 144)
%6 = tail call i32 @forwd(i32 %0)
%7 = tail call i32 @turnright(i32 144)
%8 = tail call i32 @forwd(i32 %0)
%9 = tail call i32 @turnright(i32 144)
%10 = tail call i32 @forwd(i32 %0)
%11 = tail call i32 @turnright(i32 144)
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int bar(char *str) {
  char *pos = strchr(str, 'a');
  return pos - str;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x61,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
mov    %rdi,%rbx
mov    $0x61,%esi
call   1030 <strchr@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @bar(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 97)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 97)
%3 = ptrtoint i8* %2 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, size_t, size_t, size_t);
uint32_t array_show(uint32_t length, uint32_t *array) {
  uint32_t i = 0;
  for (i = 0; i < length; i++) {
    printf("C.array_show(%d): %d -> %d\n", length, i, array[i]);
  }
  return length;
}


x86 assembly (clang, -O0):
<array_show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    116f <array_show+0x5f>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <array_show+0x20>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_show>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
test   %rdi,%rdi
je     114b <array_show+0x3b>
mov    %rsi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r12
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rcx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <array_show+0x20>
mov    %r15,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [28 x i8] c"C.array_show(%d): %d -> %d\0A\00"
define i64 @array_show(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i64
store i64 %0, i64* %3
store i64* %1, i64** %4
store i64 0, i64* %5
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %3
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i64, i64* %3
%12 = load i64, i64* %5
%13 = load i64*, i64** %4
%14 = load i64, i64* %5
%15 = getelementptr inbounds i64, i64* %13, i64 %14
%16 = load i64, i64* %15
%17 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %11, i64 %12, i64 %16)
br label %18
18: ; preds = %10
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
%22 = load i64, i64* %3
ret i64 %22
}

LLVM IR (-O2):
@.str = [28 x i8] c"C.array_show(%d): %d -> %d\0A\00"
define i64 @array_show(i64 returned %0, i64* nocapture %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = load i64, i64* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %5, i64 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %0
br i1 %10, label %11, label %4
11: ; preds = %4, %2
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void xfree(void *lp) {
  if (lp != NULL)
    free(lp);
}


x86 assembly (clang, -O0):
<xfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <xfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfree>:
test   %rdi,%rdi
je     111a <xfree+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @xfree(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 %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @xfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t flash_get_status_flags(void) { return (1); }


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

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

LLVM IR (-O0):
define i32 @flash_get_status_flags() {
ret i32 1
}

LLVM IR (-O2):
define i32 @flash_get_status_flags() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned short fgetc(int /*<<< orphan*/ *);
unsigned short fgetw(FILE *fp) {
  unsigned short s;
  s = fgetc(fp);
  s = (s << 8) | fgetc(fp);
  return s;
}


x86 assembly (clang, -O0):
<fgetw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%eax
movzwl %cx,%ecx
or     %ecx,%eax
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgetw>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1030 <fgetc@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i16 @fgetw(i32* nocapture %0) {
%2 = tail call zeroext i16 @fgetc(i32* %0)
%3 = shl i16 %2, 8
%4 = tail call zeroext i16 @fgetc(i32* %0)
%5 = or i16 %3, %4
ret i16 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void close_dump(FILE *file) {
  if (file == NULL) {
    printf("file pointer doesn't opened\r\n");
    return;
  }
  fclose(file);
  return;
}


x86 assembly (clang, -O0):
<close_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <close_dump+0x28>
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
jmp    1151 <close_dump+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_dump>:
test   %rdi,%rdi
je     112a <close_dump+0xa>
jmp    1040 <fclose@plt>
lea    0xecf(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"file pointer doesn't opened\0D\0A\00"
define void @close_dump(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load i32*, i32** %2
%9 = call i32 @fclose(i32* %8)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"file pointer doesn't opened\0D\00"
define void @close_dump(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @fclose(i32* %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ PANEL;

/* Variables and functions */
int /*<<< orphan*/ del_panel(int /*<<< orphan*/ *);
void close_panel(PANEL *p) {
  if (p) {
    del_panel(p);
    p = NULL;
  }
}


x86 assembly (clang, -O0):
<close_panel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <close_panel+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <del_panel@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_panel>:
test   %rdi,%rdi
je     111a <close_panel+0xa>
jmp    1030 <del_panel@plt>
ret

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

LLVM IR (-O2):
define void @close_panel(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @del_panel(i32* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void rop3_213_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_213_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_213_0_0>:
and    %edx,%esi
mov    (%rdi),%al
not    %al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_213_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = and i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8, i8* %8
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %8
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = and i32 %21, %23
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = xor i32 %27, -1
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = load i8*, i8** %4
store i8 %30, i8* %31
ret void
}

LLVM IR (-O2):
define void @rop3_213_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = and i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, -1
%7 = or i8 %4, %6
store i8 %7, i8* %0
ret void
}
int atoi(char *str) {
  int i = 0;
  char c;
  while ((c = *str++) != '\0') {
    if (c >= '0' && c <= '9') {
      i *= 10;
      i += (c - 48);
    }
  }
  return i;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1162 <atoi+0x62>
movsbl -0xd(%rbp),%eax
cmp    $0x30,%eax
jl     115d <atoi+0x5d>
movsbl -0xd(%rbp),%eax
cmp    $0x39,%eax
jg     115d <atoi+0x5d>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0xd(%rbp),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%dl
test   %dl,%dl
je     1131 <atoi+0x31>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %dl,%eax
lea    -0x30(%rax),%edx
cmp    $0xa,%dl
lea    (%rcx,%rcx,4),%edx
lea    -0x30(%rax,%rdx,2),%eax
cmovae %ecx,%eax
movzbl (%rdi),%edx
add    $0x1,%rdi
mov    %eax,%ecx
test   %dl,%dl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %18, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %16, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %15, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = add i8 %5, -48
%11 = icmp ult i8 %10, 10
%12 = mul nsw i32 %7, 10
%13 = add i32 %12, -48
%14 = add i32 %13, %8
%15 = select i1 %11, i32 %14, i32 %7
%16 = load i8, i8* %9
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %4
18: ; preds = %4, %1
%19 = phi i32 [ 0, %1 ], [ %15, %4 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ printf(char *, int);
void vuln(char *s, int count) {
  char buff[16];
  printf("vuln() has received %d bytes\n", count);
  memcpy(buff, s, count);
}


x86 assembly (clang, -O0):
<vuln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vuln>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    %rsp,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1040 <memcpy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"vuln() has received %d bytes\0A\00"
define void @vuln(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [16 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = call i32 @memcpy(i8* %8, i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"vuln() has received %d bytes\0A\00"
define void @vuln(i8* %0, i32 %1) {
%3 = alloca [16 x i8]
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @memcpy(i8* %4, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_copy_target_dobldobl_solution_to_container(int k, int i) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(468, &k, &i, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_copy_target_dobldobl_solution_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x1d4,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_copy_target_dobldobl_solution_to_container>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x1d4,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_copy_target_dobldobl_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc(i32 468, i32* %3, i32* %4, double* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_copy_target_dobldobl_solution_to_container(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc(i32 468, i32* %3, i32* %4, double* undef)
ret i32 %5
}