xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
void get_desc(const char *ns, const char *d, char *desc) {
  sprintf(desc, "%s.%s", ns, d);
}


x86 assembly (clang, -O0):
<get_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec9(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_desc>:
mov    %rsi,%rcx
mov    %rdi,%rax
lea    0xee3(%rip),%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
jmp    1030 <sprintf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s.%s\00"
define void @get_desc(i8* %0, i8* %1, i8* nocapture writeonly %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int main(int argc, char **argv) {
  if (argc == 1)
    return -1;
  else
    return 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1128 <main+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    112f <main+0x2f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
neg    %eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
%4 = sext i1 %3 to i32
ret i32 %4
}
AR0A1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= (*((unsigned short *)11111111)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0A1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
mov    $0xa98ac7,%ecx
movzwl (%rcx),%ecx
cmp    %ecx,%eax
jg     1146 <AR0A1+0x46>
movl   $0x1,-0x4(%rbp)
jmp    114d <AR0A1+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0A1>:
movzwl 0x1312d00(%r8),%ecx
01
xor    %eax,%eax
cmp    0xa98ac7,%cx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AR0A1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = load i16, i16* inttoptr (i64 11111111 to i16*)
%10 = icmp ule i16 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
int test_imm_83int64_lowword_reg(long long val) {
  return ((val) & (0x83 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_83int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x83,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_83int64_lowword_reg>:
test   $0x83,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_83int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 131
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fabsf(float);
float sqrtf(int /*<<< orphan*/);
float dist_MinkovskyH(float x, float y, float z, float e) {
  float d = sqrtf(fabsf(x)) + sqrtf(fabsf(y)) + sqrtf(fabsf(z));
  (void)e;
  return (d * d);
}


x86 assembly (clang, -O0):
<dist_MinkovskyH>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabsf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <fabsf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist_MinkovskyH>:
sub    $0x18,%rsp
movss  %xmm2,0x14(%rsp)
movss  %xmm1,0xc(%rsp)
call   1030 <fabsf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
movss  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
call   1030 <fabsf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
addss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x14(%rsp),%xmm0
call   1030 <fabsf@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
addss  0xc(%rsp),%xmm0
mulss  %xmm0,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @dist_MinkovskyH(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%10 = load float, float* %5
%11 = call i32 @fabsf(float %10)
%12 = call float @sqrtf(i32 %11)
%13 = load float, float* %6
%14 = call i32 @fabsf(float %13)
%15 = call float @sqrtf(i32 %14)
%16 = fadd float %12, %15
%17 = load float, float* %7
%18 = call i32 @fabsf(float %17)
%19 = call float @sqrtf(i32 %18)
%20 = fadd float %16, %19
store float %20, float* %9
%21 = load float, float* %8
%22 = load float, float* %9
%23 = load float, float* %9
%24 = fmul float %22, %23
ret float %24
}

LLVM IR (-O2):
define float @dist_MinkovskyH(float %0, float %1, float %2, float %3) {
%5 = tail call i32 @fabsf(float %0)
%6 = tail call float @sqrtf(i32 %5)
%7 = tail call i32 @fabsf(float %1)
%8 = tail call float @sqrtf(i32 %7)
%9 = fadd float %6, %8
%10 = tail call i32 @fabsf(float %2)
%11 = tail call float @sqrtf(i32 %10)
%12 = fadd float %9, %11
%13 = fmul float %12, %12
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ checkTainted(char **);
int /*<<< orphan*/ checkUntainted(char **);
void test(char *def) {
  checkUntainted(&def);
  checkTainted(&def);
}


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

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <checkUntainted@plt>
mov    %rbx,%rdi
call   1040 <checkTainted@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @test(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @checkUntainted(i8** %2)
%4 = call i32 @checkTainted(i8** %2)
ret void
}
void setup(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MADV_UNMERGEABLE;
int madvise(void *, unsigned long, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void clear_mergeable(void *addr, unsigned long size) {
  if (madvise(addr, size, MADV_UNMERGEABLE) == -1) {
    perror("madvise unmergeable\n");
  }
}


x86 assembly (clang, -O0):
<clear_mergeable>:
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    0x2ea1(%rip),%rax
mov    (%rax),%edx
call   1030 <madvise@plt>
cmp    $0xffffffff,%eax
jne    115b <clear_mergeable+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_mergeable>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <madvise@plt>
cmp    $0xffffffff,%eax
je     1136 <clear_mergeable+0x16>
pop    %rax
ret
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

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

LLVM IR (-O2):
@MADV_UNMERGEABLE = global i32 0
@.str = [21 x i8] c"madvise unmergeable\0A\00"
define void @clear_mergeable(i8* %0, i64 %1) {
%3 = load i32, i32* @MADV_UNMERGEABLE
%4 = tail call i32 @madvise(i8* %0, i64 %1, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
int test_imm_E1int32_mem(int *val) {
  return ((*val) & (0xE1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E1int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 225
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_strcpy(char *, char const *);
int ft_strlen(char *);
char *ft_strcat(char *dest, const char *src) {
  ft_strcpy(dest + ft_strlen(dest), src);
  return (dest);
}


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

x86 assembly (clang, -O2):
<ft_strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1030 <ft_strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ft_strcat(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** %3
%7 = call i32 @ft_strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i32 @ft_strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ft_strcat(i8* returned %0, i8* %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @ft_strcpy(i8* %5, i8* %1)
ret i8* %0
}
void rop3_236_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & T;
  stk1 = S | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_236_1_1>:
or     %edx,%esi
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_236_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %5
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8, i8* %6
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8*, i8** %4
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = and i32 %34, %36
%38 = or i32 %31, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %6
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_236_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = and i8 %4, %5
store i8 %6, i8* %0
ret void
}
int extract_number(source)
unsigned char *source;
{
  int answer = *source & 0377;
  answer += ((*(char *)((source) + 1))) << 8;
  return answer;
}


x86 assembly (clang, -O0):
<extract_number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
shl    $0x8,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_number>:
movzbl (%rdi),%ecx
movsbl 0x1(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @extract_number(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 255
store i32 %7, i32* %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @extract_number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = shl nsw i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void sprint_mov_data_to_direct(char *str, uint8_t direct, uint8_t data) {
  sprintf(str,
          "MOV   "
          "0x%02X"
          ", #"
          "0x%02X"
          "               ",
          direct, data);
}


x86 assembly (clang, -O0):
<sprint_mov_data_to_direct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xecd(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprint_mov_data_to_direct>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"MOV 0x%02X,x%02X \00"
define void @sprint_mov_data_to_direct(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"MOV 0x%02X,x%02X \00"
define void @sprint_mov_data_to_direct(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ apic_write(int, int /*<<< orphan*/);
void eoi(void) { apic_write(0xB0, 0); }


x86 assembly (clang, -O0):
<eoi>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0,%edi
xor    %esi,%esi
call   1030 <apic_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<eoi>:
mov    $0xb0,%edi
xor    %esi,%esi
jmp    1030 <apic_write@plt>

LLVM IR (-O0):
define void @eoi() {
%1 = call i32 @apic_write(i32 176, i32 0)
ret void
}

LLVM IR (-O2):
define void @eoi() {
%1 = tail call i32 @apic_write(i32 176, i32 0)
ret void
}
void zero() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
void uninitvar_fgetc(void) {
  FILE *stream;
  (void)fgetc(stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_fgetc>:
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define void @uninitvar_fgetc() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @fgetc(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fgetc() {
%1 = tail call i32 @fgetc(i32* undef)
ret void
}
/* Variables and functions */
double __ocml_i1_f64(double);
double cyl_bessel_i1(double x) { return __ocml_i1_f64(x); }


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

x86 assembly (clang, -O2):
<cyl_bessel_i1>:
jmp    1030 <__ocml_i1_f64@plt>

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

LLVM IR (-O2):
define double @cyl_bessel_i1(double %0) {
%2 = tail call double @__ocml_i1_f64(double %0)
ret double %2
}
int is_space(unsigned char ch) {
  if (ch == ' ' || ch > 249)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     1126 <is_space+0x26>
movzbl -0x5(%rbp),%eax
cmp    $0xf9,%eax
jle    1132 <is_space+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1139 <is_space+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
mov    $0x1,%eax
lea    0x6(%rdi),%ecx
cmp    $0x6,%cl
jae    110e <is_space+0xe>
ret
cmp    $0x20,%dil
je     110d <is_space+0xd>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_space(i8 zeroext %0) {
switch i8 %0, label %2 [
i8 -1, label %3
i8 -2, label %3
i8 -3, label %3
i8 -4, label %3
i8 -5, label %3
i8 -6, label %3
i8 32, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void nio_vram_draw(void) {}


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

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

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

LLVM IR (-O2):
define void @nio_vram_draw() {
ret void
}
/* Variables and functions */
scalar_t__ strtoll(char const *, char **, int);
long int strtol(const char *nptr, char **endptr, int base) {
  return (long int)strtoll(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtoll@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i64 @strtol(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
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i64 @strtoll(i8* %7, i8** %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoll(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_LOST(int /*<<< orphan*/);
int gen_LOST() {
  handle_LOST(0);
  return 0;
}


x86 assembly (clang, -O0):
<gen_LOST>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <handle_LOST@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gen_LOST() {
%1 = call i32 @handle_LOST(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_LOST() {
%1 = tail call i32 @handle_LOST(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FreeGameButtons();
int /*<<< orphan*/ FreeLevelEditorGadgets();
int /*<<< orphan*/ FreeScreenGadgets();
int /*<<< orphan*/ FreeTapeButtons();
int /*<<< orphan*/ FreeToolButtons();
void FreeGadgets() {
  FreeLevelEditorGadgets();
  FreeGameButtons();
  FreeTapeButtons();
  FreeToolButtons();
  FreeScreenGadgets();
}


x86 assembly (clang, -O0):
<FreeGadgets>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <FreeLevelEditorGadgets@plt>
mov    $0x0,%al
call   1070 <FreeGameButtons@plt>
mov    $0x0,%al
call   1030 <FreeTapeButtons@plt>
mov    $0x0,%al
call   1040 <FreeToolButtons@plt>
mov    $0x0,%al
call   1050 <FreeScreenGadgets@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeGadgets>:
push   %rax
xor    %eax,%eax
call   1060 <FreeLevelEditorGadgets@plt>
xor    %eax,%eax
call   1070 <FreeGameButtons@plt>
xor    %eax,%eax
call   1030 <FreeTapeButtons@plt>
xor    %eax,%eax
call   1040 <FreeToolButtons@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <FreeScreenGadgets@plt>

LLVM IR (-O0):
define void @FreeGadgets() {
%1 = call i32 (...) @FreeLevelEditorGadgets()
%2 = call i32 (...) @FreeGameButtons()
%3 = call i32 (...) @FreeTapeButtons()
%4 = call i32 (...) @FreeToolButtons()
%5 = call i32 (...) @FreeScreenGadgets()
ret void
}

LLVM IR (-O2):
define void @FreeGadgets() {
%1 = tail call i32 (...) @FreeLevelEditorGadgets()
%2 = tail call i32 (...) @FreeGameButtons()
%3 = tail call i32 (...) @FreeTapeButtons()
%4 = tail call i32 (...) @FreeToolButtons()
%5 = tail call i32 (...) @FreeScreenGadgets()
ret void
}
int __ocl_hadd_int(int src1, int src2) {
  int carry = (src1 & 1) & (src2 & 1);
  return (src1 >> 1) + (src2 >> 1) + carry;
}


x86 assembly (clang, -O0):
<__ocl_hadd_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    -0x8(%rbp),%ecx
and    $0x1,%ecx
and    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ocl_hadd_int>:
mov    %edi,%eax
and    %esi,%eax
and    $0x1,%eax
sar    %edi
sar    %esi
add    %esi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @__ocl_hadd_int(i32 %0, i32 %1) {
%3 = and i32 %0, 1
%4 = and i32 %3, %1
%5 = ashr i32 %0, 1
%6 = ashr i32 %1, 1
%7 = add nsw i32 %6, %5
%8 = add nsw i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int read(int, char *, int);
void read_client(int clnt_fd, char *buff_r) {
  int err;
  do {
    err = read(clnt_fd, buff_r, 40);
    if (err < 0) {
      printf("Error in read()\n Goodbye!!\n");
      exit(-1);
    }
  } while (err <= 0);
}


x86 assembly (clang, -O0):
<read_client>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x28,%edx
call   1040 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1173 <read_client+0x43>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
jmp    1178 <read_client+0x48>
cmpl   $0x0,-0x14(%rbp)
jle    113f <read_client+0xf>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_client>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x28,%edx
call   1040 <read@plt>
test   %eax,%eax
js     115c <read_client+0x2c>
je     1140 <read_client+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error in read()\0A Goodbye!!\0A\00"
define void @read_client(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @read(i32 %7, i8* %8, i32 40)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %6
br label %16
16: ; preds = %15
%17 = load i32, i32* %5
%18 = icmp sle i32 %17, 0
br i1 %18, label %6, label %19
19: ; preds = %16
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Error in read()\0A Goodbye!!\00"
define void @read_client(i32 %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = tail call i32 @read(i32 %0, i8* %1, i32 40)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %3
%10 = icmp eq i32 %4, 0
br i1 %10, label %3, label %11
11: ; preds = %9
ret void
}
int _ipa_read_dbg_cnt_v2_0(char *buf, int max_len) { return 0; }


x86 assembly (clang, -O0):
<_ipa_read_dbg_cnt_v2_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_ipa_read_dbg_cnt_v2_0(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @_ipa_read_dbg_cnt_v2_0(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ div2();
int /*<<< orphan*/ swap();
zmod() {
  div2();
  swap();
}


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

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

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

LLVM IR (-O2):
define i32 @zmod() {
%1 = tail call i32 (...) @div2()
%2 = tail call i32 (...) @swap()
ret i32 undef
}
/* Variables and functions */
int _dl_mprotect(void *addr, size_t len, int prot) {
  (void)addr;
  (void)len;
  (void)prot;
  return -1;
}


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

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

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

LLVM IR (-O2):
define i32 @_dl_mprotect(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 -1
}
int *rec(int i) {
  int *p;
  if (!i)
    p = rec(i + 1);
  return &i;
}


x86 assembly (clang, -O0):
<rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1134 <rec+0x24>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <rec@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rec>:
lea    -0x4(%rsp),%rax
ret

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

LLVM IR (-O2):
define noalias i32* @rec(i32 %0) {
%2 = alloca i32
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ check_vect();
int /*<<< orphan*/ main1(int, int *);
int main(void) {
  int a[16] __attribute__((__aligned__(16)));
  check_vect();
  main1(16, a);
  main1(0, a);
  main1(1, a);
  main1(2, a);
  main1(16 - 1, a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <check_vect@plt>
lea    -0x50(%rbp),%rsi
mov    $0x10,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
xor    %edi,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
mov    $0x1,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
call   1040 <main1@plt>
lea    -0x50(%rbp),%rsi
mov    $0xf,%edi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
xor    %eax,%eax
call   1030 <check_vect@plt>
mov    %rsp,%rbx
mov    $0x10,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
mov    $0xf,%edi
mov    %rbx,%rsi
call   1040 <main1@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i32]
store i32 0, i32* %1
%3 = call i32 (...) @check_vect()
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%5 = call i32 @main1(i32 16, i32* %4)
%6 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%7 = call i32 @main1(i32 0, i32* %6)
%8 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%9 = call i32 @main1(i32 1, i32* %8)
%10 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%11 = call i32 @main1(i32 2, i32* %10)
%12 = getelementptr inbounds [16 x i32], [16 x i32]* %2, i64 0, i64 0
%13 = call i32 @main1(i32 15, i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = tail call i32 (...) @check_vect()
%4 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%5 = call i32 @main1(i32 16, i32* %4)
%6 = call i32 @main1(i32 0, i32* %4)
%7 = call i32 @main1(i32 1, i32* %4)
%8 = call i32 @main1(i32 2, i32* %4)
%9 = call i32 @main1(i32 15, i32* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int read_char() {
  char buffer[3] = "";
  fgets(buffer, sizeof buffer, stdin);
  return buffer[0];
}


x86 assembly (clang, -O0):
<read_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x3(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <memset@plt>
lea    -0x3(%rbp),%rdi
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1040 <fgets@plt>
movsbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_char>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x0,0x4(%rsp)
mov    0x2ec4(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1030 <fgets@plt>
movsbl 0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @read_char() {
%1 = alloca [3 x i8]
%2 = bitcast [3 x i8]* %1 to i8*
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 3, i32 %4)
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @read_char() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 3, i32 %3)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
ret i32 %6
}
float vec3_dot(float *a, float *b) {
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
}


x86 assembly (clang, -O0):
<vec3_dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3_dot>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @vec3_dot(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 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @vec3_dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
scalar_t__ RtcRead(struct tm *);
int /*<<< orphan*/ mktime(struct tm *);
time_t time(time_t *timeptr) {
  struct tm now;
  time_t t = (time_t)-1;
  if (RtcRead(&now)) {
    t = mktime(&now);
  }
  if (timeptr) {
    *timeptr = t;
  }
  return t;
}


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0x14(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <RtcRead@plt>
cmp    $0x0,%rax
je     1152 <time+0x32>
lea    -0x10(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <time+0x46>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
call   1030 <RtcRead@plt>
test   %rax,%rax
je     114e <time+0x2e>
lea    0x8(%rsp),%rdi
call   1040 <mktime@plt>
test   %rbx,%rbx
je     1148 <time+0x28>
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret
mov    $0xffffffff,%eax
test   %rbx,%rbx
jne    1146 <time+0x26>
jmp    1148 <time+0x28>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @time(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.tm
%4 = alloca i32
store i32* %0, i32** %2
store i32 -1, i32* %4
%5 = call i64 @RtcRead(%struct.tm* %3)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @mktime(%struct.tm* %3)
store i32 %8, i32* %4
br label %9
9: ; preds = %7, %1
%10 = load i32*, i32** %2
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %4
%14 = load i32*, i32** %2
store i32 %13, i32* %14
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @time(i32* writeonly %0) {
%2 = alloca %struct.tm
%3 = bitcast %struct.tm* %2 to i8*
%4 = call i64 @RtcRead(%struct.tm* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @mktime(%struct.tm* %2)
br label %8
8: ; preds = %6, %1
%9 = phi i32 [ %7, %6 ], [ -1, %1 ]
%10 = icmp eq i32* %0, null
br i1 %10, label %12, label %11
11: ; preds = %8
store i32 %9, i32* %0
br label %12
12: ; preds = %11, %8
ret i32 %9
}
void ASN1_seq_unpack(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_seq_unpack() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void scotchyyfree(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @scotchyyfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(void *, char *, int);
void swap(void *vp1, void *vp2, int size) {
  char *buffer = (char *)malloc(size * sizeof(char));
  memcpy(buffer, vp1, size);
  memcpy(vp1, vp2, size);
  memcpy(vp2, buffer, size);
  free(buffer);
}


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

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

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

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @malloc(i32 %2)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %2)
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %2)
%8 = tail call i32 @memcpy(i8* %1, i8* %5, i32 %2)
%9 = tail call i32 @free(i8* %5)
ret void
}
/* Variables and functions */
int a(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @a() {
ret i32 0
}
unsigned xrop3_181_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | D;
  stk2 = T & stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_181_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_181_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
lea    (%rcx,%rdi,1),%eax
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
or     $0xff,%ecx
and    %edx,%ecx
xor    $0xffffff00,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_181_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %5
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %7
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %5
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = xor i32 %32, -1
store i32 %33, i32* %8
%34 = load i32, i32* %8
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = load i32, i32* %6
%40 = and i32 %38, %39
%41 = or i32 %37, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @xrop3_181_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = xor i32 %9, -256
%11 = xor i32 %5, -1
%12 = and i32 %10, %11
%13 = or i32 %12, %3
ret i32 %13
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void SysCtlResetBehaviorSet(uint32_t ui32Behavior) {
  (*((volatile unsigned long *)(0x400FE1D8))) = ui32Behavior;
}


x86 assembly (clang, -O0):
<SysCtlResetBehaviorSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x400fe1d8,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlResetBehaviorSet>:
mov    %rdi,0x400fe1d8
40
ret

LLVM IR (-O0):
define void @SysCtlResetBehaviorSet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074782680 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtlResetBehaviorSet(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074782680 to i64*)
ret void
}