xunge/DecIR huggingface dataset:
int other_two(int one, int two) { return 1 >> 3 - (one ^ two) ^ 3; }


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

x86 assembly (clang, -O2):
<other_two>:
xor    %esi,%edi
mov    $0x3,%cl
sub    %dil,%cl
mov    $0x1,%eax
shr    %cl,%eax
xor    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @other_two(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = xor i32 %5, %6
%8 = sub nsw i32 3, %7
%9 = ashr i32 1, %8
%10 = xor i32 %9, 3
ret i32 %10
}

LLVM IR (-O2):
define i32 @other_two(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = sub nsw i32 3, %3
%5 = lshr i32 1, %4
%6 = xor i32 %5, 3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ refresh();
int ui_refresh() {
  refresh();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @ui_refresh() {
%1 = call i32 (...) @refresh()
ret i32 0
}

LLVM IR (-O2):
define i32 @ui_refresh() {
%1 = tail call i32 (...) @refresh()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emit_1_or_2_operandsl_vartext(char *, char *);
void special_fsubrl(void) { emit_1_or_2_operandsl_vartext("fsubr", "fsub"); }


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

x86 assembly (clang, -O2):
<special_fsubrl>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <emit_1_or_2_operandsl_vartext@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"fsubr\00"
@.str.1 = [5 x i8] c"fsub\00"
define void @special_fsubrl() {
%1 = tail call i32 @emit_1_or_2_operandsl_vartext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int find_regno(char *);
int ppc_cannot_store_register(int regno) {
  if (regno == find_regno("fpscr"))
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<ppc_cannot_store_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xed8(%rip),%rdi
call   1030 <find_regno@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jne    1146 <ppc_cannot_store_register+0x36>
movl   $0x2,-0x4(%rbp)
jmp    114d <ppc_cannot_store_register+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppc_cannot_store_register>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <find_regno@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
add    %ecx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"fpscr\00"
define i32 @ppc_cannot_store_register(i32 %0) {
%2 = tail call i32 @find_regno(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, %0
%4 = select i1 %3, i32 2, i32 0
ret i32 %4
}
void set_st_pto(unsigned long *entry, void *pto) {
  *entry &= 0x7ffUL;
  *entry |= ((unsigned long)pto & (~0x7ffUL));
  *entry |= 0x0;
}


x86 assembly (clang, -O0):
<set_st_pto>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
and    $0x7ff,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
and    $0xfffffffffffff800,%rcx
mov    -0x8(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x0,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_st_pto>:
mov    (%rdi),%rax
and    $0x7ff,%eax
and    $0xfffffffffffff800,%rsi
or     %rax,%rsi
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @set_st_pto(i64* %0, i8* %1) {
%3 = alloca i64*
%4 = alloca i8*
store i64* %0, i64** %3
store i8* %1, i8** %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = and i64 %6, 2047
store i64 %7, i64* %5
%8 = load i8*, i8** %4
%9 = ptrtoint i8* %8 to i64
%10 = and i64 %9, -2048
%11 = load i64*, i64** %3
%12 = load i64, i64* %11
%13 = or i64 %12, %10
store i64 %13, i64* %11
%14 = load i64*, i64** %3
%15 = load i64, i64* %14
%16 = or i64 %15, 0
store i64 %16, i64* %14
ret void
}

LLVM IR (-O2):
define void @set_st_pto(i64* nocapture %0, i8* %1) {
%3 = load i64, i64* %0
%4 = and i64 %3, 2047
%5 = ptrtoint i8* %1 to i64
%6 = and i64 %5, -2048
%7 = or i64 %4, %6
store i64 %7, i64* %0
ret void
}
/* Variables and functions */
char *strdup(char const *);
char *strings_dup(const char *value) {
  if (value == NULL) {
    return NULL;
  } else {
    return strdup(value);
  }
}


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

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

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

LLVM IR (-O2):
define noalias i8* @strings_dup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
unsigned halton2_inverse(unsigned index, const unsigned digits) {
  index = (index << 16) | (index >> 16);
  index = ((index & 0x00ff00ff) << 8) | ((index & 0xff00ff00) >> 8);
  index = ((index & 0x0f0f0f0f) << 4) | ((index & 0xf0f0f0f0) >> 4);
  index = ((index & 0x33333333) << 2) | ((index & 0xcccccccc) >> 2);
  index = ((index & 0x55555555) << 1) | ((index & 0xaaaaaaaa) >> 1);
  return index >> (32 - digits);
}


x86 assembly (clang, -O0):
<halton2_inverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff00,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf0f0f0f0,%ecx
shr    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
shl    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0xcccccccc,%ecx
shr    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0xaaaaaaaa,%ecx
shr    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<halton2_inverse>:
mov    %esi,%ecx
bswap  %edi
mov    %edi,%eax
and    $0xf0f0f0f,%eax
shl    $0x4,%eax
shr    $0x4,%edi
and    $0xf0f0f0f,%edi
or     %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
lea    (%rdi,%rax,4),%eax
mov    %eax,%edx
and    $0x55555555,%edx
shr    %eax
and    $0x55555555,%eax
lea    (%rax,%rdx,2),%eax
neg    %cl
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @halton2_inverse(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = shl i32 %5, 16
%7 = load i32, i32* %3
%8 = lshr i32 %7, 16
%9 = or i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = and i32 %10, 16711935
%12 = shl i32 %11, 8
%13 = load i32, i32* %3
%14 = and i32 %13, -16711936
%15 = lshr i32 %14, 8
%16 = or i32 %12, %15
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = and i32 %17, 252645135
%19 = shl i32 %18, 4
%20 = load i32, i32* %3
%21 = and i32 %20, -252645136
%22 = lshr i32 %21, 4
%23 = or i32 %19, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = and i32 %24, 858993459
%26 = shl i32 %25, 2
%27 = load i32, i32* %3
%28 = and i32 %27, -858993460
%29 = lshr i32 %28, 2
%30 = or i32 %26, %29
store i32 %30, i32* %3
%31 = load i32, i32* %3
%32 = and i32 %31, 1431655765
%33 = shl i32 %32, 1
%34 = load i32, i32* %3
%35 = and i32 %34, -1431655766
%36 = lshr i32 %35, 1
%37 = or i32 %33, %36
store i32 %37, i32* %3
%38 = load i32, i32* %3
%39 = load i32, i32* %4
%40 = sub i32 32, %39
%41 = lshr i32 %38, %40
ret i32 %41
}

LLVM IR (-O2):
define i32 @halton2_inverse(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.bitreverse.i32(i32 %0)
%4 = sub i32 32, %1
%5 = lshr i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ testLongestNonDecSeq();
void runTests() { testLongestNonDecSeq(); }


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

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

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

LLVM IR (-O2):
define void @runTests() {
%1 = tail call i32 (...) @testLongestNonDecSeq()
ret void
}
void INT_Excep_TMR0_CMIA0(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @BUF_MEM_grow() {
ret void
}
void exch(long *array, int i, int j) {
  long temp = array[i];
  array[i] = array[j];
  array[j] = temp;
}


x86 assembly (clang, -O0):
<exch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<exch>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @exch(i64* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
store i64 %9, i64* %5
store i64 %6, i64* %8
ret void
}
/* Type definitions */
struct b6_splay {
  int dummy;
};
struct b6_dref {
  int dummy;
};

/* Variables and functions */
struct b6_dref *b6_splay_head(struct b6_splay const *);
struct b6_dref *b6_splay_tail(const struct b6_splay *splay) {
  return b6_splay_head(splay);
}


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

x86 assembly (clang, -O2):
<b6_splay_tail>:
jmp    1030 <b6_splay_head@plt>

LLVM IR (-O0):
%struct.b6_dref = type { i32 }
%struct.b6_splay = type { i32 }
define %struct.b6_dref* @b6_splay_tail(%struct.b6_splay* %0) {
%2 = alloca %struct.b6_splay*
store %struct.b6_splay* %0, %struct.b6_splay** %2
%3 = load %struct.b6_splay*, %struct.b6_splay** %2
%4 = call %struct.b6_dref* @b6_splay_head(%struct.b6_splay* %3)
ret %struct.b6_dref* %4
}

LLVM IR (-O2):
%struct.b6_dref = type { i32 }
%struct.b6_splay = type { i32 }
define %struct.b6_dref* @b6_splay_tail(%struct.b6_splay* %0) {
%2 = tail call %struct.b6_dref* @b6_splay_head(%struct.b6_splay* %0)
ret %struct.b6_dref* %2
}
int eof_test_error(void *stream) {
  (void)stream;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @eof_test_error(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Sys_Printf(char *, ...);
void Cmd_Echo_f(void) {
  int i;
  for (i = 1; i < Cmd_Argc(); i++)
    Sys_Printf("%s ", Cmd_Argv(i));
  Sys_Printf("\n");
}


x86 assembly (clang, -O0):
<Cmd_Echo_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jge    117f <Cmd_Echo_f+0x4f>
mov    -0x4(%rbp),%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <Sys_Printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <Cmd_Echo_f+0xf>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <Sys_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_Echo_f>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jl     1171 <Cmd_Echo_f+0x41>
mov    $0x1,%ebx
lea    0xeb4(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%edi
call   1050 <Cmd_Argv@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <Sys_Printf@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    %eax,%ebx
jl     1150 <Cmd_Echo_f+0x20>
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Sys_Printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Cmd_Echo_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 1, %0 ]
%5 = tail call i32 @Cmd_Argv(i32 %4)
%6 = tail call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = tail call i32 (...) @Cmd_Argc()
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = tail call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned short int
unsignedshortint_ignoring_signedlonglong(unsigned short int x,
                                         signed long long y) {
  return x;
}


x86 assembly (clang, -O0):
<unsignedshortint_ignoring_signedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @unsignedshortint_ignoring_signedlonglong(i16 zeroext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @unsignedshortint_ignoring_signedlonglong(i16 returned zeroext %0, i64 %1) {
ret i16 %0
}
void RTVfsDirRetain(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
pid_t setpgid(pid_t pid, pid_t pgid) { return syscall(57, pid, pgid); }


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

x86 assembly (clang, -O2):
<setpgid>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x39,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setpgid(i32 %0, i32 %1) {
%3 = tail call i32 @syscall(i32 57, i32 %0, i32 %1)
ret i32 %3
}
void GPIOIntDisable(unsigned long ulPort, unsigned long ulIntFlags) {
  ;
  (*((volatile unsigned long *)(ulPort + 0x00000410))) &= ~(ulIntFlags);
}


x86 assembly (clang, -O0):
<GPIOIntDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x410(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x410(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOIntDisable>:
not    %rsi
and    %rsi,0x410(%rdi)
ret

LLVM IR (-O0):
define void @GPIOIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = xor i64 %5, -1
%7 = load i64, i64* %3
%8 = add i64 %7, 1040
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @GPIOIntDisable(i64 %0, i64 %1) {
%3 = xor i64 %1, -1
%4 = add i64 %0, 1040
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ irc_quote(char *);
void child_irc(char *p) { irc_quote(p); }


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

x86 assembly (clang, -O2):
<child_irc>:
jmp    1030 <irc_quote@plt>

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

LLVM IR (-O2):
define void @child_irc(i8* %0) {
%2 = tail call i32 @irc_quote(i8* %0)
ret void
}
/* Variables and functions */
void z80_exit(void) {}


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

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

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

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

/* Variables and functions */
int format_string(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int, int,
                  char const *, int /*<<< orphan*/);
int vfprintf(FILE *stream, const char *format, va_list arg) {
  return format_string(NULL, stream, 1, -1, format, arg);
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%r8
mov    -0x14(%rbp),%r9d
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
call   1030 <format_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
mov    %edx,%r9d
mov    %rsi,%r8
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x1,%edx
mov    $0xffffffff,%ecx
jmp    1030 <format_string@plt>

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

LLVM IR (-O2):
define i32 @vfprintf(i32* %0, i8* %1, i32 %2) {
%4 = tail call i32 @format_string(i32* null, i32* %0, i32 1, i32 -1, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ IdealFilter();
int main() {
  IdealFilter();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @IdealFilter()
ret i32 0
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tl880_write_regbits(struct tl880_dev *, int, int, int,
                                       int /*<<< orphan*/);
void tl880_disable_aux(struct tl880_dev *tl880dev) {
  tl880_write_regbits(tl880dev, 0x10000, 4, 4, 0);
}


x86 assembly (clang, -O0):
<tl880_disable_aux>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10000,%esi
mov    $0x4,%ecx
xor    %r8d,%r8d
mov    %ecx,%edx
call   1030 <tl880_write_regbits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_disable_aux>:
mov    $0x10000,%esi
mov    $0x4,%edx
mov    $0x4,%ecx
xor    %r8d,%r8d
jmp    1030 <tl880_write_regbits@plt>

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define void @tl880_disable_aux(%struct.tl880_dev* %0) {
%2 = alloca %struct.tl880_dev*
store %struct.tl880_dev* %0, %struct.tl880_dev** %2
%3 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%4 = call i32 @tl880_write_regbits(%struct.tl880_dev* %3, i32 65536, i32 4, i32 4, i32 0)
ret void
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define void @tl880_disable_aux(%struct.tl880_dev* %0) {
%2 = tail call i32 @tl880_write_regbits(%struct.tl880_dev* %0, i32 65536, i32 4, i32 4, i32 0)
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ errx(int, char *, int /*<<< orphan*/);
int lstat(char const *, struct stat *);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void checked_lstat(const char *path, struct stat *stat) {
  int err = lstat(path, stat);
  if (err != 0) {
    errx(1, "lstat failed: %s", strerror(errno));
  }
}


x86 assembly (clang, -O0):
<checked_lstat>:
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   1040 <lstat@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     117b <checked_lstat+0x4b>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x1,%edi
lea    0xe8a(%rip),%rsi
call   1030 <errx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checked_lstat>:
push   %rax
call   1040 <lstat@plt>
test   %eax,%eax
je     115c <checked_lstat+0x2c>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb1(%rip),%rsi
mov    $0x1,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <errx@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [17 x i8] c"lstat failed: %s\00"
@errno = global i32 0
define void @checked_lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%6 = load i8*, i8** %3
%7 = load %struct.stat*, %struct.stat** %4
%8 = call i32 @lstat(i8* %6, %struct.stat* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @errno
%13 = call i32 @strerror(i32 %12)
%14 = call i32 @errx(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [17 x i8] c"lstat failed: %s\00"
@errno = global i32 0
define void @checked_lstat(i8* nocapture %0, %struct.stat* nocapture %1) {
%3 = tail call i32 @lstat(i8* %0, %struct.stat* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int a = 10;
  switch (a) {
    printf("Hello All ");
  case 10:
    printf("10\n");
    break;
  default:
    printf("DEFAULT\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0xa,%eax
jne    114f <main+0x3f>
jmp    113e <main+0x2e>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <main+0x4b>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"10\0A\00"
@.str.1 = [9 x i8] c"DEFAULT\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%7 = load i32, i32* %6
switch i32 %7, label %10 [
i32 10, label %8
]
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"10\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned int READ_CHAR_AS_SHORT(unsigned char *ptr, unsigned int offset) {
  return (ptr[offset] + ((unsigned int)ptr[offset + 1] << 8));
}


x86 assembly (clang, -O0):
<READ_CHAR_AS_SHORT>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
mov    %edx,%edx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<READ_CHAR_AS_SHORT>:
mov    %esi,%eax
movzbl (%rdi,%rax,1),%ecx
add    $0x1,%esi
movzbl (%rdi,%rsi,1),%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @READ_CHAR_AS_SHORT(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = add i32 %12, 1
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = add i32 %10, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @READ_CHAR_AS_SHORT(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add i32 %1, 1
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %12, %6
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRB6_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRB6_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRB6_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
void gtk_spin_button_get_digits() {}


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

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

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

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

/* Variables and functions */
void sm4_reverse(uint32_t *input) {
  uint32_t tmp;
  tmp = input[0], input[0] = input[3], input[3] = tmp;
  tmp = input[1], input[1] = input[2], input[2] = tmp;
}


x86 assembly (clang, -O0):
<sm4_reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm4_reverse>:
movdqu (%rdi),%xmm0
pshufd $0x1b,%xmm0,%xmm0
movdqu %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @sm4_reverse(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = shufflevector <4 x i32> %3, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
ret void
}
/* Variables and functions */
char *ctime(long *);
int strlen(char *);
long time(long *);
char *Getdate(void) {
  int len;
  long t;
  char *p;
  t = time((long *)0);
  p = ctime(&t);
  len = strlen(p);
  *(p + len - 1) = '\0';
  return p;
}


x86 assembly (clang, -O0):
<Getdate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Getdate>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Getdate() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
%4 = call i64 @time(i64* null)
store i64 %4, i64* %2
%5 = call i8* @ctime(i64* %2)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %1
%8 = load i8*, i8** %3
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = getelementptr inbounds i8, i8* %11, i64 -1
store i8 0, i8* %12
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @Getdate() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i64 @time(i64* null)
store i64 %3, i64* %1
%4 = call i8* @ctime(i64* %1)
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
store i8 0, i8* %8
ret i8* %4
}
float calc_uspb(float bpm) { return 1000000.0 / (bpm / 60.0); }


x86 assembly (clang, -O0):
<calc_uspb>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeee(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_uspb>:
cvtss2sd %xmm0,%xmm0
divsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @calc_uspb(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 6.000000e+01
%6 = fdiv double 1.000000e+06, %5
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @calc_uspb(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 6.000000e+01
%4 = fdiv double 1.000000e+06, %3
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ refresh();
int rgetch() {
  refresh();
  return (getch());
}


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

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

LLVM IR (-O0):
define i32 @rgetch() {
%1 = call i32 (...) @refresh()
%2 = call i32 (...) @getch()
ret i32 %2
}

LLVM IR (-O2):
define i32 @rgetch() {
%1 = tail call i32 (...) @refresh()
%2 = tail call i32 (...) @getch()
ret i32 %2
}
int egsy_l2sec_version_set(unsigned int dev_id,
                           union egsy_l2sec_version_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<egsy_l2sec_version_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.egsy_l2sec_version_u = type opaque
define i32 @egsy_l2sec_version_set(i32 %0, %union.egsy_l2sec_version_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_l2sec_version_u*
store i32 %0, i32* %3
store %union.egsy_l2sec_version_u* %1, %union.egsy_l2sec_version_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_l2sec_version_u = type opaque
define i32 @egsy_l2sec_version_set(i32 %0, %union.egsy_l2sec_version_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ utest_clear();
void stest_clear(void) { utest_clear(); }


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

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

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

LLVM IR (-O2):
define void @stest_clear() {
%1 = tail call i32 (...) @utest_clear()
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *convert_array_to_bst(int *arr, int len) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @convert_array_to_bst(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret %struct.node* null
}

LLVM IR (-O2):
%struct.node = type { i32 }
define noalias %struct.node* @convert_array_to_bst(i32* nocapture readnone %0, i32 %1) {
ret %struct.node* null
}
/* Type definitions */
struct cell {
  int dummy;
};

/* Variables and functions */
struct cell *make_cons(struct cell *, struct cell *);
struct cell *extend(struct cell *env, struct cell *symbol, struct cell *value) {
  return make_cons(make_cons(symbol, value), env);
}


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

x86 assembly (clang, -O2):
<extend>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <make_cons@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <make_cons@plt>

LLVM IR (-O0):
%struct.cell = type { i32 }
define %struct.cell* @extend(%struct.cell* %0, %struct.cell* %1, %struct.cell* %2) {
%4 = alloca %struct.cell*
%5 = alloca %struct.cell*
%6 = alloca %struct.cell*
store %struct.cell* %0, %struct.cell** %4
store %struct.cell* %1, %struct.cell** %5
store %struct.cell* %2, %struct.cell** %6
%7 = load %struct.cell*, %struct.cell** %5
%8 = load %struct.cell*, %struct.cell** %6
%9 = call %struct.cell* @make_cons(%struct.cell* %7, %struct.cell* %8)
%10 = load %struct.cell*, %struct.cell** %4
%11 = call %struct.cell* @make_cons(%struct.cell* %9, %struct.cell* %10)
ret %struct.cell* %11
}

LLVM IR (-O2):
%struct.cell = type { i32 }
define %struct.cell* @extend(%struct.cell* %0, %struct.cell* %1, %struct.cell* %2) {
%4 = tail call %struct.cell* @make_cons(%struct.cell* %1, %struct.cell* %2)
%5 = tail call %struct.cell* @make_cons(%struct.cell* %4, %struct.cell* %0)
ret %struct.cell* %5
}
/* Variables and functions */
int /*<<< orphan*/ _wreeprom(int, int);
void eeprom_wrword(int addr, int val) {
  _wreeprom(addr, val & 0xff);
  _wreeprom(addr + 1, (val >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<eeprom_wrword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
call   1030 <_wreeprom@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
sar    $0x8,%esi
and    $0xff,%esi
call   1030 <_wreeprom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_wrword>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %edi,%ebx
movzbl %al,%esi
mov    %eax,%ebp
call   1030 <_wreeprom@plt>
add    $0x1,%ebx
mov    %ebp,%eax
movzbl %ah,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_wreeprom@plt>

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

LLVM IR (-O2):
define void @eeprom_wrword(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @_wreeprom(i32 %0, i32 %3)
%5 = add nsw i32 %0, 1
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = tail call i32 @_wreeprom(i32 %5, i32 %7)
ret void
}
/* Type definitions */
typedef long long uint32_t;
struct timeval {
  long long tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint32_t genericsTimestampmS(void) {
  struct timeval te;
  gettimeofday(&te, NULL);
  return (te.tv_sec * 1000LL + (te.tv_usec / 1000));
}


x86 assembly (clang, -O0):
<genericsTimestampmS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genericsTimestampmS>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i64 @genericsTimestampmS() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = sext i32 %8 to i64
%10 = add nsw i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i64 @genericsTimestampmS() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %6, %10
ret i64 %11
}
/* Variables and functions */
scalar_t__ malloc(int);
char **data_collection() {
  int n_data_1 = 150;
  char **data_collection_1 = (char **)malloc(n_data_1 * sizeof(char *));
  int n_data = 0;
  data_collection_1[n_data++] = "./data/lcp_deudeu_block.dat";
  data_collection_1[n_data++] = "---";
  return data_collection_1;
}


x86 assembly (clang, -O0):
<data_collection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x96,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
lea    0xeae(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
lea    0xead(%rip),%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_collection>:
push   %rax
mov    $0x4b0,%edi
call   1030 <malloc@plt>
lea    0xede(%rip),%rcx
mov    %rcx,(%rax)
lea    0xef0(%rip),%rcx
mov    %rcx,0x8(%rax)
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"./data/lcp_deudeu_block.dat\00"
@.str.1 = [4 x i8] c"---\00"
define i8** @data_collection() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i32
store i32 150, i32* %1
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %2
store i32 0, i32* %3
%10 = load i8**, i8*** %2
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = sext i32 %11 to i64
%14 = getelementptr inbounds i8*, i8** %10, i64 %13
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %14
%15 = load i8**, i8*** %2
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8*, i8** %15, i64 %18
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %19
%20 = load i8**, i8*** %2
ret i8** %20
}

LLVM IR (-O2):
@.str = [28 x i8] c"./data/lcp_deudeu_block.dat\00"
@.str.1 = [4 x i8] c"---\00"
define i8** @data_collection() {
%1 = tail call i64 @malloc(i32 1200)
%2 = inttoptr i64 %1 to i8**
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = getelementptr inbounds i8*, i8** %2, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
ret i8** %2
}