xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int f2(int x, int y) {
  printf("f2 received: %d %d\n", x, y);
  return x + y;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xee2(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"f2 received: %d %d\0A\00"
define i32 @f2(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 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [20 x i8] c"f2 received: %d %d\0A\00"
define i32 @f2(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add nsw i32 %1, %0
ret i32 %4
}
void foo_2_1_1_1_2_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_1_2_2_1_2_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello world \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%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 = [14 x i8] c"hello world \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello world \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hilfe(void) { printf("test\n\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"test\0A\00"
define void @hilfe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
bool is_it_prime_eratosthenes(int n, bool *primes) { return primes[n]; }


x86 assembly (clang, -O0):
<is_it_prime_eratosthenes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_it_prime_eratosthenes>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @is_it_prime_eratosthenes(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_it_prime_eratosthenes(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
void gtk_tree_selection_unselect_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_unselect_path() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HW_IPCC_Enable();
void TL_Enable(void) {
  HW_IPCC_Enable();
  return;
}


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

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

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

LLVM IR (-O2):
define void @TL_Enable() {
%1 = tail call i32 (...) @HW_IPCC_Enable()
ret void
}
void same_digits(unsigned int len, unsigned int *digits) {
  int i;
  for (i = 0; i < len; ++i) {
    digits[i] = 0;
  }
}


x86 assembly (clang, -O0):
<same_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    113b <same_digits+0x3b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <same_digits+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<same_digits>:
test   %edi,%edi
je     1129 <same_digits+0x19>
push   %rax
mov    %edi,%edx
shl    $0x2,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @same_digits(i32 %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast i32* %1 to i8*
%6 = zext i32 %0 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
void rop3_215_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S)) | (*D & S);
}


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

x86 assembly (clang, -O2):
<rop3_215_1_0>:
xor    %esi,%edx
mov    (%rdi),%al
and    %al,%dl
or     %sil,%dl
not    %dl
and    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_215_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %1
%8 = xor i8 %7, -1
%9 = and i8 %5, %1
%10 = or i8 %9, %8
store i8 %10, i8* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void be_wr(char *buf, uint32_t val) {
  buf[0] = (val >> 24) & 0xFFU;
  buf[1] = (val >> 16) & 0xFFU;
  buf[2] = (val >> 8) & 0xFFU;
  buf[3] = val & 0xFFU;
}


x86 assembly (clang, -O0):
<be_wr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_wr>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @be_wr(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char foo[] = "abcdefgh";
  printf("Before foo[] = '%s'\n\n", foo);
  foo[3] = '@';
  printf("After  foo[] = '%s'\n\n", foo);
  return EXIT_SUCCESS;
}


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)
mov    0xed3(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x19(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
movb   $0x40,-0x16(%rbp)
lea    -0x19(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x6867666564636261,%rax
66 67 68
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
lea    0xeda(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
movb   $0x40,0x3(%rsp)
lea    0xed9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.foo = [9 x i8] c"abcdefgh\00"
@.str = [22 x i8] c"Before foo[] = '%s'\0A\0A\00"
@.str.1 = [22 x i8] c"After foo[] = '%s'\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [9 x i8]* %6 to i8*
%8 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 3
store i8 64, i8* %10
%11 = getelementptr inbounds [9 x i8], [9 x i8]* %6, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@__const.main.foo = [9 x i8] c"abcdefgh\00"
@.str = [22 x i8] c"Before foo[] = '%s'\0A\0A\00"
@.str.1 = [22 x i8] c"After foo[] = '%s'\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i8]
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 3
store i8 64, i8* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
unsigned char *__ia64_mk_io_addr(unsigned long);
int /*<<< orphan*/ ia64_mfa();
unsigned int ___ia64_inb(unsigned long port) {
  volatile unsigned char *addr = __ia64_mk_io_addr(port);
  unsigned char ret;
  ret = *addr;
  ia64_mfa();
  return ret;
}


x86 assembly (clang, -O0):
<___ia64_inb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <__ia64_mk_io_addr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    $0x0,%al
call   1040 <ia64_mfa@plt>
movzbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___ia64_inb>:
push   %rbx
call   1030 <__ia64_mk_io_addr@plt>
movzbl (%rax),%ebx
xor    %eax,%eax
call   1040 <ia64_mfa@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @___ia64_inb(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i8
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = call i8* @__ia64_mk_io_addr(i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load volatile i8, i8* %7
store i8 %8, i8* %4
%9 = call i32 (...) @ia64_mfa()
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @___ia64_inb(i64 %0) {
%2 = tail call i8* @__ia64_mk_io_addr(i64 %0)
%3 = load volatile i8, i8* %2
%4 = tail call i32 (...) @ia64_mfa()
%5 = zext i8 %3 to i32
ret i32 %5
}
three1(a, b, c) { nop(); }


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

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

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

LLVM IR (-O2):
define i32 @three1(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @nop()
ret i32 undef
}
void test_four(int x, int y) {
#pragma omp target teams distribute parallel for simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int nicmp(char const *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int icmp(const char *s1, const char *s2) { return nicmp(s1, s2, strlen(s2)); }


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

x86 assembly (clang, -O2):
<icmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <nicmp@plt>

LLVM IR (-O0):
define i32 @icmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @nicmp(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @icmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @nicmp(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int);
void CX4_op72(void) { CX4_immediate_reg(30); }


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

x86 assembly (clang, -O2):
<CX4_op72>:
mov    $0x1e,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op72() {
%1 = call i32 @CX4_immediate_reg(i32 30)
ret void
}

LLVM IR (-O2):
define void @CX4_op72() {
%1 = tail call i32 @CX4_immediate_reg(i32 30)
ret void
}
int tegra_package_id(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_package_id() {
ret i32 -1
}
int getFeet(float length) { return (int)(length) / 12; }


x86 assembly (clang, -O0):
<getFeet>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFeet>:
cvttss2si %xmm0,%eax
cltq
imul   $0x2aaaaaab,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getFeet(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sdiv i32 %4, 12
ret i32 %5
}

LLVM IR (-O2):
define i32 @getFeet(float %0) {
%2 = fptosi float %0 to i32
%3 = sdiv i32 %2, 12
ret i32 %3
}
void *constructNode(const void *const data, void *userdata) {
  char *payload = strdup(data);
  return payload;
}


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

x86 assembly (clang, -O2):
<constructNode>:
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @constructNode(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i8* @strdup(i8* %0)
ret i8* %3
}
/* Variables and functions */
int strlen(char *pStr) {
  char *pEnd;
  for (pEnd = pStr; *pEnd != 0; pEnd++)
    continue;
  return pEnd - pStr;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void __attribute__((__unused__))
_hash_pthread_mtx_lock_hnode_hh(void *m,
                                void *_HU_d __attribute__((__unused__))) {
  pthread_mutex_t *mtx = (pthread_mutex_t *)m;
  pthread_mutex_lock(mtx);
}


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

x86 assembly (clang, -O2):
<_hash_pthread_mtx_lock_hnode_hh>:
jmp    1030 <pthread_mutex_lock@plt>

LLVM IR (-O0):
define void @_hash_pthread_mtx_lock_hnode_hh(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @pthread_mutex_lock(i32* %8)
ret void
}

LLVM IR (-O2):
define void @_hash_pthread_mtx_lock_hnode_hh(i8* %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @pthread_mutex_lock(i32* %3)
ret void
}
/* Variables and functions */
int binsearch(int, int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int V[] = {1, 3, 5, 6, 8, 10, 13, 16, 19};
  printf("%d\n", binsearch(5, V, 9));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rsi
mov    $0x5,%edi
mov    $0x9,%edx
call   1030 <binsearch@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x9,%edx
call   1030 <binsearch@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.V = [9 x i32] [i32 1, i32 3, i32 5, i32 6, i32 8, i32 10, i32 13, i32 16, i32 19]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @binsearch(i32 5, i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.V = [9 x i32] [i32 1, i32 3, i32 5, i32 6, i32 8, i32 10, i32 13, i32 16, i32 19]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @binsearch(i32 5, i32* %3, i32 9)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void UI_method_get_flusher(void) {}


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

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

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

LLVM IR (-O2):
define void @UI_method_get_flusher() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void __attribute__((cdecl)) irq_dvz(unsigned cs, unsigned ip) {
  printf("irq_"
         "dvz"
         "!%x:%x",
         cs, ip);
  halt();
}


x86 assembly (clang, -O0):
<irq_dvz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <halt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irq_dvz>:
push   %rax
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <halt@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"irq_dvz!%x:%x\00"
define void @irq_dvz(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 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (...) @halt()
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"irq_dvz!%x:%x\00"
define void @irq_dvz(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = tail call i32 (...) @halt()
ret void
}
/* Variables and functions */
void *list_memset(void *dest, int c, size_t len) {
  char *d = dest;
  while (len-- > 0)
    *d++ = c;
  return dest;
}


x86 assembly (clang, -O0):
<list_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x18(%rbp)
cmp    $0x0,%rax
jbe    114b <list_memset+0x4b>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1117 <list_memset+0x17>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <list_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @list_memset(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 i8*, i8** %4
store i8* %8, i8** %7
br label %9
9: ; preds = %13, %3
%10 = load i64, i64* %6
%11 = add i64 %10, -1
store i64 %11, i64* %6
%12 = icmp ugt i64 %10, 0
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = load i32, i32* %5
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %7
store i8 %15, i8* %16
br label %9
18: ; preds = %9
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @list_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
void av_picture_pad() {}


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

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

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

LLVM IR (-O2):
define void @av_picture_pad() {
ret void
}
int default_msb(unsigned long int i) {
  int r = 0;
  while (i >>= 1) {
    r++;
  }
  return r;
}


x86 assembly (clang, -O0):
<default_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1133 <default_msb+0x33>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <default_msb+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_msb>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     111f <default_msb+0x1f>
xor    %eax,%eax
mov    %rdi,%rcx
nopl   (%rax)
shr    %rcx
add    $0x1,%eax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <default_msb+0x10>
ret

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

LLVM IR (-O2):
define i32 @default_msb(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
unsigned char rotate(unsigned char b, int i) {
  unsigned char temp;
  if (i >= 8) {
    i = i % 8;
  }
  temp = b;
  b = b >> i;
  temp = temp << (8 - i);
  return b | temp;
}


x86 assembly (clang, -O0):
<rotate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jl     1125 <rotate+0x25>
mov    -0x8(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x9(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %al,-0x1(%rbp)
movzbl -0x9(%rbp),%eax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %al,-0x9(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotate>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rotate(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8
store i8 %0, i8* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 8
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = srem i32 %9, 8
store i32 %10, i32* %4
br label %11
11: ; preds = %8, %2
%12 = load i8, i8* %3
store i8 %12, i8* %5
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = load i32, i32* %4
%16 = ashr i32 %14, %15
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = load i32, i32* %4
%21 = sub nsw i32 8, %20
%22 = shl i32 %19, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %5
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
%26 = load i8, i8* %5
%27 = zext i8 %26 to i32
%28 = or i32 %25, %27
%29 = trunc i32 %28 to i8
ret i8 %29
}

LLVM IR (-O2):
define zeroext i8 @rotate(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
unsigned int ppc64_encode_local_entry(unsigned int val) {
  return (val >= 4 * 4 ? (val >= 8 * 4 ? (val >= 16 * 4 ? 6 : 5) : 4)
                       : (val >= 2 * 4 ? 3 : (val >= 1 * 4 ? 2 : 0)));
}


x86 assembly (clang, -O0):
<ppc64_encode_local_entry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jb     114e <ppc64_encode_local_entry+0x4e>
cmpl   $0x20,-0x4(%rbp)
jb     1136 <ppc64_encode_local_entry+0x36>
mov    -0x4(%rbp),%edx
mov    $0x5,%eax
mov    $0x6,%ecx
cmp    $0x40,%edx
cmovae %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <ppc64_encode_local_entry+0x43>
mov    $0x4,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <ppc64_encode_local_entry+0x43>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    117e <ppc64_encode_local_entry+0x7e>
cmpl   $0x8,-0x4(%rbp)
jb     1165 <ppc64_encode_local_entry+0x65>
mov    $0x3,%eax
mov    %eax,-0x10(%rbp)
jmp    1178 <ppc64_encode_local_entry+0x78>
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    $0x4,%edx
cmovae %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ppc64_encode_local_entry>:
cmp    $0x10,%edi
jb     111b <ppc64_encode_local_entry+0x1b>
mov    $0x4,%eax
cmp    $0x20,%edi
jb     112f <ppc64_encode_local_entry+0x2f>
cmp    $0x40,%edi
mov    $0x5,%eax
sbb    $0xffffffff,%eax
ret
mov    $0x3,%eax
cmp    $0x7,%edi
ja     112f <ppc64_encode_local_entry+0x2f>
xor    %eax,%eax
cmp    $0x4,%edi
setae  %al
add    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ppc64_encode_local_entry(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = icmp ugt i32 %0, 31
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = icmp ugt i32 %0, 63
%7 = select i1 %6, i32 6, i32 5
br label %13
8: ; preds = %1
%9 = icmp ugt i32 %0, 7
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = icmp ugt i32 %0, 3
%12 = select i1 %11, i32 2, i32 0
br label %13
13: ; preds = %10, %8, %5, %3
%14 = phi i32 [ %7, %5 ], [ 4, %3 ], [ %12, %10 ], [ 3, %8 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void usage(FILE *out) {
  fputs("Usage: huffcode [-i<input file>] [-o<output file>] [-d|-c]\n"
        "-i - input file (default is standard input)\n"
        "-o - output file (default is standard output)\n"
        "-d - decompress\n"
        "-c - compress (default)\n",
        out);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0xbd,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [190 x i8] c"Usage: huffcode [-i<input file>] [-o<output file>] [-d|-c]\0A-i - input file (default is standard input)\0A-o - output file (default is standard output)\0A-d - decompress\0A-c - compress (default)\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [190 x i8] c"Usage: huffcode [-i<input file>] [-o<output file>] [-d|-c]\0A-i - input file (default is standard input)\0A-o - output file (default is standard output)\0A-d - decompress\0A-c - compress (default)\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0), i64 189, i64 1, i32* %0)
ret void
}
/* Variables and functions */
int _cputs(char const *);
int cputs(const char *str) { return _cputs(str); }


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

x86 assembly (clang, -O2):
<cputs>:
jmp    1030 <_cputs@plt>

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

LLVM IR (-O2):
define i32 @cputs(i8* %0) {
%2 = tail call i32 @_cputs(i8* %0)
ret i32 %2
}
int test_imm_28int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x28 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_28int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 171798691840
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int floor(double);
int nint(double n) { return floor(n + 0.5); }


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

x86 assembly (clang, -O2):
<nint>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @nint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 5.000000e-01
%5 = call i32 @floor(double %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @nint(double %0) {
%2 = fadd double %0, 5.000000e-01
%3 = tail call i32 @floor(double %2)
ret i32 %3
}
double fast_fmod(double x, double y) {
  double a, b;
  b = x / y;
  return (b - (int)b) * y;
}


x86 assembly (clang, -O0):
<fast_fmod>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
cvttsd2si -0x20(%rbp),%eax
cvtsi2sd %eax,%xmm1
subsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_fmod>:
divsd  %xmm1,%xmm0
cvttpd2dq %xmm0,%xmm2
cvtdq2pd %xmm2,%xmm2
subsd  %xmm2,%xmm0
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fast_fmod(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fdiv double %7, %8
store double %9, double* %6
%10 = load double, double* %6
%11 = load double, double* %6
%12 = fptosi double %11 to i32
%13 = sitofp i32 %12 to double
%14 = fsub double %10, %13
%15 = load double, double* %4
%16 = fmul double %14, %15
ret double %16
}

LLVM IR (-O2):
define double @fast_fmod(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = fsub double %3, %5
%7 = fmul double %6, %1
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rkh_fwk_init(void) { printf("Hello lolo"); }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hello lolo\00"
define void @rkh_fwk_init() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x95() {
  Assert_real((iscntrl(149) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              750, ("iscntrl should be 0 for 0x95"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x95>:
push   %rbp
mov    %rsp,%rbp
mov    $0x95,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2ee,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x95>:
push   %rax
mov    $0x95,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2ee,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x95\00"
define void @t_iscntrl_0x95() {
%1 = call i64 @iscntrl(i32 149)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0x95\00"
define void @t_iscntrl_0x95() {
%1 = tail call i64 @iscntrl(i32 149)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 750, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
extern double s1n1n2(float s1, int n1, int n2) { return s1 + n1 + n2; }


x86 assembly (clang, -O0):
<s1n1n2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<s1n1n2>:
cvtsi2ss %edi,%xmm1
cvtsi2ss %esi,%xmm2
addss  %xmm0,%xmm1
addss  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @s1n1n2(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float, float* %4
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = fadd float %7, %9
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to float
%13 = fadd float %10, %12
%14 = fpext float %13 to double
ret double %14
}

LLVM IR (-O2):
define double @s1n1n2(float %0, i32 %1, i32 %2) {
%4 = sitofp i32 %1 to float
%5 = fadd float %4, %0
%6 = sitofp i32 %2 to float
%7 = fadd float %5, %6
%8 = fpext float %7 to double
ret double %8
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int posix_spawnp(int /*<<< orphan*/ *, char const *, int /*<<< orphan*/ const *,
                 int /*<<< orphan*/ const *, char *const *, char *const *);
int __wrap_posix_spawnp(pid_t *pid, const char *file,
                        const posix_spawn_file_actions_t *file_actions,
                        const posix_spawnattr_t *attrp, char *const argv[],
                        char *const envp[]) {
  return posix_spawnp(pid, file, file_actions, attrp, argv, envp);
}


x86 assembly (clang, -O0):
<__wrap_posix_spawnp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <posix_spawnp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_posix_spawnp>:
jmp    1030 <posix_spawnp@plt>

LLVM IR (-O0):
define i32 @__wrap_posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8**
%12 = alloca i8**
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load i32*, i32** %9
%16 = load i32*, i32** %10
%17 = load i8**, i8*** %11
%18 = load i8**, i8*** %12
%19 = call i32 @posix_spawnp(i32* %13, i8* %14, i32* %15, i32* %16, i8** %17, i8** %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @__wrap_posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = tail call i32 @posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5)
ret i32 %7
}