xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void env__cat(char *dest, char *name, char *value) {
  dest[0] = '\0';
  strcat(dest, name);
  strcat(dest, "=");
  strcat(dest, value);
}


x86 assembly (clang, -O0):
<env__cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env__cat>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
movb   $0x0,(%rdi)
call   1030 <strcat@plt>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcat@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"=\00"
define void @env__cat(i8* %0, i8* %1, i8* %2) {
store i8 0, i8* %0
%4 = tail call i32 @strcat(i8* %0, i8* %1)
%5 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @strcat(i8* %0, i8* %2)
ret void
}
/* Variables and functions */
double pow(double, double);
double sin(double);
double fx(double tm, double x) {
  return pow((1.0 - pow(sin(tm / 2.0) * sin(x), 2.0)), -0.50);
}


x86 assembly (clang, -O0):
<fx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea5(%rip),%xmm1
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe8d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xe79(%rip),%xmm1
call   1040 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fx>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mulsd  0xece(%rip),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0x8(%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xeae(%rip),%xmm2
subsd  %xmm0,%xmm2
movsd  0xeaa(%rip),%xmm1
movapd %xmm2,%xmm0
add    $0x18,%rsp
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @fx(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fdiv double %5, 2.000000e+00
%7 = call double @sin(double %6)
%8 = load double, double* %4
%9 = call double @sin(double %8)
%10 = fmul double %7, %9
%11 = call double @pow(double %10, double 2.000000e+00)
%12 = fsub double 1.000000e+00, %11
%13 = call double @pow(double %12, double -5.000000e-01)
ret double %13
}

LLVM IR (-O2):
define double @fx(double %0, double %1) {
%3 = fmul double %0, 5.000000e-01
%4 = tail call double @sin(double %3)
%5 = tail call double @sin(double %1)
%6 = fmul double %4, %5
%7 = fmul double %6, %6
%8 = fsub double 1.000000e+00, %7
%9 = tail call double @pow(double %8, double -5.000000e-01)
ret double %9
}
int get16(unsigned char **head) {
  int b1 = (int)**head;
  (*head)++;
  int b2 = (int)**head;
  (*head)++;
  return ((b1 << 8) & 0xff00) | (b2 & 0xff);
}


x86 assembly (clang, -O0):
<get16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x10(%rbp),%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get16>:
mov    (%rdi),%rcx
movzbl (%rcx),%eax
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
movzbl 0x1(%rcx),%edx
add    $0x2,%rcx
mov    %rcx,(%rdi)
shl    $0x8,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @get16(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %5, i8** %0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %8, i8** %0
%9 = shl nuw nsw i32 %4, 8
%10 = or i32 %9, %7
ret i32 %10
}
unsigned Kit_CubeXorLit(unsigned uCube, int i) {
  return uCube ^ (unsigned)(1 << i);
}


x86 assembly (clang, -O0):
<Kit_CubeXorLit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Kit_CubeXorLit(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 = shl i32 1, %6
%8 = xor i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @Kit_CubeXorLit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *xmalloc(size_t);
void *xcopy(const void *ptr, size_t size, size_t expand) {
  void *alloc = xmalloc(size + expand);
  memcpy(alloc, ptr, size);
  return alloc;
}


x86 assembly (clang, -O0):
<xcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
call   1030 <xmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcopy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    (%rdx,%rsi,1),%rdi
call   1030 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xcopy(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = add i64 %8, %9
%11 = call i8* @xmalloc(i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = call i32 @memcpy(i8* %12, i8* %13, i64 %14)
%16 = load i8*, i8** %7
ret i8* %16
}

LLVM IR (-O2):
define i8* @xcopy(i8* %0, i64 %1, i64 %2) {
%4 = add i64 %2, %1
%5 = tail call i8* @xmalloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
ret i8* %5
}
void HMETIS_PartRecursive(int nvtxs, int nhedges, int *vwgts, int *eptr,
                          int *eind, int *hewgts, int nparts, int nbfactor,
                          int *options, int *part, int *edgecnt) {}


x86 assembly (clang, -O0):
<HMETIS_PartRecursive>:
push   %rbp
mov    %rsp,%rbp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @HMETIS_PartRecursive(i32 %0, i32 %1, i32* %2, i32* %3, i32* %4, i32* %5, i32 %6, i32 %7, i32* %8, i32* %9, i32* %10) {
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32*
%21 = alloca i32*
%22 = alloca i32*
store i32 %0, i32* %12
store i32 %1, i32* %13
store i32* %2, i32** %14
store i32* %3, i32** %15
store i32* %4, i32** %16
store i32* %5, i32** %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32* %8, i32** %20
store i32* %9, i32** %21
store i32* %10, i32** %22
ret void
}

LLVM IR (-O2):
define void @HMETIS_PartRecursive(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5, i32 %6, i32 %7, i32* nocapture %8, i32* nocapture %9, i32* nocapture %10) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__6__IO__set();
void Msp430GpioC__13__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__6__IO__set();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__13__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__6__IO__set()
ret void
}
/* Variables and functions */
int cos(double);
int sin(double);
int yuiTurnX(int x, int y, double r) { return x * cos(r) - y * sin(r); }


x86 assembly (clang, -O0):
<yuiTurnX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
sub    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuiTurnX>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %esi,%r14d
mov    %edi,%ebp
call   1040 <cos@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
imul   %r14d,%eax
sub    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @yuiTurnX(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load i32, i32* %4
%8 = load double, double* %6
%9 = call i32 @cos(double %8)
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %5
%12 = load double, double* %6
%13 = call i32 @sin(double %12)
%14 = mul nsw i32 %11, %13
%15 = sub nsw i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @yuiTurnX(i32 %0, i32 %1, double %2) {
%4 = tail call i32 @cos(double %2)
%5 = mul nsw i32 %4, %0
%6 = tail call i32 @sin(double %2)
%7 = mul nsw i32 %6, %1
%8 = sub nsw i32 %5, %7
ret i32 %8
}
float max(float x, float y) {
  float retval = x;
  if (x < y) {
    retval = y;
  }
  return retval;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <max+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
store float %6, float* %5
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fcmp olt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load float, float* %4
store float %11, float* %5
br label %12
12: ; preds = %10, %2
%13 = load float, float* %5
ret float %13
}

LLVM IR (-O2):
define float @max(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
unsigned long int mul34_17(unsigned long int a_34, unsigned int b_17) {
  return a_34 * b_17;
}


x86 assembly (clang, -O0):
<mul34_17>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
imul   %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul34_17>:
mov    %esi,%eax
imul   %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @mul34_17(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = mul i64 %3, %0
ret i64 %4
}
int Operand_uimm8_encode(unsigned int *valp) {
  unsigned imm8_0, uimm8_0;
  uimm8_0 = *valp;
  imm8_0 = (uimm8_0 & 0xff);
  *valp = imm8_0;
  return 0;
}


x86 assembly (clang, -O0):
<Operand_uimm8_encode>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Operand_uimm8_encode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, 255
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32*, i32** %2
store i32 %9, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_uimm8_encode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 255
store i32 %3, i32* %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char get_char(FILE *fp, long int pos) {
  char c;
  fseek(fp, sizeof(char) * pos, 0);
  fread(&c, sizeof(char), 1, fp);
  return c;
}


x86 assembly (clang, -O0):
<get_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
movsbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_char>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edx,%edx
call   1040 <fseek@plt>
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
mov    0xf(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @get_char(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i8
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = load i32*, i32** %3
%7 = load i64, i64* %4
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i32 @fseek(i32* %6, i32 %9, i32 0)
%11 = load i32*, i32** %3
%12 = call i32 @fread(i8* %5, i32 1, i32 1, i32* %11)
%13 = load i8, i8* %5
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @get_char(i32* nocapture %0, i64 %1) {
%3 = alloca i8
%4 = trunc i64 %1 to i32
%5 = tail call i32 @fseek(i32* %0, i32 %4, i32 0)
%6 = call i32 @fread(i8* %3, i32 1, i32 1, i32* %0)
%7 = load i8, i8* %3
ret i8 %7
}
match(s1, s2) register char *s1, *s2;
{
  while (*s1 == *s2++) {
    if (*s1 == '=')
      return 1;
    s1++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    115a <match+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1149 <match+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1161 <match+0x61>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <match+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1125 <match+0x25>
mov    $0x1,%edx
nopl   (%rax)
cmp    $0x3d,%cl
je     1126 <match+0x26>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <match+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %10, label %17
6: ; preds = %10
%7 = load i8, i8* %16
%8 = load i8, i8* %14
%9 = icmp eq i8 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %2, %6
%11 = phi i8* [ %14, %6 ], [ %1, %2 ]
%12 = phi i8 [ %7, %6 ], [ %3, %2 ]
%13 = phi i8* [ %16, %6 ], [ %0, %2 ]
%14 = getelementptr inbounds i8, i8* %11, i64 1
%15 = icmp eq i8 %12, 61
%16 = getelementptr inbounds i8, i8* %13, i64 1
br i1 %15, label %17, label %6
17: ; preds = %10, %6, %2
%18 = phi i32 [ 0, %2 ], [ 0, %6 ], [ 1, %10 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ fd_delay_us(int);
void fd_i2cm_delay(void) { fd_delay_us(5); }


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

x86 assembly (clang, -O2):
<fd_i2cm_delay>:
mov    $0x5,%edi
jmp    1030 <fd_delay_us@plt>

LLVM IR (-O0):
define void @fd_i2cm_delay() {
%1 = call i32 @fd_delay_us(i32 5)
ret void
}

LLVM IR (-O2):
define void @fd_i2cm_delay() {
%1 = tail call i32 @fd_delay_us(i32 5)
ret void
}
char toHexDigit(int i) { return i < 10 ? i + '0' : i + 'A' - 10; }


x86 assembly (clang, -O0):
<toHexDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    111f <toHexDigit+0x1f>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <toHexDigit+0x2b>
mov    -0x4(%rbp),%eax
add    $0x41,%eax
sub    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toHexDigit>:
lea    0x37(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @toHexDigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 48
br label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 65
%11 = sub nsw i32 %10, 10
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @toHexDigit(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 55
%4 = add nsw i32 %3, %0
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_getbkgrnd(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_getbkgrnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_getbkgrnd+0x2a>
jmp    1170 <cmd_getbkgrnd+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_getbkgrnd>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_getbkgrnd+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_getbkgrnd(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_getbkgrnd(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ terminal_putchar(unsigned char);
void putString(char *string) {
  int cnt = 0;
  while (string[cnt] != 0)
    terminal_putchar((unsigned char)string[cnt++]);
}


x86 assembly (clang, -O0):
<putString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <putString+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1030 <terminal_putchar@plt>
jmp    1123 <putString+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <putString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movzbl %al,%edi
call   1030 <terminal_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <putString+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @putString(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
%16 = sext i32 %14 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @terminal_putchar(i8 zeroext %18)
br label %4
20: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @putString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @terminal_putchar(i8 zeroext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void osflushoutput(void) {}


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

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

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

LLVM IR (-O2):
define void @osflushoutput() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int cont1, cont2;
  scanf("%d", &cont1);
  printf("textoqualquer\n");
  cont1 = cont2;
  if (cont1 > cont2) {
    cont2 = cont1;
  } else
    printf("qualquer coisa\n");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1178 <main+0x48>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1184 <main+0x54>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [14 x i8] c"textoqualquer\00"
@str.3 = [15 x i8] c"qualquer coisa\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
size_t max(size_t a, size_t b) { return a <= b ? b : a; }


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

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

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int int_log10(unsigned long long arg) {
  int l = 0;
  arg = arg / 10;
  while (arg) {
    l++;
    arg = arg / 10;
  }
  return l;
}


x86 assembly (clang, -O0):
<int_log10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <int_log10+0x4c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    1121 <int_log10+0x21>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_log10>:
xor    %ecx,%ecx
cmp    $0xa,%rdi
jb     1136 <int_log10+0x36>
xor    %ecx,%ecx
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%ecx
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <int_log10+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @int_log10(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 0, i32* %3
%4 = load i64, i64* %2
%5 = udiv i64 %4, 10
store i64 %5, i64* %2
br label %6
6: ; preds = %9, %1
%7 = load i64, i64* %2
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i64, i64* %2
%13 = udiv i64 %12, 10
store i64 %13, i64* %2
br label %6
14: ; preds = %6
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @int_log10(i64 %0) {
%2 = icmp ult i64 %0, 10
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i64 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 100
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Type definitions */
typedef unsigned int volatile uint32_t;
typedef unsigned int uint16_t;

/* Variables and functions */
__attribute__((always_)) uint32_t
mchp_espi_sram_bar_valid_get(uintptr_t bar_addr) {
  return (*((volatile uint16_t *)(uintptr_t)(bar_addr)) >> 0u) & 0x01ul;
}


x86 assembly (clang, -O0):
<mchp_espi_sram_bar_valid_get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shr    $0x0,%eax
mov    %eax,%eax
and    $0x1,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mchp_espi_sram_bar_valid_get(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = lshr i32 %5, 0
%7 = zext i32 %6 to i64
%8 = and i64 %7, 1
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mchp_espi_sram_bar_valid_get(i64 %0) {
%2 = inttoptr i64 %0 to i32*
%3 = load volatile i32, i32* %2
%4 = and i32 %3, 1
ret i32 %4
}
int main() {
  int b = 2;
  while (b) {
    b = 2 * b;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112a <main+0x2a>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = mul nsw i32 2, %7
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
void rop3_147_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T & *D;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_147_1_1>:
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
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_147_1_1>:
mov    (%rdi),%al
mov    %eax,%ecx
and    %dl,%cl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_147_1_1(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** %4
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %10, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_147_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %2
%6 = or i8 %2, %1
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = or i8 %9, %5
store i8 %10, i8* %0
ret void
}
int sf_is_ssm_supported(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @sf_is_ssm_supported() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FUNC_lang();
int /*<<< orphan*/ FUNC_symtab();
int main(void) {
  FUNC_lang();
  FUNC_symtab();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <FUNC_lang@plt>
mov    $0x0,%al
call   1030 <FUNC_symtab@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @FUNC_lang()
%3 = call i32 (...) @FUNC_symtab()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @FUNC_lang()
%2 = tail call i32 (...) @FUNC_symtab()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i, n, sn = 0;
  for (i = 1; i <= n; i++)
    if (i < 10)
      sn = sn + 2;
  assert(sn == n * 2 || sn == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     115f <main+0x4f>
cmpl   $0xa,-0x8(%rbp)
jge    114c <main+0x3c>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    $0x1,%al
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     117f <main+0x6f>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 1, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %19
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 10
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 2
store i32 %14, i32* %4
br label %15
15: ; preds = %12, %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = mul nsw i32 %21, 2
%23 = icmp eq i32 %20, %22
br i1 %23, label %27, label %24
24: ; preds = %19
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 0
br label %27
27: ; preds = %24, %19
%28 = phi i1 [ true, %19 ], [ %26, %24 ]
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void __wbeu16(uint8_t *buffer, uint16_t value) {
  buffer[0] = (uint8_t)(value >> 8) & 0xFF;
  buffer[1] = (uint8_t)(value >> 0) & 0xFF;
}


x86 assembly (clang, -O0):
<__wbeu16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wbeu16>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,(%rdi)
movzbl %al,%eax
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @__wbeu16(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 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 0
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
ret void
}

LLVM IR (-O2):
define void @__wbeu16(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
store i32 %4, i32* %0
%5 = and i32 %1, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
ret void
}
/* Variables and functions */
scalar_t__ a_cas(void volatile *, int, int);
void *a_cas_p(volatile void *p, void *t, void *s) {
  return (void *)a_cas(p, (int)t, (int)s);
}


x86 assembly (clang, -O0):
<a_cas_p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <a_cas@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_cas_p>:
jmp    1030 <a_cas@plt>

LLVM IR (-O0):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i32
%10 = load i8*, i8** %6
%11 = ptrtoint i8* %10 to i32
%12 = call i64 @a_cas(i8* %7, i32 %9, i32 %11)
%13 = inttoptr i64 %12 to i8*
ret i8* %13
}

LLVM IR (-O2):
define i8* @a_cas_p(i8* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = ptrtoint i8* %2 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i64 @a_cas(i8* %0, i32 %5, i32 %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ test84_MPT1_foo__E();
int /*<<< orphan*/ test84_MPT2_foo__E();
void test84_MetaPinTestMod_pollen__run__E() {
  test84_MPT1_foo__E();
  test84_MPT2_foo__E();
}


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

x86 assembly (clang, -O2):
<test84_MetaPinTestMod_pollen__run__E>:
push   %rax
xor    %eax,%eax
call   1040 <test84_MPT1_foo__E@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test84_MPT2_foo__E@plt>

LLVM IR (-O0):
define void @test84_MetaPinTestMod_pollen__run__E() {
%1 = call i32 (...) @test84_MPT1_foo__E()
%2 = call i32 (...) @test84_MPT2_foo__E()
ret void
}

LLVM IR (-O2):
define void @test84_MetaPinTestMod_pollen__run__E() {
%1 = tail call i32 (...) @test84_MPT1_foo__E()
%2 = tail call i32 (...) @test84_MPT2_foo__E()
ret void
}
void pst_debug_lock() {}


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

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

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

LLVM IR (-O2):
define void @pst_debug_lock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void ptc_cleanup_callback(void) { fprintf(stderr, "Callback!\n"); }


x86 assembly (clang, -O0):
<ptc_cleanup_callback>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptc_cleanup_callback>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Callback!\0A\00"
define void @ptc_cleanup_callback() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Callback!\0A\00"
define void @ptc_cleanup_callback() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dealinput();
int /*<<< orphan*/ destroy();
int /*<<< orphan*/ drawui();
int /*<<< orphan*/ init();
int main() {
  init();
  drawui();
  dealinput();
  destroy();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <init@plt>
mov    $0x0,%al
call   1030 <drawui@plt>
mov    $0x0,%al
call   1060 <dealinput@plt>
mov    $0x0,%al
call   1040 <destroy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1030 <drawui@plt>
xor    %eax,%eax
call   1060 <dealinput@plt>
xor    %eax,%eax
call   1040 <destroy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 (...) @drawui()
%4 = call i32 (...) @dealinput()
%5 = call i32 (...) @destroy()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @drawui()
%3 = tail call i32 (...) @dealinput()
%4 = tail call i32 (...) @destroy()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA(int, int);
void GyOutSignal(void) {
  RegWriteA(0x0283, 0x45);
  RegWriteA(0x0284, 0x43);
  RegWriteA(0x0280, 0x02);
}


x86 assembly (clang, -O0):
<GyOutSignal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x283,%edi
mov    $0x45,%esi
call   1030 <RegWriteA@plt>
mov    $0x284,%edi
mov    $0x43,%esi
call   1030 <RegWriteA@plt>
mov    $0x280,%edi
mov    $0x2,%esi
call   1030 <RegWriteA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyOutSignal>:
push   %rax
mov    $0x283,%edi
mov    $0x45,%esi
call   1030 <RegWriteA@plt>
mov    $0x284,%edi
mov    $0x43,%esi
call   1030 <RegWriteA@plt>
mov    $0x280,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <RegWriteA@plt>

LLVM IR (-O0):
define void @GyOutSignal() {
%1 = call i32 @RegWriteA(i32 643, i32 69)
%2 = call i32 @RegWriteA(i32 644, i32 67)
%3 = call i32 @RegWriteA(i32 640, i32 2)
ret void
}

LLVM IR (-O2):
define void @GyOutSignal() {
%1 = tail call i32 @RegWriteA(i32 643, i32 69)
%2 = tail call i32 @RegWriteA(i32 644, i32 67)
%3 = tail call i32 @RegWriteA(i32 640, i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *name, mode_t mode) {
  return open(name, O_CREAT | O_WRONLY | O_TRUNC, mode);
}


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2ee1(%rip),%rcx
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
void resctrl_lock_signalhandler(int signal) { (void)(signal); }


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

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

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

LLVM IR (-O2):
define void @resctrl_lock_signalhandler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msleep(int);
void lib_msleep(int ms) { msleep(ms); }


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

x86 assembly (clang, -O2):
<lib_msleep>:
jmp    1030 <msleep@plt>

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

LLVM IR (-O2):
define void @lib_msleep(i32 %0) {
%2 = tail call i32 @msleep(i32 %0)
ret void
}