xunge/DecIR huggingface dataset:
int HECMW_partwrap(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @HECMW_partwrap() {
ret i32 1
}
int test_imm_20int16_mem(short *val) {
  return ((*val) & (0x20 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_20int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 32
%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_20int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 32
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float celsius_to_newton(float temperature) { return temperature * 33 / 100; }


x86 assembly (clang, -O0):
<celsius_to_newton>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius_to_newton>:
mulss  0xef8(%rip),%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @celsius_to_newton(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 3.300000e+01
%5 = fdiv float %4, 1.000000e+02
ret float %5
}

LLVM IR (-O2):
define float @celsius_to_newton(float %0) {
%2 = fmul float %0, 3.300000e+01
%3 = fdiv float %2, 1.000000e+02
ret float %3
}
/* Type definitions */
struct mloop_idle {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct mloop_idle *);
int /*<<< orphan*/ mloop__free_context(struct mloop_idle *);
__attribute__((visibility("default"))) void
mloop_idle_free(struct mloop_idle *self) {
  mloop__free_context(self);
  free(self);
}


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

x86 assembly (clang, -O2):
<mloop_idle_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <mloop__free_context@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.mloop_idle = type { i32 }
define void @mloop_idle_free(%struct.mloop_idle* %0) {
%2 = alloca %struct.mloop_idle*
store %struct.mloop_idle* %0, %struct.mloop_idle** %2
%3 = load %struct.mloop_idle*, %struct.mloop_idle** %2
%4 = call i32 @mloop__free_context(%struct.mloop_idle* %3)
%5 = load %struct.mloop_idle*, %struct.mloop_idle** %2
%6 = call i32 @free(%struct.mloop_idle* %5)
ret void
}

LLVM IR (-O2):
%struct.mloop_idle = type { i32 }
define void @mloop_idle_free(%struct.mloop_idle* %0) {
%2 = tail call i32 @mloop__free_context(%struct.mloop_idle* %0)
%3 = tail call i32 @free(%struct.mloop_idle* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stampa();
int main() {
  stampa();
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fread(long *, int, int, int /*<<< orphan*/ *);
long fget_long(FILE *file) {
  long ret;
  fread(&ret, sizeof(long), 1, file);
  return ret;
}


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

x86 assembly (clang, -O2):
<fget_long>:
push   %rax
mov    %rdi,%rcx
mov    %rsp,%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @fget_long(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fread(i64* %3, i32 8, i32 1, i32* %4)
%6 = load i64, i64* %3
ret i64 %6
}

LLVM IR (-O2):
define i64 @fget_long(i32* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i32 @fread(i64* %2, i32 8, i32 1, i32* %0)
%5 = load i64, i64* %2
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char const *);
int set_string(const char **dest, const char *src) {
  free((char *)*dest);
  *dest = NULL;
  if (src != NULL)
    if ((*dest = strdup(src)) == NULL)
      return -1;
  return 0;
}


x86 assembly (clang, -O0):
<set_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     117d <set_string+0x5d>
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    -0x10(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    1178 <set_string+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <set_string+0x64>
jmp    117d <set_string+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
test   %r14,%r14
je     114e <set_string+0x2e>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1152 <set_string+0x32>
xor    %eax,%eax
jmp    1157 <set_string+0x37>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @set_string(i8** %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
%6 = load i8**, i8*** %4
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
%9 = load i8**, i8*** %4
store i8* null, i8** %9
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i8* @strdup(i8* %13)
%15 = load i8**, i8*** %4
store i8* %14, i8** %15
%16 = icmp eq i8* %14, null
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 -1, i32* %3
br label %20
18: ; preds = %12
br label %19
19: ; preds = %18, %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @set_string(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i32 @free(i8* %3)
store i8* null, i8** %0
%5 = icmp eq i8* %1, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i8* @strdup(i8* %1)
store i8* %7, i8** %0
%8 = icmp eq i8* %7, null
br i1 %8, label %10, label %9
9: ; preds = %6, %2
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ -1, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void configurePatchGenfsk(void) {
  uint8_t *pPatchTab = (uint8_t *)0x21000340;
  uint32_t *pIrqPatch = (uint32_t *)0x210003BC;
  pPatchTab[80] = 0;
  pPatchTab[53] = 1;
  pPatchTab[57] = 2;
  pPatchTab[55] = 3;
  pPatchTab[110] = 4;
  pPatchTab[107] = 5;
  pIrqPatch[1] = 0x210005dd;
}


x86 assembly (clang, -O0):
<configurePatchGenfsk>:
push   %rbp
mov    %rsp,%rbp
mov    $0x21000340,%eax
mov    %rax,-0x8(%rbp)
mov    $0x210003bc,%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x140(%rax)
mov    -0x8(%rbp),%rax
movl   $0x1,0xd4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x2,0xe4(%rax)
mov    -0x8(%rbp),%rax
movl   $0x3,0xdc(%rax)
mov    -0x8(%rbp),%rax
movl   $0x4,0x1b8(%rax)
mov    -0x8(%rbp),%rax
movl   $0x5,0x1ac(%rax)
mov    -0x10(%rbp),%rax
movl   $0x210005dd,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<configurePatchGenfsk>:
movl   $0x0,0x21000480
movl   $0x1,0x21000414
movl   $0x2,0x21000424
movl   $0x3,0x2100041c
movl   $0x4,0x210004f8
movl   $0x5,0x210004ec
movl   $0x210005dd,0x210003c0
ret

LLVM IR (-O0):
define void @configurePatchGenfsk() {
%1 = alloca i32*
%2 = alloca i32*
store i32* inttoptr (i64 553648960 to i32*), i32** %1
store i32* inttoptr (i64 553649084 to i32*), i32** %2
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 80
store i32 0, i32* %4
%5 = load i32*, i32** %1
%6 = getelementptr inbounds i32, i32* %5, i64 53
store i32 1, i32* %6
%7 = load i32*, i32** %1
%8 = getelementptr inbounds i32, i32* %7, i64 57
store i32 2, i32* %8
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 55
store i32 3, i32* %10
%11 = load i32*, i32** %1
%12 = getelementptr inbounds i32, i32* %11, i64 110
store i32 4, i32* %12
%13 = load i32*, i32** %1
%14 = getelementptr inbounds i32, i32* %13, i64 107
store i32 5, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 1
store i32 553649629, i32* %16
ret void
}

LLVM IR (-O2):
define void @configurePatchGenfsk() {
store i32 0, i32* inttoptr (i64 553649280 to i32*)
store i32 1, i32* inttoptr (i64 553649172 to i32*)
store i32 2, i32* inttoptr (i64 553649188 to i32*)
store i32 3, i32* inttoptr (i64 553649180 to i32*)
store i32 4, i32* inttoptr (i64 553649400 to i32*)
store i32 5, i32* inttoptr (i64 553649388 to i32*)
store i32 553649629, i32* inttoptr (i64 553649088 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(int *, int *, int);
int main() {
  int *dev_a = (int *)malloc(sizeof(int));
  int a = 2;
  memcpy(dev_a, &a, sizeof(int));
  assert(dev_a[0] == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x2,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %edi,%edi
cmpl   $0x1,(%rbx)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
store i32 2, i32* %3
%6 = load i32*, i32** %2
%7 = call i32 @memcpy(i32* %6, i32* %3, i32 4)
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = tail call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
%4 = bitcast i32* %1 to i8*
store i32 2, i32* %1
%5 = call i32 @memcpy(i32* %3, i32* %1, i32 4)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
scalar_t__ posix_memalign(void **, int, int);
void *sse_utils_malloc(int bytes) {
  void *p;
  if (posix_memalign(&p, 128, bytes) == 0)
    return p;
  return NULL;
}


x86 assembly (clang, -O0):
<sse_utils_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    -0x18(%rbp),%rdi
mov    $0x80,%esi
call   1030 <posix_memalign@plt>
cmp    $0x0,%rax
jne    1143 <sse_utils_malloc+0x33>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114b <sse_utils_malloc+0x3b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sse_utils_malloc>:
push   %rax
mov    %edi,%edx
mov    %rsp,%rdi
mov    $0x80,%esi
call   1030 <posix_memalign@plt>
test   %rax,%rax
jne    112b <sse_utils_malloc+0x1b>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @sse_utils_malloc(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @posix_memalign(i8** %4, i32 128, i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %4
store i8* %9, i8** %2
br label %11
10: ; preds = %1
store i8* null, i8** %2
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @sse_utils_malloc(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @posix_memalign(i8** %2, i32 128, i32 %0)
%5 = icmp eq i64 %4, 0
%6 = load i8*, i8** %2
%7 = select i1 %5, i8* %6, i8* null
ret i8* %7
}
/* Variables and functions */
int FTL_Format_Flash(int);
int GLOB_FTL_Flash_Format(void) { return FTL_Format_Flash(1); }


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

x86 assembly (clang, -O2):
<GLOB_FTL_Flash_Format>:
mov    $0x1,%edi
jmp    1030 <FTL_Format_Flash@plt>

LLVM IR (-O0):
define i32 @GLOB_FTL_Flash_Format() {
%1 = call i32 @FTL_Format_Flash(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @GLOB_FTL_Flash_Format() {
%1 = tail call i32 @FTL_Format_Flash(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ pr_mask(char *);
void sig_alrm(int signo) { pr_mask("in sig alarm: "); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"in sig alarm: \00"
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @pr_mask(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"in sig alarm: \00"
define void @sig_alrm(i32 %0) {
%2 = tail call i32 @pr_mask(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int get_div_period(void) { return 64; }


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

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

LLVM IR (-O0):
define i32 @get_div_period() {
ret i32 64
}

LLVM IR (-O2):
define i32 @get_div_period() {
ret i32 64
}
/* Variables and functions */
int /*<<< orphan*/ barrier();
void putc(int c) {
  while (((*(volatile unsigned char *)(0x3CC00000 + 0x0 + 0x10)) & 0x4) == 0)
    barrier();
  (*(volatile unsigned char *)(0x3CC00000 + 0x0 + 0x20)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x3cc00010,%eax
mov    (%rax),%al
movzbl %al,%eax
and    $0x4,%eax
cmp    $0x0,%eax
jne    113d <putc+0x2d>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    111b <putc+0xb>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0x3cc00020,%eax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
testb  $0x4,0x3cc00010
04
jne    1131 <putc+0x21>
nopl   (%rax)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x4,0x3cc00010
04
je     1120 <putc+0x10>
mov    %bl,0x3cc00020
pop    %rbx
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i8, i8* inttoptr (i64 1019215888 to i8*)
%5 = zext i8 %4 to i32
%6 = and i32 %5, 4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = call i32 (...) @barrier()
br label %3
10: ; preds = %3
%11 = load i32, i32* %2
%12 = trunc i32 %11 to i8
store volatile i8 %12, i8* inttoptr (i64 1019215904 to i8*)
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
%2 = load volatile i8, i8* inttoptr (i64 1019215888 to i8*)
%3 = and i8 %2, 4
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = tail call i32 (...) @barrier()
%7 = load volatile i8, i8* inttoptr (i64 1019215888 to i8*)
%8 = and i8 %7, 4
%9 = icmp eq i8 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %1
%11 = trunc i32 %0 to i8
store volatile i8 %11, i8* inttoptr (i64 1019215904 to i8*)
ret void
}
void copy_array(int a[], int len) {
  for (int i = 0; i < len; i++) {
    a[i] = a[i];
  }
}


x86 assembly (clang, -O0):
<copy_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1142 <copy_array+0x42>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <copy_array+0x12>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @copy_array(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
char getchar();
int snl(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<snl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1130 <snl+0x20>
jmp    1118 <snl+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snl>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <snl+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @snl() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = call signext i8 (...) @getchar()
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @snl() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 undef
}
int _bnd(int x, int y, void *garb) { return x & y; }


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

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

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

LLVM IR (-O2):
define i32 @_bnd(i32 %0, i32 %1, i8* nocapture readnone %2) {
%4 = and i32 %1, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_outl(unsigned long, int);
unsigned long pci_locate_device(int /*<<< orphan*/);
void main(void) {
  unsigned long addr;
  addr = pci_locate_device(0);
  __builtin_outl(addr, 0x12);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <pci_locate_device@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x12,%esi
call   1040 <__builtin_outl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <pci_locate_device@plt>
mov    %rax,%rdi
mov    $0x12,%esi
pop    %rax
jmp    1040 <__builtin_outl@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i64
%2 = call i64 @pci_locate_device(i32 0)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @__builtin_outl(i64 %3, i32 18)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i64 @pci_locate_device(i32 0)
%2 = tail call i32 @__builtin_outl(i64 %1, i32 18)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XIMPreeditDrawCallbackStruct;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XIMPreeditDrawCallbackStruct(void *_p) {
  if (_p == NULL)
    abort();
  free((XIMPreeditDrawCallbackStruct *)_p);
}


x86 assembly (clang, -O0):
<free_XIMPreeditDrawCallbackStruct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XIMPreeditDrawCallbackStruct+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XIMPreeditDrawCallbackStruct>:
test   %rdi,%rdi
je     112a <free_XIMPreeditDrawCallbackStruct+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

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

LLVM IR (-O2):
define void @free_XIMPreeditDrawCallbackStruct(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Type definitions */
struct rblists {
  int dummy;
};

/* Variables and functions */
void const *rb_readlist(struct rblists *);
const void *rbreadlist(struct rblists *rblistp) {
  if (rblistp == NULL) {
    return (NULL);
  }
  return (rb_readlist(rblistp));
}


x86 assembly (clang, -O0):
<rbreadlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <rbreadlist+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <rbreadlist+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <rb_readlist@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.rblists = type { i32 }
define i8* @rbreadlist(%struct.rblists* %0) {
%2 = alloca i8*
%3 = alloca %struct.rblists*
store %struct.rblists* %0, %struct.rblists** %3
%4 = load %struct.rblists*, %struct.rblists** %3
%5 = icmp eq %struct.rblists* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load %struct.rblists*, %struct.rblists** %3
%9 = call i8* @rb_readlist(%struct.rblists* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
%struct.rblists = type { i32 }
define i8* @rbreadlist(%struct.rblists* %0) {
%2 = icmp eq %struct.rblists* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @rb_readlist(%struct.rblists* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
double exp(double);
double time_to_val(double value) {
  double x = exp(2.302585093 * (5. * value - 1. * 1000) / 1000);
  return x;
}


x86 assembly (clang, -O0):
<time_to_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb2(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_val>:
mulsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
divsd  0xee8(%rip),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @time_to_val(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 5.000000e+00, double %4, double -1.000000e+03)
%6 = fmul double 0x40026BB1BBB58975, %5
%7 = fdiv double %6, 1.000000e+03
%8 = call double @exp(double %7)
store double %8, double* %3
%9 = load double, double* %3
ret double %9
}

LLVM IR (-O2):
define double @time_to_val(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 5.000000e+00, double -1.000000e+03)
%3 = fmul double %2, 0x40026BB1BBB58975
%4 = fdiv double %3, 1.000000e+03
%5 = tail call double @exp(double %4)
ret double %5
}
/* Variables and functions */
scalar_t__ j0(double);
int /*<<< orphan*/ link_failure_j0();
void test_j0(double d) {
  if (j0(d) != j0(d))
    link_failure_j0();
}


x86 assembly (clang, -O0):
<test_j0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <j0@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <j0@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_j0+0x3c>
mov    $0x0,%al
call   1030 <link_failure_j0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_j0>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1040 <j0@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1040 <j0@plt>
cmp    %rax,%rbx
jne    1149 <test_j0+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_j0@plt>

LLVM IR (-O0):
define void @test_j0(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @j0(double %3)
%5 = load double, double* %2
%6 = call i64 @j0(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_j0()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_j0(double %0) {
%2 = tail call i64 @j0(double %0)
%3 = tail call i64 @j0(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_j0()
br label %7
7: ; preds = %5, %1
ret void
}
char *bind_textdomain_codeset(domainname, codeset) const char *domainname;
const char *codeset;
{ return bind_textdomain_codeset__(domainname, codeset); }


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

x86 assembly (clang, -O2):
<bind_textdomain_codeset>:
push   %rax
xor    %eax,%eax
call   1030 <bind_textdomain_codeset__@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @bind_textdomain_codeset(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 = load i8*, i8** %4
%7 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @bind_textdomain_codeset__ to i32 (i8*, i8*, ...)*)(i8* %5, i8* %6)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @bind_textdomain_codeset(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @bind_textdomain_codeset__ to i32 (i8*, i8*, ...)*)(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Type definitions */
struct ifreq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SIOCGIFINDEX;
int /*<<< orphan*/ close(int);
scalar_t__ ioctl(int, int /*<<< orphan*/, struct ifreq *);
int get_index(int sock, struct ifreq *ifr) {
  if (ioctl(sock, SIOCGIFINDEX, ifr) < 0) {
    close(sock);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1162 <get_index+0x42>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <get_index+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1140 <get_index+0x20>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <close@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ifreq = type { i32 }
@SIOCGIFINDEX = global i32 0
define i32 @get_index(i32 %0, %struct.ifreq* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.ifreq*
store i32 %0, i32* %4
store %struct.ifreq* %1, %struct.ifreq** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @SIOCGIFINDEX
%8 = load %struct.ifreq*, %struct.ifreq** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, %struct.ifreq* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @close(i32 %12)
store i32 -1, i32* %3
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct.ifreq = type { i32 }
@SIOCGIFINDEX = global i32 0
define i32 @get_index(i32 %0, %struct.ifreq* %1) {
%3 = load i32, i32* @SIOCGIFINDEX
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.ifreq* %1)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @close(i32 %0)
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;

/* Variables and functions */
int /*<<< orphan*/ buf_int32(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void write_int32(int fd, u_int32_t n) {
  char buf[4];
  buf_int32(buf, n, 0);
  write(fd, buf, 4);
}


x86 assembly (clang, -O0):
<write_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
call   1040 <buf_int32@plt>
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int32>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
xor    %edx,%edx
call   1040 <buf_int32@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @write_int32(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = call i32 @buf_int32(i8* %4, i32 %1, i32 0)
%6 = call i32 @write(i32 %0, i8* %4, i32 4)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void c25519_prepare(uint8_t *key) {
  key[0] &= 0xf8;
  key[31] &= 0x7f;
  key[31] |= 0x40;
}


x86 assembly (clang, -O0):
<c25519_prepare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
and    $0xf8,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x7c(%rax),%ecx
and    $0x7f,%ecx
mov    %ecx,0x7c(%rax)
mov    -0x8(%rbp),%rax
mov    0x7c(%rax),%ecx
or     $0x40,%ecx
mov    %ecx,0x7c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c25519_prepare>:
andl   $0xf8,(%rdi)
mov    0x7c(%rdi),%eax
and    $0x3f,%eax
or     $0x40,%eax
mov    %eax,0x7c(%rdi)
ret

LLVM IR (-O0):
define void @c25519_prepare(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 248
store i32 %6, i32* %4
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 31
%9 = load i32, i32* %8
%10 = and i32 %9, 127
store i32 %10, i32* %8
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 31
%13 = load i32, i32* %12
%14 = or i32 %13, 64
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @c25519_prepare(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 248
store i32 %3, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 31
%5 = load i32, i32* %4
%6 = and i32 %5, 63
%7 = or i32 %6, 64
store i32 %7, i32* %4
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int factorial(int);
uint64_t super_factorial(int n) {
  uint64_t result = 1;
  int i;
  for (i = 1; i <= n; i++) {
    result *= factorial(i);
  }
  return result;
}


x86 assembly (clang, -O0):
<super_factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1152 <super_factorial+0x42>
mov    -0xc(%rbp),%edi
call   1030 <factorial@plt>
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <super_factorial+0x19>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<super_factorial>:
push   %rbp
push   %r14
push   %rbx
test   %edi,%edi
jle    114f <super_factorial+0x3f>
mov    %edi,%r14d
neg    %r14d
mov    $0x1,%ebx
mov    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <factorial@plt>
imul   %eax,%ebp
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1130 <super_factorial+0x20>
jmp    1154 <super_factorial+0x44>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @super_factorial(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 1, %1 ]
%5 = phi i32 [ %7, %3 ], [ 1, %1 ]
%6 = tail call i32 @factorial(i32 %4)
%7 = mul nsw i32 %6, %5
%8 = add nuw i32 %4, 1
%9 = icmp eq i32 %4, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void yyerror(const char *str) {
  fprintf(stderr, "> Error: %s.\n", str);
  exit(0);
}


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<yyerror>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [14 x i8] c"> Error: %s.\0A\00"
define void @yyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [14 x i8] c"> Error: %s.\0A\00"
define void @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct stat {
  int st_dev;
  int st_ino;
};
typedef scalar_t__ key_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
key_t _ftok(const char *path, int id) {
  struct stat st;
  if (stat(path, &st) < 0)
    return (key_t)-1;
  return (key_t)(((st.st_dev & 0xffff) << 16) ^ st.st_ino) + id;
}


x86 assembly (clang, -O0):
<_ftok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    1143 <_ftok+0x33>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    115e <_ftok+0x4e>
mov    -0x20(%rbp),%eax
and    $0xffff,%eax
shl    $0x10,%eax
xor    -0x1c(%rbp),%eax
cltq
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ftok>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
lea    0x8(%rsp),%rsi
call   1030 <stat@plt>
test   %rax,%rax
js     113c <_ftok+0x2c>
mov    0x8(%rsp),%eax
shl    $0x10,%eax
xor    0xc(%rsp),%eax
movslq %eax,%rcx
movslq %ebx,%rax
add    %rcx,%rax
jmp    1143 <_ftok+0x33>
mov    $0xffffffffffffffff,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define i64 @_ftok(i8* %0, i32 %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i64 @stat(i8* %0, %struct.stat* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = shl i32 %9, 16
%11 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 1
%12 = load i32, i32* %11
%13 = xor i32 %10, %12
%14 = sext i32 %13 to i64
%15 = sext i32 %1 to i64
%16 = add nsw i64 %14, %15
br label %17
17: ; preds = %2, %7
%18 = phi i64 [ %16, %7 ], [ -1, %2 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_window(int left, int top, int right, int bottom) {
  conio_init();
}


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

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

LLVM IR (-O0):
define void @caca_conio_window(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 = call i32 (...) @conio_init()
ret void
}

LLVM IR (-O2):
define void @caca_conio_window(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @conio_init()
ret void
}
float flt_max2(float a, float b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<flt_max2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <flt_max2+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <flt_max2+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @flt_max2(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void BitwiseOp(int in, char inn) {
  int m;
  int x = 0;
  scanf("%d", &x);
  int y = (in << (x << in)) * 5;
  int z = y & inn;
  if (y == 5)
    m = z | z;
  else
    m = inn;
  int mm = m;
}


x86 assembly (clang, -O0):
<BitwiseOp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xed1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%edx
mov    -0x4(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
shl    %cl,%eax
imul   $0x5,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movsbl -0x5(%rbp),%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x5,-0x14(%rbp)
jne    1171 <BitwiseOp+0x61>
mov    -0x18(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1178 <BitwiseOp+0x68>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BitwiseOp>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @BitwiseOp(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
store i32 0, i32* %6
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%11 = load i32, i32* %3
%12 = load i32, i32* %6
%13 = load i32, i32* %3
%14 = shl i32 %12, %13
%15 = shl i32 %11, %14
%16 = mul nsw i32 %15, 5
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i8, i8* %4
%19 = sext i8 %18 to i32
%20 = and i32 %17, %19
store i32 %20, i32* %8
%21 = load i32, i32* %7
%22 = icmp eq i32 %21, 5
br i1 %22, label %23, label %27
23: ; preds = %2
%24 = load i32, i32* %8
%25 = load i32, i32* %8
%26 = or i32 %24, %25
store i32 %26, i32* %5
br label %30
27: ; preds = %2
%28 = load i8, i8* %4
%29 = sext i8 %28 to i32
store i32 %29, i32* %5
br label %30
30: ; preds = %27, %23
%31 = load i32, i32* %5
store i32 %31, i32* %9
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @BitwiseOp(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_socket(void) {
  int fd;
  if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) {
    perror("create_socket: socket");
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<create_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jge    1173 <create_socket+0x43>
lea    0xe9c(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_socket>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
test   %eax,%eax
js     1150 <create_socket+0x20>
pop    %rcx
ret
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [22 x i8] c"create_socket: socket\00"
define i32 @create_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = call i32 @socket(i32 %2, i32 %3, i32 0)
store i32 %4, i32* %1
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@AF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@.str = [22 x i8] c"create_socket: socket\00"
define i32 @create_socket() {
%1 = load i32, i32* @AF_UNIX
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %0
ret i32 %3
}
int bwlzh_get_buflen(const int nvals) {
  return 132000 + nvals * 8 + 12 * ((nvals + 200000) / 200000);
}


x86 assembly (clang, -O0):
<bwlzh_get_buflen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0x203a0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30d40,%eax
mov    $0x30d40,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0xc,%ecx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwlzh_get_buflen>:
lea    0x30d40(%rdi),%eax
cltq
imul   $0x14f8b589,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x2e,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
shl    $0x2,%eax
lea    (%rax,%rdi,8),%eax
add    $0x203a0,%eax
ret

LLVM IR (-O0):
define i32 @bwlzh_get_buflen(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
%5 = add nsw i32 132000, %4
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 200000
%8 = sdiv i32 %7, 200000
%9 = mul nsw i32 12, %8
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @bwlzh_get_buflen(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = add nsw i32 %2, 132000
%4 = add nsw i32 %0, 200000
%5 = sdiv i32 %4, 200000
%6 = mul nsw i32 %5, 12
%7 = add nsw i32 %3, %6
ret i32 %7
}