xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int read8(int /*<<< orphan*/);
uint64_t dictionary_get(uint16_t addr) {
  uint64_t v = 0;
  int c = 3 > 3 ? 6 : 4;
  while (c--)
    v = (v << 8) | read8(addr++);
  return v;
}


x86 assembly (clang, -O0):
<dictionary_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1165 <dictionary_get+0x55>
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <read8@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <dictionary_get+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictionary_get>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%ebx
lea    0x1(%rbx),%r14d
call   1030 <read8@plt>
mov    %eax,%r12d
lea    0x2(%rbx),%r15d
mov    %r14d,%edi
call   1030 <read8@plt>
mov    %eax,%r14d
shl    $0x10,%r12d
shl    $0x8,%r14d
add    $0x3,%ebx
mov    %r15d,%edi
call   1030 <read8@plt>
mov    %eax,%ebp
or     %r12d,%ebp
or     %r14d,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
call   1030 <read8@plt>
or     %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dictionary_get(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @read8(i32 %0)
%4 = add nsw i32 %0, 2
%5 = tail call i32 @read8(i32 %2)
%6 = shl i32 %3, 16
%7 = shl i32 %5, 8
%8 = or i32 %6, %7
%9 = add nsw i32 %0, 3
%10 = tail call i32 @read8(i32 %4)
%11 = or i32 %10, %8
%12 = shl i32 %11, 8
%13 = tail call i32 @read8(i32 %9)
%14 = or i32 %13, %12
ret i32 %14
}
float Cubic__easeOut(float t, float b, float c, float d, float p0, float p1) {
  return c * ((t = t / d - 1) * t * t + 1) + b;
}


x86 assembly (clang, -O0):
<Cubic__easeOut>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
divss  -0x10(%rbp),%xmm2
movss  0xec7(%rip),%xmm1
subss  %xmm1,%xmm2
movss  %xmm2,-0x4(%rbp)
mulss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm2
movss  0xea8(%rip),%xmm1
addss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cubic__easeOut>:
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 @Cubic__easeOut(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %9
%14 = load float, float* %7
%15 = load float, float* %10
%16 = fdiv float %14, %15
%17 = fsub float %16, 1.000000e+00
store float %17, float* %7
%18 = load float, float* %7
%19 = fmul float %17, %18
%20 = load float, float* %7
%21 = call float @llvm.fmuladd.f32(float %19, float %20, float 1.000000e+00)
%22 = load float, float* %8
%23 = call float @llvm.fmuladd.f32(float %13, float %21, float %22)
ret float %23
}

LLVM IR (-O2):
define float @Cubic__easeOut(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fdiv float %0, %3
%8 = fadd float %7, -1.000000e+00
%9 = fmul float %8, %8
%10 = tail call float @llvm.fmuladd.f32(float %9, float %8, float 1.000000e+00)
%11 = tail call float @llvm.fmuladd.f32(float %2, float %10, float %1)
ret float %11
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf39(int f, int n) { return (cbuf(f, n, 39)); }


x86 assembly (clang, -O0):
<cbuf39>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x27,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf39>:
mov    $0x27,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf39(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 39)
ret i32 %3
}
/* Type definitions */
struct list_item {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list_item *);
void release_list_item(struct list_item *item) {
  if (item)
    free(item);
}


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

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

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

LLVM IR (-O2):
%struct.list_item = type { i32 }
define void @release_list_item(%struct.list_item* %0) {
%2 = icmp eq %struct.list_item* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.list_item* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int bitNor(int x, int y) { return (~x & ~y); }


x86 assembly (clang, -O0):
<bitNor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitNor>:
mov    %edi,%eax
or     %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @bitNor(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 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @bitNor(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = xor i32 %3, -1
ret i32 %4
}
void rgb888_to_rgb565(void *dst, const void *src, int bytes) {}


x86 assembly (clang, -O0):
<rgb888_to_rgb565>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rgb888_to_rgb565(i8* nocapture %0, i8* nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dumpByte(unsigned short);
void dumpShort(unsigned short s) {
  dumpByte((s >> 8) & 0xff);
  dumpByte(s & 0xff);
}


x86 assembly (clang, -O0):
<dumpShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1030 <dumpByte@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
movzwl %ax,%edi
call   1030 <dumpByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpShort>:
push   %rbx
mov    %edi,%ebx
shr    $0x8,%edi
call   1030 <dumpByte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <dumpByte@plt>

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

LLVM IR (-O2):
define void @dumpShort(i16 zeroext %0) {
%2 = lshr i16 %0, 8
%3 = tail call i32 @dumpByte(i16 zeroext %2)
%4 = and i16 %0, 255
%5 = tail call i32 @dumpByte(i16 zeroext %4)
ret void
}
int fb_SGNb(char x) {
  if (x == 0)
    return 0;
  else if (x > 0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<fb_SGNb>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1123 <fb_SGNb+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1143 <fb_SGNb+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jle    113c <fb_SGNb+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <fb_SGNb+0x43>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_SGNb>:
xor    %ecx,%ecx
xor    %eax,%eax
test   %dil,%dil
setg   %al
lea    -0x1(%rax,%rax,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fb_SGNb(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %14
13: ; preds = %8
store i32 -1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @fb_SGNb(i8 signext %0) {
%2 = icmp eq i8 %0, 0
%3 = icmp sgt i8 %0, 0
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fpointer = fopen("archivo1.txt", "a");
  fprintf(fpointer, "\nmi segunda linea");
  fclose(fpointer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xede(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebf(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"archivo1.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [18 x i8] c"\0Ami segunda linea\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fprintf(i32* %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"archivo1.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [18 x i8] c"\0Ami segunda linea\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i64 17, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg16setBank0(int);
void m156setParamsC010(uint16_t addr, uint8_t val) {
  (void)addr;
  prg16setBank0(val << 14);
}


x86 assembly (clang, -O0):
<m156setParamsC010>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0xe,%edi
call   1030 <prg16setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m156setParamsC010>:
mov    %esi,%edi
shl    $0xe,%edi
jmp    1030 <prg16setBank0@plt>

LLVM IR (-O0):
define void @m156setParamsC010(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 %6, 14
%8 = call i32 @prg16setBank0(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m156setParamsC010(i32 %0, i32 %1) {
%3 = shl i32 %1, 14
%4 = tail call i32 @prg16setBank0(i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int64_t;

/* Variables and functions */
int /*<<< orphan*/ be64toh(int /*<<< orphan*/);
u_int64_t ntoh64(u_int64_t u64) { return be64toh(u64); }


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

x86 assembly (clang, -O2):
<ntoh64>:
jmp    1030 <be64toh@plt>

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

LLVM IR (-O2):
define i32 @ntoh64(i32 %0) {
%2 = tail call i32 @be64toh(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int GetZeroCoMotionShell(const int shellindex) {
  assert(0 <= shellindex);
  if (shellindex == 0) {
    return 0;
  }
  if (shellindex % 2 == 0) {
    return shellindex - 1;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<GetZeroCoMotionShell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1143 <GetZeroCoMotionShell+0x33>
movl   $0x0,-0x4(%rbp)
jmp    116c <GetZeroCoMotionShell+0x5c>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1165 <GetZeroCoMotionShell+0x55>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <GetZeroCoMotionShell+0x5c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetZeroCoMotionShell>:
push   %rbx
mov    %edi,%eax
and    $0x1,%eax
neg    %eax
sbb    %eax,%eax
lea    -0x1(%rdi),%ecx
or     %ecx,%eax
xor    %ebx,%ebx
cmp    $0x1,%edi
not    %edi
cmovae %eax,%ebx
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @GetZeroCoMotionShell(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 0, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 0, i32* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* %3
%13 = srem i32 %12, 2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %3
%17 = sub nsw i32 %16, 1
store i32 %17, i32* %2
br label %19
18: ; preds = %11
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %15, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @GetZeroCoMotionShell(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp eq i32 %0, 0
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
%8 = add nsw i32 %0, -1
%9 = select i1 %7, i32 %8, i32 -1
%10 = select i1 %5, i32 0, i32 %9
ret i32 %10
}
int test_imm_49int8_mem(signed char *val) {
  return ((*val) & (-0x49 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_49int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -73
%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_49int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -73
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ emulate_inkey(int /*<<< orphan*/);
int /*<<< orphan*/ eval_intfactor();
int /*<<< orphan*/ push_int(int /*<<< orphan*/);
void fn_inkey(void) { push_int(emulate_inkey(eval_intfactor())); }


x86 assembly (clang, -O0):
<fn_inkey>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <eval_intfactor@plt>
mov    %eax,%edi
call   1030 <emulate_inkey@plt>
mov    %eax,%edi
call   1050 <push_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_inkey>:
push   %rax
xor    %eax,%eax
call   1040 <eval_intfactor@plt>
mov    %eax,%edi
call   1030 <emulate_inkey@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <push_int@plt>

LLVM IR (-O0):
define void @fn_inkey() {
%1 = call i32 (...) @eval_intfactor()
%2 = call i32 @emulate_inkey(i32 %1)
%3 = call i32 @push_int(i32 %2)
ret void
}

LLVM IR (-O2):
define void @fn_inkey() {
%1 = tail call i32 (...) @eval_intfactor()
%2 = tail call i32 @emulate_inkey(i32 %1)
%3 = tail call i32 @push_int(i32 %2)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ findMin(struct TreeNode *, int *);
int /*<<< orphan*/ helper(struct TreeNode *, int *);
int maxPathSum(struct TreeNode *root) {
  int res = 0;
  findMin(root, &res);
  helper(root, &res);
  return res;
}


x86 assembly (clang, -O0):
<maxPathSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <findMin@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <helper@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxPathSum>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rsi
call   1030 <findMin@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <helper@plt>
mov    0x4(%rsp),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @maxPathSum(%struct.TreeNode* %0) {
%2 = alloca %struct.TreeNode*
%3 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %2
store i32 0, i32* %3
%4 = load %struct.TreeNode*, %struct.TreeNode** %2
%5 = call i32 @findMin(%struct.TreeNode* %4, i32* %3)
%6 = load %struct.TreeNode*, %struct.TreeNode** %2
%7 = call i32 @helper(%struct.TreeNode* %6, i32* %3)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @maxPathSum(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @findMin(%struct.TreeNode* %0, i32* %2)
%5 = call i32 @helper(%struct.TreeNode* %0, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
/* Variables and functions */
scalar_t__ hash_int(void *);
int equal_int(void *ip, void *jp) { return hash_int(ip) == hash_int(jp); }


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash_int@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <hash_int@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <hash_int@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <hash_int@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @equal_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i64 @hash_int(i8* %5)
%7 = load i8*, i8** %4
%8 = call i64 @hash_int(i8* %7)
%9 = icmp eq i64 %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @equal_int(i8* %0, i8* %1) {
%3 = tail call i64 @hash_int(i8* %0)
%4 = tail call i64 @hash_int(i8* %1)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ modbig(int *, int *);
void biggcd(int *x, int *y) {
  int *z;
  while (1) {
    if (y[0] == 1 && y[1] == 0)
      return;
    modbig(x, y);
    z = y;
    y = x;
    x = z;
  }
}


x86 assembly (clang, -O0):
<biggcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
jne    1141 <biggcd+0x31>
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
jne    1141 <biggcd+0x31>
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <modbig@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <biggcd+0x10>

x86 assembly (clang, -O2):
<biggcd>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
jmp    1131 <biggcd+0x21>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <modbig@plt>
mov    %r14,%rsi
mov    %rbx,%r14
mov    %rsi,%rbx
cmpl   $0x1,(%rsi)
jne    1120 <biggcd+0x10>
cmpl   $0x0,0x4(%rbx)
jne    1120 <biggcd+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @biggcd(i32* %0, i32* %1) {
br label %3
3: ; preds = %13, %2
%4 = phi i32* [ %1, %2 ], [ %5, %13 ]
%5 = phi i32* [ %0, %2 ], [ %4, %13 ]
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = getelementptr inbounds i32, i32* %4, i64 1
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
ret void
13: ; preds = %8, %3
%14 = tail call i32 @modbig(i32* %5, i32* %4)
br label %3
}
/* Variables and functions */
scalar_t__ is_armstrong(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ putchar(char);
int main() {
  unsigned i;
  for (i = 0; i < 3000; ++i)
    if (is_armstrong(i))
      printf("%d ", i);
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xbb8,-0x8(%rbp)
jae    1187 <main+0x57>
mov    -0x8(%rbp),%edi
call   1050 <is_armstrong@plt>
cmp    $0x0,%rax
je     1174 <main+0x44>
mov    -0x8(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
jmp    1179 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xec3(%rip),%r14
jmp    114b <main+0x1b>
nop
add    $0x1,%ebx
cmp    $0xbb8,%ebx
je     1163 <main+0x33>
mov    %ebx,%edi
call   1050 <is_armstrong@plt>
test   %rax,%rax
je     1140 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
jmp    1140 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = tail call i64 @is_armstrong(i32 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %1, %5
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 3000
br i1 %9, label %10, label %1
10: ; preds = %7
%11 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
char *addColor(char *, char *);
char *yellow(char *str) { return addColor("33", str); }


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

x86 assembly (clang, -O2):
<yellow>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <addColor@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"33\00"
define i8* @yellow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"33\00"
define i8* @yellow(i8* %0) {
%2 = tail call i8* @addColor(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %2
}
/* Variables and functions */
size_t ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, size_t);
void ft_putstr_fd(char const *s, int fd) {
  size_t len;
  len = ft_strlen(s);
  write(fd, s, len);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i64 @ft_strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i32, i32* %4
%9 = load i8*, i8** %3
%10 = load i64, i64* %5
%11 = call i32 @write(i32 %8, i8* %9, i64 %10)
ret void
}

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = tail call i64 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i64 %3)
ret void
}
__attribute__((always_)) void zone_span_writeunlock(struct zone *zone) {}


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

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

LLVM IR (-O0):
%struct.zone = type opaque
define void @zone_span_writeunlock(%struct.zone* %0) {
%2 = alloca %struct.zone*
store %struct.zone* %0, %struct.zone** %2
ret void
}

LLVM IR (-O2):
%struct.zone = type opaque
define void @zone_span_writeunlock(%struct.zone* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int abs(int x) {
  if (0 <= x)
    goto end;
  if (x < -2147483647)
    abort();
  x = 0 - x;
end:
  return x;
}


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jg     112b <abs+0x1b>
jmp    1147 <abs+0x37>
cmpl   $0x80000001,-0x4(%rbp)
jge    113f <abs+0x2f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
test   %edi,%edi
js     1117 <abs+0x7>
mov    %edi,%eax
ret
cmp    $0x80000000,%edi
je     1124 <abs+0x14>
neg    %edi
mov    %edi,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 0, %3
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, -2147483647
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = load i32, i32* %2
%13 = sub nsw i32 0, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %5
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, -2147483648
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %3
%8 = sub nsw i32 0, %0
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ %0, %1 ], [ %8, %7 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
main() {
  int i;
  char str[3];
  str[0] = 'h';
  str[1] = 'i';
  str[2] = '\0';
  printf("%s\n", str);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x68,-0x7(%rbp)
movb   $0x69,-0x6(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0x7(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6968,0x5(%rsp)
movb   $0x0,0x7(%rsp)
lea    0xecc(%rip),%rdi
lea    0x5(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
store i8 104, i8* %2
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
store i8 105, i8* %3
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 2
store i8 0, i8* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = call i32 (...) @getchar()
ret i32 0
}
unsigned short getValue(unsigned char boardNumber, unsigned char rowNumber,
                        unsigned char pinNumber) {
  return getValueInternal((unsigned int)(boardNumber)*32 + rowNumber * 8 +
                          pinNumber);
}


x86 assembly (clang, -O0):
<getValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%edi
shl    $0x5,%edi
movzbl -0x2(%rbp),%eax
shl    $0x3,%eax
add    %eax,%edi
movzbl -0x3(%rbp),%eax
add    %eax,%edi
mov    $0x0,%al
call   1030 <getValueInternal@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getValue>:
push   %rax
shl    $0x5,%edi
lea    (%rdi,%rsi,8),%edi
add    %edx,%edi
xor    %eax,%eax
call   1030 <getValueInternal@plt>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @getValue(i8 zeroext %0, i8 zeroext %1, i8 zeroext %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 = zext i8 %7 to i32
%9 = mul i32 %8, 32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = mul nsw i32 %11, 8
%13 = add i32 %9, %12
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = add i32 %13, %15
%17 = call i32 (i32, ...) bitcast (i32 (...)* @getValueInternal to i32 (i32, ...)*)(i32 %16)
%18 = trunc i32 %17 to i16
ret i16 %18
}

LLVM IR (-O2):
define zeroext i16 @getValue(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %0 to i32
%5 = shl nuw nsw i32 %4, 5
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 3
%8 = add nuw nsw i32 %7, %5
%9 = zext i8 %2 to i32
%10 = add nuw nsw i32 %8, %9
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @getValueInternal to i32 (i32, ...)*)(i32 %10)
%12 = trunc i32 %11 to i16
ret i16 %12
}
void test_f31(int *v __attribute__((__unused__))) {}


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

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

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

LLVM IR (-O2):
define void @test_f31(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dst;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void memcpy_bad4() {
  int src[1];
  int buff[1];
  int *dst = &buff[0];
  memcpy(dst, src, sizeof(dst));
}


x86 assembly (clang, -O0):
<memcpy_bad4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy_bad4>:
push   %rax
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x8,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @memcpy_bad4() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = alloca i32*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 8)
ret void
}

LLVM IR (-O2):
define void @memcpy_bad4() {
%1 = alloca [1 x i32]
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %1 to i8*
%4 = bitcast [1 x i32]* %2 to i8*
%5 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
%7 = call i32 @memcpy(i32* %5, i32* %6, i32 8)
ret void
}
void filesystem_init(void) {}


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

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

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

LLVM IR (-O2):
define void @filesystem_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
int edflib_strlcpy(char *dst, const char *src, int sz) {
  int srclen;
  sz--;
  srclen = strlen(src);
  if (srclen > sz)
    srclen = sz;
  memcpy(dst, src, srclen);
  dst[srclen] = 0;
  return srclen;
}


x86 assembly (clang, -O0):
<edflib_strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    115a <edflib_strlcpy+0x3a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edflib_strlcpy>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rbx),%ebp
cmp    %ebx,%eax
cmovl  %eax,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
movslq %ebp,%rax
movb   $0x0,(%r15,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @edflib_strlcpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp slt i32 %4, %2
%6 = add nsw i32 %2, -1
%7 = select i1 %5, i32 %4, i32 %6
%8 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %7)
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret i32 %7
}
void swap(int *arr, int i, int j) {
  int tmp = arr[i];
  arr[i] = arr[j];
  arr[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int jac_chain_nm5_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 32;
  return 0;
}


x86 assembly (clang, -O0):
<jac_chain_nm5_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jac_chain_nm5_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jac_chain_nm5_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jac_chain_nm5_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jac_chain_nm5_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x20,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_chain_nm5_work>:
test   %rdi,%rdi
je     110b <jac_chain_nm5_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jac_chain_nm5_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jac_chain_nm5_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jac_chain_nm5_work+0x2c>
movl   $0x20,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @jac_chain_nm5_work(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i32*, i32** %5
store i32 2, i32* %12
br label %13
13: ; preds = %11, %4
%14 = load i32*, i32** %6
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = load i32*, i32** %6
store i32 2, i32* %17
br label %18
18: ; preds = %16, %13
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32*, i32** %7
store i32 0, i32* %22
br label %23
23: ; preds = %21, %18
%24 = load i32*, i32** %8
%25 = icmp ne i32* %24, null
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = load i32*, i32** %8
store i32 32, i32* %27
br label %28
28: ; preds = %26, %23
ret i32 0
}

LLVM IR (-O2):
define i32 @jac_chain_nm5_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 32, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
int shmobile_cpuidle_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @shmobile_cpuidle_init() {
ret i32 0
}
double fixZ(double z) {
  if (z > (1.0 - 1.0E-6))
    return (1.0 - 1.0E-6);
  if (z < 1.0E-15)
    return 1.0E-15;
  return z;
}


x86 assembly (clang, -O0):
<fixZ>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1132 <fixZ+0x32>
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1161 <fixZ+0x61>
movsd  0xece(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1157 <fixZ+0x57>
movsd  0xebb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1161 <fixZ+0x61>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixZ>:
movsd  0xef8(%rip),%xmm2
maxsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
movapd %xmm3,%xmm1
cmpltsd %xmm0,%xmm1
movapd %xmm1,%xmm0
andnpd %xmm2,%xmm0
andpd  %xmm3,%xmm1
orpd   %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fixZ(double %0) {
%2 = fcmp ogt double %0, 0x3FEFFFFDE7210BE9
%3 = fcmp olt double %0, 1.000000e-15
%4 = select i1 %3, double 1.000000e-15, double %0
%5 = select i1 %2, double 0x3FEFFFFDE7210BE9, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char *);
char *xstrdup(char *str) {
  char *buf = strdup(str);
  if (buf == NULL) {
    fprintf(stderr, "It is not enough memory\n");
    exit(1);
  }
  return buf;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xstrdup+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rax
call   1050 <strdup@plt>
test   %rax,%rax
je     113d <xstrdup+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"It is not enough memory\0A\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"It is not enough memory\0A\00"
define noalias i8* @xstrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int corner_perm(int cubieval) { return cubieval & 7; }


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

x86 assembly (clang, -O2):
<corner_perm>:
mov    %edi,%eax
and    $0x7,%eax
ret

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

LLVM IR (-O2):
define i32 @corner_perm(i32 %0) {
%2 = and i32 %0, 7
ret i32 %2
}