xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ vcall(float *, int);
void v4s(short int *vec) {
  float v[4];
  v[0] = vec[0];
  v[1] = vec[1];
  v[2] = vec[2];
  v[3] = vec[3];
  vcall(v, 4);
}


x86 assembly (clang, -O0):
<v4s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x2(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x4(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl 0x6(%rax),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1030 <vcall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4s>:
sub    $0x18,%rsp
movq   (%rdi),%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x10,%xmm0
cvtdq2ps %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <vcall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @v4s(i16* %0) {
%2 = alloca i16*
%3 = alloca [4 x float]
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = sitofp i16 %6 to float
%8 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
store float %7, float* %8
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 1
%11 = load i16, i16* %10
%12 = sitofp i16 %11 to float
%13 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 1
store float %12, float* %13
%14 = load i16*, i16** %2
%15 = getelementptr inbounds i16, i16* %14, i64 2
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 2
store float %17, float* %18
%19 = load i16*, i16** %2
%20 = getelementptr inbounds i16, i16* %19, i64 3
%21 = load i16, i16* %20
%22 = sitofp i16 %21 to float
%23 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 3
store float %22, float* %23
%24 = getelementptr inbounds [4 x float], [4 x float]* %3, i64 0, i64 0
%25 = call i32 @vcall(float* %24, i32 4)
ret void
}

LLVM IR (-O2):
define void @v4s(i16* nocapture %0) {
%2 = alloca <4 x float>
%3 = bitcast <4 x float>* %2 to i8*
%4 = getelementptr inbounds <4 x float>, <4 x float>* %2, i64 0, i64 0
%5 = bitcast i16* %0 to <4 x i16>*
%6 = load <4 x i16>, <4 x i16>* %5
%7 = sitofp <4 x i16> %6 to <4 x float>
store <4 x float> %7, <4 x float>* %2
%8 = call i32 @vcall(float* %4, i32 4)
ret void
}
int test_mult3div2(int x) { return (x * 3) / 2; }


x86 assembly (clang, -O0):
<test_mult3div2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mult3div2>:
lea    (%rdi,%rdi,2),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @test_mult3div2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 3
%5 = sdiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_mult3div2(i32 %0) {
%2 = mul nsw i32 %0, 3
%3 = sdiv i32 %2, 2
ret i32 %3
}
int is_valid_addr64(unsigned long long va) {
  if (((va) & (1ULL << 47)))
    return ((va & (~((1ULL << 48) - 1))) == (~((1ULL << 48) - 1)));
  else
    return ((va & (~((1ULL << 48) - 1))) == 0);
}


x86 assembly (clang, -O0):
<is_valid_addr64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0x800000000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
je     114b <is_valid_addr64+0x4b>
movabs $0xffff000000000000,%rax
and    -0x10(%rbp),%rax
movabs $0xffff000000000000,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <is_valid_addr64+0x68>
movabs $0xffff000000000000,%rax
and    -0x10(%rbp),%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_addr64>:
mov    %rdi,%rax
shr    $0x30,%rax
xor    %ecx,%ecx
cmp    $0xffff,%rax
setae  %cl
xor    %edx,%edx
test   %rax,%rax
sete   %dl
bt     $0x2f,%rdi
cmovae %edx,%ecx
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_addr64(i64 %0) {
%2 = alloca i32
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = and i64 %4, 140737488355328
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i64, i64* %3
%9 = and i64 %8, -281474976710656
%10 = icmp eq i64 %9, -281474976710656
%11 = zext i1 %10 to i32
store i32 %11, i32* %2
br label %17
12: ; preds = %1
%13 = load i64, i64* %3
%14 = and i64 %13, -281474976710656
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %12, %7
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_valid_addr64(i64 %0) {
%2 = and i64 %0, 140737488355328
%3 = icmp eq i64 %2, 0
%4 = icmp ugt i64 %0, -281474976710657
%5 = icmp ult i64 %0, 281474976710656
%6 = select i1 %3, i1 %5, i1 %4
%7 = zext i1 %6 to i32
ret i32 %7
}
int main(void) {
  int i = 0;
  if (i++ == 1 || i == 1) {
    printf("证明++运算符是用完后马上加，而不是等这一行执行完后再加\n");
  }
  printf("%d %d\n", i++, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x1,%eax
je     1144 <main+0x34>
cmpl   $0x1,-0x8(%rbp)
jne    1152 <main+0x42>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [82 x i8] c"\E8\AF\81\E6\98\8E++\E8\BF\90\E7\AE\97\E7\AC\A6\E6\98\AF\E7\94\A8\E5\AE\8C\E5\90\8E\E9\A9\AC\E4\B8\8A\E5\8A\A0\EF\BC\8C\E8\80\8C\E4\B8\8D\E6\98\AF\E7\AD\89\E8\BF\99\E4\B8\80\E8\A1\8C\E6\89\A7\E8\A1\8C\E5\AE\8C\E5\90\8E\E5\86\8D\E5\8A\A0\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
%5 = icmp eq i32 %3, 1
br i1 %5, label %9, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6, %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = load i32, i32* %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d %d\0A\00"
@str = [81 x i8] c"\E8\AF\81\E6\98\8E++\E8\BF\90\E7\AE\97\E7\AC\A6\E6\98\AF\E7\94\A8\E5\AE\8C\E5\90\8E\E9\A9\AC\E4\B8\8A\E5\8A\A0\EF\BC\8C\E8\80\8C\E4\B8\8D\E6\98\AF\E7\AD\89\E8\BF\99\E4\B8\80\E8\A1\8C\E6\89\A7\E8\A1\8C\E5\AE\8C\E5\90\8E\E5\86\8D\E5\8A\A0\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
scalar_t__ unice68_get_depacked_size(void const *, int /*<<< orphan*/);
int ice_is_magic(const void *buffer) {
  return unice68_get_depacked_size(buffer, 0) > 0;
}


x86 assembly (clang, -O0):
<ice_is_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <unice68_get_depacked_size@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ice_is_magic>:
push   %rax
xor    %esi,%esi
call   1030 <unice68_get_depacked_size@plt>
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ice_is_magic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @unice68_get_depacked_size(i8* %3, i32 0)
%5 = icmp sgt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ice_is_magic(i8* %0) {
%2 = tail call i64 @unice68_get_depacked_size(i8* %0, i32 0)
%3 = icmp sgt i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ m_new(int, int);
void *mls(int, int /*<<< orphan*/);
void *m_add(int m) { return mls(m, m_new(m, 1)); }


x86 assembly (clang, -O0):
<m_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <m_new@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <mls@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_add>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
call   1030 <m_new@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <mls@plt>

LLVM IR (-O0):
define i8* @m_add(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @m_new(i32 %4, i32 1)
%6 = call i8* @mls(i32 %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @m_add(i32 %0) {
%2 = tail call i32 @m_new(i32 %0, i32 1)
%3 = tail call i8* @mls(i32 %0, i32 %2)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigsegv(int sig, siginfo_t *info, void *uc_void) {
  printf("\tGot SIGSEGV\n");
}


x86 assembly (clang, -O0):
<sigsegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"\09Got SIGSEGV\0A\00"
define void @sigsegv(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 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"\09Got SIGSEGV\00"
define void @sigsegv(i32 %0, i32* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("virtual_mlv 2.0\n"
         "The virtual machine of the compilation course of the Université "
         "Paris-Est\n"
         "Marne-la-Vallée (UPEM).\n"
         "Written by Sylvain Lombardy, Nicolas Bedon, Christophe Morvan, Gaël "
         "Fuhs,\n"
         "Wuthy Hay, Quentin Campos and Jefferson Mangue.\n");
  printf("\n");
  printf("This is free software; see the source for copying conditions.  There "
         "is NO\n"
         "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
         "PURPOSE.\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0x105f(%rip),%rdi
call   1030 <printf@plt>
lea    0xfbd(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xfb1(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [240 x i8] c"virtual_mlv 2.0\0AThe virtual machine of the compilation course of the Universit\C3\A9 Paris-Est\0AMarne-la-Vall\C3\A9e (UPEM).\0AWritten by Sylvain Lombardy, Nicolas Bedon, Christophe Morvan, Ga\C3\ABl Fuhs,\0AWuthy Hay, Quentin Campos and Jefferson Mangue.\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [152 x i8] c"This is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([240 x i8], [240 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [239 x i8] c"virtual_mlv 2.0\0AThe virtual machine of the compilation course of the Universit\C3\A9 Paris-Est\0AMarne-la-Vall\C3\A9e (UPEM).\0AWritten by Sylvain Lombardy, Nicolas Bedon, Christophe Morvan, Ga\C3\ABl Fuhs,\0AWuthy Hay, Quentin Campos and Jefferson Mangue.\00"
@str.3 = [151 x i8] c"This is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([239 x i8], [239 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([151 x i8], [151 x i8]* @str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Cyc_List_List {
  int dummy;
};
struct Cyc_Hashtable_Table {
  int dummy;
};

/* Variables and functions */
struct Cyc_List_List *Cyc_Toc_toc(struct Cyc_Hashtable_Table *,
                                  struct Cyc_List_List *);
struct Cyc_List_List *Cyc_do_translate(struct Cyc_Hashtable_Table *pops,
                                       struct Cyc_List_List *tds) {
  struct Cyc_List_List *_T0;
  _T0 = Cyc_Toc_toc(pops, tds);
  return _T0;
}


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

x86 assembly (clang, -O2):
<Cyc_do_translate>:
jmp    1030 <Cyc_Toc_toc@plt>

LLVM IR (-O0):
%struct.Cyc_Hashtable_Table = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_translate(%struct.Cyc_Hashtable_Table* %0, %struct.Cyc_List_List* %1) {
%3 = alloca %struct.Cyc_Hashtable_Table*
%4 = alloca %struct.Cyc_List_List*
%5 = alloca %struct.Cyc_List_List*
store %struct.Cyc_Hashtable_Table* %0, %struct.Cyc_Hashtable_Table** %3
store %struct.Cyc_List_List* %1, %struct.Cyc_List_List** %4
%6 = load %struct.Cyc_Hashtable_Table*, %struct.Cyc_Hashtable_Table** %3
%7 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %4
%8 = call %struct.Cyc_List_List* @Cyc_Toc_toc(%struct.Cyc_Hashtable_Table* %6, %struct.Cyc_List_List* %7)
store %struct.Cyc_List_List* %8, %struct.Cyc_List_List** %5
%9 = load %struct.Cyc_List_List*, %struct.Cyc_List_List** %5
ret %struct.Cyc_List_List* %9
}

LLVM IR (-O2):
%struct.Cyc_Hashtable_Table = type { i32 }
%struct.Cyc_List_List = type { i32 }
define %struct.Cyc_List_List* @Cyc_do_translate(%struct.Cyc_Hashtable_Table* %0, %struct.Cyc_List_List* %1) {
%3 = tail call %struct.Cyc_List_List* @Cyc_Toc_toc(%struct.Cyc_Hashtable_Table* %0, %struct.Cyc_List_List* %1)
ret %struct.Cyc_List_List* %3
}
int main(void) {
  int x = 0;
  x + (x = 1);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
store i32 1, i32* %2
%4 = add nsw i32 %3, 1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M223_f(char *s) {
  debug("M223_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M223_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M223_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M223_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M223_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M223_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M223_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
reg0regx1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ r0 = (p1[x1]); }


x86 assembly (clang, -O0):
<reg0regx1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @reg0regx1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float*, float** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds float, float* %16, i64 %18
%20 = load float, float* %19
store float %20, float* %8
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @reg0regx1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void a() { printf("a.c\n"); }


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"a.c\0A\00"
define void @a() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"a.c\00"
define void @a() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
size_t strftime(char *strDest, size_t maxsize, const char *format,
                const struct tm *timeptr) {
  return 0;
}


x86 assembly (clang, -O0):
<strftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @strftime(i8* %0, i64 %1, i8* %2, %struct.tm* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca %struct.tm*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store %struct.tm* %3, %struct.tm** %8
ret i64 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @strftime(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, %struct.tm* nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int atoi(char const *);
char *get_str(char *, int);
int get_int(char *line, int column_number) {
  if (column_number >= 0) {
    const char *s = get_str(line, column_number);
    return s ? atoi(s) : 0;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     117a <get_int+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <get_str@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1165 <get_int+0x45>
mov    -0x20(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x24(%rbp)
jmp    116f <get_int+0x4f>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    116f <get_int+0x4f>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <get_int+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int>:
test   %esi,%esi
js     113c <get_int+0x1c>
push   %rax
call   1030 <get_str@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     113c <get_int+0x1c>
mov    %rax,%rdi
jmp    1040 <atoi@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_int(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i8* @get_str(i8* %0, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @atoi(i8* %5)
br label %9
9: ; preds = %2, %7, %4
%10 = phi i32 [ %8, %7 ], [ 0, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
char const *out_get_errormsg();
const char *pmemobj_errormsg(void) { return out_get_errormsg(); }


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

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

LLVM IR (-O0):
define i8* @pmemobj_errormsg() {
%1 = call i8* (...) @out_get_errormsg()
ret i8* %1
}

LLVM IR (-O2):
define i8* @pmemobj_errormsg() {
%1 = tail call i8* (...) @out_get_errormsg()
ret i8* %1
}
/* Variables and functions */
int SomeUndefinedFunction(int, int, int);
int RealFunc(void) { return SomeUndefinedFunction(1, 4, 5); }


x86 assembly (clang, -O0):
<RealFunc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x5,%edx
call   1030 <SomeUndefinedFunction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<RealFunc>:
mov    $0x1,%edi
mov    $0x4,%esi
mov    $0x5,%edx
jmp    1030 <SomeUndefinedFunction@plt>

LLVM IR (-O0):
define i32 @RealFunc() {
%1 = call i32 @SomeUndefinedFunction(i32 1, i32 4, i32 5)
ret i32 %1
}

LLVM IR (-O2):
define i32 @RealFunc() {
%1 = tail call i32 @SomeUndefinedFunction(i32 1, i32 4, i32 5)
ret i32 %1
}
void ff_hevc_put_hevc_uni_epel_hv64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_hv64_8_sse4() {
ret void
}
/* Variables and functions */
int maybe_flip_bytes(void *p, size_t n) { return 0; }


x86 assembly (clang, -O0):
<maybe_flip_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @maybe_flip_bytes(i8* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]\n   or: %s NUMBER[SUFFIX]\n\n    Pause for NUMBER "
         "seconds. SUFFIX may be 's' for seconds (the default),\n    'm' for "
         "minutes, 'h' for hours or 'd' for days.\n\nOptions:\n    -h, "
         "--help\t\tdisplay this help\n    -V, --version\tdisplay version "
         "information\n\nReport bugs to <bulliver@gmail.com>\n",
         "sleep", "sleep");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0x100a(%rip),%rdx
mov    %rdx,%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0x100e(%rip),%rdx
mov    %rdx,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [300 x i8] c"Usage: %s [OPTION]\0A or: %s NUMBER[SUFFIX]\0A\0A Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the default),\0A 'm' for minutes, 'h' for hours or 'd' for days.\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [6 x i8] c"sleep\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [300 x i8] c"Usage: %s [OPTION]\0A or: %s NUMBER[SUFFIX]\0A\0A Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the default),\0A 'm' for minutes, 'h' for hours or 'd' for days.\0A\0AOptions:\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0AReport bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [6 x i8] c"sleep\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long I2SRxFIFOLimitGet(unsigned long ulBase) {
  ;
  return ((*((volatile unsigned long *)(ulBase + 0x0000080C))) & 0xFFFE);
}


x86 assembly (clang, -O0):
<I2SRxFIFOLimitGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x80c(%rax),%rax
and    $0xfffe,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxFIFOLimitGet>:
mov    0x80c(%rdi),%rax
and    $0xfffe,%eax
ret

LLVM IR (-O0):
define i64 @I2SRxFIFOLimitGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2060
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 65534
ret i64 %7
}

LLVM IR (-O2):
define i64 @I2SRxFIFOLimitGet(i64 %0) {
%2 = add i64 %0, 2060
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, 65534
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
void input(int array[], int length) {
  int i = 0;
  for (i = 0; i < length; i++) {
    scanf("%d", &array[i]);
  }
  return;
}


x86 assembly (clang, -O0):
<input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1162 <input+0x52>
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb1(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <input+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1145 <input+0x35>
mov    %rdi,%rbx
mov    %esi,%r15d
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
add    $0x4,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <input+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @input(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
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
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 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @input(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %8)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
DIR *opendir(const char *name) {
  fprintf(stderr, "\nAccess to dangerous function %s() denied.\n", "opendir");
  assert(0);
  ;
}


x86 assembly (clang, -O0):
<opendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
lea    0xee9(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opendir>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
lea    0xef4(%rip),%rdx
call   1040 <fprintf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [8 x i8] c"opendir\00"
define i32* @opendir(i8* %0) {
%2 = alloca i32*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @assert(i32 0)
%7 = load i32*, i32** %2
ret i32* %7
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"\0AAccess to dangerous function %s() denied.\0A\00"
@.str.1 = [8 x i8] c"opendir\00"
define noalias i32* @opendir(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @assert(i32 0)
ret i32* undef
}
void str_cpy(char *to, const char *from) {
  int c;
  do {
    c = *from++;
    if (c >= ' ')
      *to++ = c;
  } while (c >= ' ');
  *to = '\0';
}


x86 assembly (clang, -O0):
<str_cpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jl     1141 <str_cpy+0x41>
mov    -0x14(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1146 <str_cpy+0x46>
cmpl   $0x20,-0x14(%rbp)
jge    110c <str_cpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_cpy>:
mov    (%rsi),%al
cmp    $0x20,%al
jl     1121 <str_cpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
cmp    $0x1f,%al
jg     1110 <str_cpy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @str_cpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp sgt i8 %3, 31
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp sgt i8 %11, 31
br i1 %12, label %5, label %13
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_alloc(void *, size_t, char *, int);
void *malloc(size_t);
void *x_malloc(char *file, int lineno, size_t bytes) {
  void *t;
  t = malloc(bytes);
  add_alloc(t, bytes, file, lineno);
  return t;
}


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

x86 assembly (clang, -O2):
<x_malloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <malloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1040 <add_alloc@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @x_malloc(i8* %0, i32 %1, i64 %2) {
%4 = tail call i8* @malloc(i64 %2)
%5 = tail call i32 @add_alloc(i8* %4, i64 %2, i8* %0, i32 %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printBase(int, int);
void printHex(int value) { printBase(value, 16); }


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

x86 assembly (clang, -O2):
<printHex>:
mov    $0x10,%esi
jmp    1030 <printBase@plt>

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

LLVM IR (-O2):
define void @printHex(i32 %0) {
%2 = tail call i32 @printBase(i32 %0, i32 16)
ret void
}
/* Variables and functions */
short rand();
short internal_rand_s(short value) { return rand(); }


x86 assembly (clang, -O0):
<internal_rand_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @internal_rand_s(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = call signext i16 (...) @rand()
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @internal_rand_s(i16 signext %0) {
%2 = tail call signext i16 (...) @rand()
ret i16 %2
}
int setOver(char *STAT, int bit) {
  if (bit == 1)
    *STAT = *STAT | 4;
  else
    *STAT = *STAT & (255 - 4);
}


x86 assembly (clang, -O0):
<setOver>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    112c <setOver+0x2c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
or     $0x4,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1140 <setOver+0x40>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
and    $0xfb,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setOver>:
cmp    $0x1,%esi
sete   %al
mov    (%rdi),%cl
and    $0xfb,%cl
shl    $0x2,%al
or     %cl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @setOver(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = load i8, i8* %0
%5 = and i8 %4, -5
%6 = select i1 %3, i8 4, i8 0
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret i32 undef
}
/* Variables and functions */
int fz_hardlight_byte(int, int);
int fz_overlay_byte(int bd, int s) { return fz_hardlight_byte(s, bd); }


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

x86 assembly (clang, -O2):
<fz_overlay_byte>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <fz_hardlight_byte@plt>

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

LLVM IR (-O2):
define i32 @fz_overlay_byte(i32 %0, i32 %1) {
%3 = tail call i32 @fz_hardlight_byte(i32 %1, i32 %0)
ret i32 %3
}
void test_invalid_clause() {
  int i;
#pragma omp target teams distribute parallel for simd foo bar
  for (i = 0; i < 16; ++i)
    ;
}


x86 assembly (clang, -O0):
<test_invalid_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_invalid_clause+0x28>
jmp    111a <test_invalid_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_invalid_clause+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_invalid_clause() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
int is_empty(const char *string) {
  while (*string != '\0') {
    if (!isspace(*string)) {
      return 0;
    }
    string++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115e <is_empty+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114d <is_empty+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <is_empty+0x55>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_empty+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_empty+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <is_empty+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_empty+0x20>
jmp    114b <is_empty+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_empty(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %15, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = call i32 @isspace(i8 signext %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %9
store i32 0, i32* %2
br label %19
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %4
18: ; preds = %4
store i32 1, i32* %2
br label %19
19: ; preds = %18, %14
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ major_code;
};
typedef TYPE_1__ XNoExposeEvent;

/* Variables and functions */
int get_XNoExposeEvent_major_code(void *_p) {
  return (int)((XNoExposeEvent *)_p)->major_code;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XNoExposeEvent_major_code(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XNoExposeEvent_major_code(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(char *, char *);
int WpeReservedWordCompare(const void *x, const void *y) {
  return (strcmp(*((char **)x), *((char **)y)));
}


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

x86 assembly (clang, -O2):
<WpeReservedWordCompare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @WpeReservedWordCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
void Arch_End(void) {}


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

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

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

LLVM IR (-O2):
define void @Arch_End() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printline(char *c, int len) {
  for (; len > 1; len--)
    printf("%s", c);
  printf("\n");
}


x86 assembly (clang, -O0):
<printline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1149 <printline+0x39>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <printline+0xf>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printline>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1155 <printline+0x35>
mov    %esi,%ebx
mov    %rdi,%r14
add    $0x1,%ebx
lea    0xec7(%rip),%r15
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
ja     1140 <printline+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printline(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %11, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printline(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = add nsw i32 %5, -1
%8 = icmp ugt i32 %5, 2
br i1 %8, label %4, label %9
9: ; preds = %4, %2
%10 = tail call i32 @putchar(i32 10)
ret void
}
void RotatePlane270() {}


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

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

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

LLVM IR (-O2):
define void @RotatePlane270() {
ret void
}