xunge/DecIR huggingface dataset:
unsigned long gcd(unsigned long a, unsigned long b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <gcd+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1154 <gcd+0x44>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rax
test   %rdi,%rdi
je     1135 <gcd+0x35>
mov    %rdi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %5
store i64 %9, i64* %3
br label %16
10: ; preds = %2
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = urem i64 %11, %12
%14 = load i64, i64* %4
%15 = call i64 @gcd(i64 %13, i64 %14)
store i64 %15, i64* %3
br label %16
16: ; preds = %10, %8
%17 = load i64, i64* %3
ret i64 %17
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %1, %2 ]
%6 = phi i64 [ %7, %4 ], [ %0, %2 ]
%7 = urem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %1, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void imprimir(char **a, int n) {
  int i;
  for (i = 0; i < n; i++) {
    fputs(a[i], stdout);
  }
}


x86 assembly (clang, -O0):
<imprimir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <imprimir+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <imprimir+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprimir>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <imprimir+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
mov    0x2eb5(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
mov    (%r12),%esi
call   1030 <fputs@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <imprimir+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@stdout = global i32 0
define void @imprimir(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = load i32, i32* @stdout
%11 = tail call i32 @fputs(i8* %9, i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
int test_imm_5Cuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x5C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_5Cuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 92
%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_5Cuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6029312
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int html_entities_max_entity_size() { return 6; }


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

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

LLVM IR (-O0):
define i32 @html_entities_max_entity_size() {
ret i32 6
}

LLVM IR (-O2):
define i32 @html_entities_max_entity_size() {
ret i32 6
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: xsleep prog [args ...]\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"usage: xsleep prog [args ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"usage: xsleep prog [args ...]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ hello();
int /*<<< orphan*/ printf(char *);
void main() {
  printf("Hello World!");
  hello();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <hello@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <hello@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @hello()
ret void
}
int xisinf(double x) { return x == __builtin_inf() || x == -__builtin_inf(); }


x86 assembly (clang, -O0):
<xisinf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
movsd  0xee8(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x9(%rbp)
jne    1130 <xisinf+0x30>
jp     1130 <xisinf+0x30>
jmp    114c <xisinf+0x4c>
movsd  -0x8(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisinf>:
ucomisd 0xef8(%rip),%xmm0
setae  %al
movsd  0xef5(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @xisinf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0x7FF0000000000000
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load double, double* %2
%7 = fcmp oeq double %6, 0xFFF0000000000000
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xisinf(double %0) {
%2 = fcmp oeq double %0, 0x7FF0000000000000
%3 = fcmp oeq double %0, 0xFFF0000000000000
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void rop3_241_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D | S;
  stk2 = ~stk2;
  stk1 = T | stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


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

x86 assembly (clang, -O2):
<rop3_241_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_241_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %8
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %8
%23 = zext i8 %22 to i32
%24 = or i32 %21, %23
%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* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_241_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getcopyconfigitemint(char *, char *, int, int *);
int getcopyconfigitemintpositive(char *section, char *key, int def) {
  int value;
  if (!getcopyconfigitemint(section, key, def, &value))
    return -1;
  if (value < 0)
    return -1;
  return value;
}


x86 assembly (clang, -O0):
<getcopyconfigitemintpositive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x20(%rbp),%rcx
call   1030 <getcopyconfigitemint@plt>
cmp    $0x0,%eax
jne    114c <getcopyconfigitemintpositive+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <getcopyconfigitemintpositive+0x58>
cmpl   $0x0,-0x20(%rbp)
jge    1162 <getcopyconfigitemintpositive+0x52>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <getcopyconfigitemintpositive+0x58>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcopyconfigitemintpositive>:
push   %rax
lea    0x4(%rsp),%rcx
call   1030 <getcopyconfigitemint@plt>
mov    0x4(%rsp),%ecx
test   %ecx,%ecx
mov    $0xffffffff,%edx
cmovns %ecx,%edx
cmp    $0x1,%eax
sbb    %eax,%eax
or     %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getcopyconfigitemintpositive(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @getcopyconfigitemint(i8* %0, i8* %1, i32 %2, i32* %4)
%7 = icmp eq i32 %6, 0
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, -1
%10 = select i1 %9, i32 %8, i32 -1
%11 = select i1 %7, i32 -1, i32 %10
ret i32 %11
}
/* Variables and functions */
bool chars_is_ascii7(char c) { return (c & 0x7F) == 0; }


x86 assembly (clang, -O0):
<chars_is_ascii7>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x7f,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chars_is_ascii7>:
xor    %eax,%eax
test   $0x7f,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @chars_is_ascii7(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, 127
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @chars_is_ascii7(i8 signext %0) {
%2 = and i8 %0, 127
%3 = icmp eq i8 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int strcmp(char const *, char const *);
int strcmp_wrapper(const void *s1, const void *s2) {
  return strcmp((const char *)s1, (const char *)s2);
}


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

x86 assembly (clang, -O2):
<strcmp_wrapper>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strcmp_wrapper(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int16_t XcmValueInt16Swap(int16_t val) {
  uint8_t *bytes = (uint8_t *)&val, new_val[2];
  {
    new_val[0] = bytes[1];
    new_val[1] = bytes[0];
    memcpy(&val, new_val, sizeof(val));
  }
  return val;
}


x86 assembly (clang, -O0):
<XcmValueInt16Swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rsi
lea    -0x4(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XcmValueInt16Swap>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %edi,0x14(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @XcmValueInt16Swap(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %0, i32* %6
%7 = call i32 @memcpy(i32* %2, i32* %5, i32 4)
%8 = load i32, i32* %2
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int ctpop8(uint8_t val) {
  val = (val & 0x55) + ((val >> 1) & 0x55);
  val = (val & 0x33) + ((val >> 2) & 0x33);
  val = (val & 0x0f) + ((val >> 4) & 0x0f);
  return val;
}


x86 assembly (clang, -O0):
<ctpop8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0x55,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x33,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
and    $0xf,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctpop8>:
mov    %edi,%eax
and    $0x55,%eax
shr    %edi
and    $0x55,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33,%ecx
shr    $0x2,%eax
and    $0xfffffff3,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7,%ecx
shr    $0x4,%eax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ctpop8(i32 %0) {
%2 = and i32 %0, 85
%3 = lshr i32 %0, 1
%4 = and i32 %3, 85
%5 = add nuw nsw i32 %4, %2
%6 = and i32 %5, 51
%7 = lshr i32 %5, 2
%8 = and i32 %7, 51
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 7
%11 = lshr i32 %9, 4
%12 = add nuw nsw i32 %10, %11
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int32_t strcoll(const char *s1, const char *s2) { return strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<strcoll>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @strcoll(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
void glVertexAttrib1f(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glVertexAttrib1f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *get_key(char *station, char *datatype) {
  static char key[128];
  sprintf(key, "%s|%s", station, datatype);
  return key;
}


x86 assembly (clang, -O0):
<get_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0x2f11(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2efe(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key>:
push   %rbx
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0x2f22(%rip),%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_key.key = internal global [128 x i8] zeroinitializer
@.str = [6 x i8] c"%s|%s\00"
define i8* @get_key(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_key.key, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_key.key, i64 0, i64 0)
}

LLVM IR (-O2):
@get_key.key = internal global [128 x i8] zeroinitializer
@.str = [6 x i8] c"%s|%s\00"
define i8* @get_key(i8* %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @get_key.key, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_key.key, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int mcfioC_NextEventSequential(int stream) {
  fprintf(stderr,
          "mcfioC_NextEventSequential: Not available in this library. \n");
  return -1;
}


x86 assembly (clang, -O0):
<mcfioC_NextEventSequential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfioC_NextEventSequential>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"mcfioC_NextEventSequential: Not available in this library. \0A\00"
define i32 @mcfioC_NextEventSequential(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"mcfioC_NextEventSequential: Not available in this library. \0A\00"
define i32 @mcfioC_NextEventSequential(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ close(int);
int establish_connection(char *, int);
int /*<<< orphan*/ pong(int);
void slave(char *mastername, char *sport) {
  int com_socket;
  int port;
  port = atoi(sport);
  com_socket = establish_connection(mastername, port);
  pong(com_socket);
  close(com_socket);
}


x86 assembly (clang, -O0):
<slave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <establish_connection@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <pong@plt>
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slave>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1060 <atoi@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <establish_connection@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <pong@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <close@plt>

LLVM IR (-O0):
define void @slave(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @atoi(i8* %7)
store i32 %8, i32* %6
%9 = load i8*, i8** %3
%10 = load i32, i32* %6
%11 = call i32 @establish_connection(i8* %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @pong(i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
define void @slave(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %1)
%4 = tail call i32 @establish_connection(i8* %0, i32 %3)
%5 = tail call i32 @pong(i32 %4)
%6 = tail call i32 @close(i32 %4)
ret void
}
/* Variables and functions */
bool nrf52_errata_10(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_10() {
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int mb = 0;
  while (malloc(1 << 20)) {
    mb++;
  }
  printf("you've allocated %d bytes of memory\n", mb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x100000,%edi
call   1040 <malloc@plt>
cmp    $0x0,%rax
je     1158 <main+0x38>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
mov    -0x8(%rbp),%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x100000,%edi
call   1040 <malloc@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1130 <main+0x10>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"you've allocated %d bytes of memory\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %6, %0
%4 = call i64 @malloc(i32 1048576)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"you've allocated %d bytes of memory\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i64 @malloc(i32 1048576)
%4 = icmp eq i64 %3, 0
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ENODEV;
int /*<<< orphan*/ errno;
int close(int fd) {
  (void)fd;
  errno = ENODEV;
  return -1;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENODEV = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @ENODEV
store i32 %4, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENODEV = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = load i32, i32* @ENODEV
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ radio_get_ms();
int /*<<< orphan*/ rom_write(int, int /*<<< orphan*/);
void radio_write_rom_ms(void) { rom_write(54, radio_get_ms()); }


x86 assembly (clang, -O0):
<radio_write_rom_ms>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <radio_get_ms@plt>
mov    %eax,%esi
mov    $0x36,%edi
call   1040 <rom_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<radio_write_rom_ms>:
push   %rax
xor    %eax,%eax
call   1030 <radio_get_ms@plt>
mov    $0x36,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <rom_write@plt>

LLVM IR (-O0):
define void @radio_write_rom_ms() {
%1 = call i32 (...) @radio_get_ms()
%2 = call i32 @rom_write(i32 54, i32 %1)
ret void
}

LLVM IR (-O2):
define void @radio_write_rom_ms() {
%1 = tail call i32 (...) @radio_get_ms()
%2 = tail call i32 @rom_write(i32 54, i32 %1)
ret void
}
int scheduler_quantum_expired(int core_id, int time) { return -1; }


x86 assembly (clang, -O0):
<scheduler_quantum_expired>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @scheduler_quantum_expired(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((__stdcall__)) unknown_symbol(void) {
  printf("unknown symbol in kernel32 called\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"unknown symbol in kernel32 called\00"
define void @unknown_symbol() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
int main() {
  int x$1[3];
  int y$1[0];
  int z$1[2];
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [0 x i32]
%3 = alloca [2 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
short __ocl_hadd_short(short src1, short src2) {
  short carry = (src1 & 1) & (src2 & 1);
  return (src1 >> 1) + (src2 >> 1) + carry;
}


x86 assembly (clang, -O0):
<__ocl_hadd_short>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
and    $0x1,%eax
movswl -0x4(%rbp),%ecx
and    $0x1,%ecx
and    %ecx,%eax
mov    %ax,-0x6(%rbp)
movswl -0x2(%rbp),%eax
sar    $0x1,%eax
movswl -0x4(%rbp),%ecx
sar    $0x1,%ecx
add    %ecx,%eax
movswl -0x6(%rbp),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @__ocl_hadd_short(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = and i32 %7, 1
%9 = load i16, i16* %4
%10 = sext i16 %9 to i32
%11 = and i32 %10, 1
%12 = and i32 %8, %11
%13 = trunc i32 %12 to i16
store i16 %13, i16* %5
%14 = load i16, i16* %3
%15 = sext i16 %14 to i32
%16 = ashr i32 %15, 1
%17 = load i16, i16* %4
%18 = sext i16 %17 to i32
%19 = ashr i32 %18, 1
%20 = add nsw i32 %16, %19
%21 = load i16, i16* %5
%22 = sext i16 %21 to i32
%23 = add nsw i32 %20, %22
%24 = trunc i32 %23 to i16
ret i16 %24
}

LLVM IR (-O2):
define signext i16 @__ocl_hadd_short(i16 signext %0, i16 signext %1) {
%3 = and i16 %0, 1
%4 = and i16 %3, %1
%5 = ashr i16 %0, 1
%6 = ashr i16 %1, 1
%7 = add nsw i16 %6, %5
%8 = add nsw i16 %7, %4
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ parent(int, int /*<<< orphan*/ *);
int main() {
  parent(1, NULL);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <parent@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ error(char *);
scalar_t__ tcsetattr(int, int, struct termios *);
void etcsetattr(int fd, int action, struct termios *tm) {
  if (tcsetattr(fd, action, tm) < 0)
    error("tcgetattr");
}


x86 assembly (clang, -O0):
<etcsetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <tcsetattr@plt>
cmp    $0x0,%rax
jge    1157 <etcsetattr+0x37>
lea    0xeae(%rip),%rdi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<etcsetattr>:
push   %rax
call   1040 <tcsetattr@plt>
test   %rax,%rax
js     112d <etcsetattr+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <error@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@.str = [10 x i8] c"tcgetattr\00"
define void @etcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.termios*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.termios* %2, %struct.termios** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load %struct.termios*, %struct.termios** %6
%10 = call i64 @tcsetattr(i32 %7, i32 %8, %struct.termios* %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@.str = [10 x i8] c"tcgetattr\00"
define void @etcsetattr(i32 %0, i32 %1, %struct.termios* %2) {
%4 = tail call i64 @tcsetattr(i32 %0, i32 %1, %struct.termios* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
void RTMemPoolAlloc(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemPoolAlloc() {
ret void
}
int getpadding(int offset, int alignment) {
  int rem = (alignment == 0 ? 0 : (offset % alignment));
  int pad = (rem == 0 ? 0 : (alignment - rem));
  return pad;
}


x86 assembly (clang, -O0):
<getpadding>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111e <getpadding+0x1e>
xor    %edx,%edx
mov    %edx,-0x14(%rbp)
jmp    1128 <getpadding+0x28>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1142 <getpadding+0x42>
xor    %eax,%eax
mov    %eax,-0x18(%rbp)
jmp    114b <getpadding+0x4b>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpadding>:
test   %esi,%esi
je     1112 <getpadding+0x12>
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1112 <getpadding+0x12>
sub    %edx,%esi
mov    %esi,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @getpadding(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
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = srem i32 %11, %12
br label %14
14: ; preds = %10, %9
%15 = phi i32 [ 0, %9 ], [ %13, %10 ]
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
br label %23
19: ; preds = %14
%20 = load i32, i32* %4
%21 = load i32, i32* %5
%22 = sub nsw i32 %20, %21
br label %23
23: ; preds = %19, %18
%24 = phi i32 [ 0, %18 ], [ %22, %19 ]
store i32 %24, i32* %6
%25 = load i32, i32* %6
ret i32 %25
}

LLVM IR (-O2):
define i32 @getpadding(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = srem i32 %0, %1
%6 = icmp eq i32 %5, 0
%7 = sub nsw i32 %1, %5
br i1 %6, label %8, label %9
8: ; preds = %2, %4
br label %9
9: ; preds = %4, %8
%10 = phi i32 [ 0, %8 ], [ %7, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_castps_si128(int /*<<< orphan*/);
int /*<<< orphan*/ _mm_castsi128_ps(int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm_loadh_pi(int /*<<< orphan*/, int /*<<< orphan*/ const *);
__m128i loadh_epi64(const __m128i s, const void *const src) {
  return _mm_castps_si128(
      _mm_loadh_pi(_mm_castsi128_ps(s), (const __m64 *)src));
}


x86 assembly (clang, -O0):
<loadh_epi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <_mm_castsi128_ps@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1050 <_mm_loadh_pi@plt>
mov    %eax,%edi
call   1030 <_mm_castps_si128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loadh_epi64>:
push   %rbx
mov    %rsi,%rbx
call   1040 <_mm_castsi128_ps@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1050 <_mm_loadh_pi@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <_mm_castps_si128@plt>

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

LLVM IR (-O2):
define i32 @loadh_epi64(i32 %0, i8* %1) {
%3 = tail call i32 @_mm_castsi128_ps(i32 %0)
%4 = bitcast i8* %1 to i32*
%5 = tail call i32 @_mm_loadh_pi(i32 %3, i32* %4)
%6 = tail call i32 @_mm_castps_si128(i32 %5)
ret i32 %6
}
/* Variables and functions */
float drand();
void rand_matrix_float(float *A, int M, int N) {
  int i;
  for (i = 0; i < N * M; i++) {
    A[i] = drand();
  }
}


x86 assembly (clang, -O0):
<rand_matrix_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    115d <rand_matrix_float+0x4d>
mov    $0x0,%al
call   1030 <drand@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <rand_matrix_float+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_matrix_float>:
push   %r15
push   %r14
push   %rbx
imul   %edx,%esi
test   %esi,%esi
jle    1146 <rand_matrix_float+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <drand@plt>
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <rand_matrix_float+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @rand_matrix_float(float* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul i32 %2, %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = zext i32 %4 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call float (...) @drand()
%11 = getelementptr inbounds float, float* %0, i64 %9
store float %10, float* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %3
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _list_del(struct list *, struct list *);
void list_del(struct list *head, struct list *list) { _list_del(head, list); }


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

x86 assembly (clang, -O2):
<list_del>:
jmp    1030 <_list_del@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @list_del(%struct.list* %0, %struct.list* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list*
store %struct.list* %0, %struct.list** %3
store %struct.list* %1, %struct.list** %4
%5 = load %struct.list*, %struct.list** %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @_list_del(%struct.list* %5, %struct.list* %6)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @list_del(%struct.list* %0, %struct.list* %1) {
%3 = tail call i32 @_list_del(%struct.list* %0, %struct.list* %1)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int Pieri_root_count(int m, int p, int q, int *r) {
  int fail;
  int mpq[3];
  double *c;
  mpq[0] = m;
  mpq[1] = p;
  mpq[2] = q;
  fail = _ada_use_c2phc4c(223, mpq, r, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<Pieri_root_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0xdf,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Pieri_root_count>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
mov    $0xdf,%edi
mov    %rcx,%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @Pieri_root_count(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca [3 x i32]
%11 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%19 = load i32*, i32** %8
%20 = load double*, double** %11
%21 = call i32 @_ada_use_c2phc4c(i32 223, i32* %18, i32* %19, double* %20, i32 0)
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @Pieri_root_count(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca [3 x i32]
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
store i32 %0, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
store i32 %1, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
store i32 %2, i32* %9
%10 = call i32 @_ada_use_c2phc4c(i32 223, i32* %7, i32* %3, double* undef, i32 0)
ret i32 %10
}