xunge/DecIR huggingface dataset:
int map_y_to_class(int focus, int x) { return ((focus * 2) + ((x + 1) / 2)); }


x86 assembly (clang, -O0):
<map_y_to_class>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @map_y_to_class(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 = mul nsw i32 %5, 2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 2
%10 = add nsw i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @map_y_to_class(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %1, 1
%5 = sdiv i32 %4, 2
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
char *BN_bn2hex(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void BN_dump(BIGNUM *bn) { printf("%s\n", BN_bn2hex(bn)); }


x86 assembly (clang, -O0):
<BN_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <BN_bn2hex@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BN_dump>:
push   %rax
call   1040 <BN_bn2hex@plt>
lea    0xed3(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @BN_dump(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i8* @BN_bn2hex(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @BN_dump(i32* %0) {
%2 = tail call i8* @BN_bn2hex(i32* %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int strlen(char const *);
int is_wildcarded(const char *str) {
  int i, len = strlen(str);
  for (i = 0; i < len; i++)
    if (str[i] == '*')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_wildcarded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    116f <is_wildcarded+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2a,%eax
jne    115c <is_wildcarded+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1176 <is_wildcarded+0x66>
jmp    1161 <is_wildcarded+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <is_wildcarded+0x1f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_wildcarded>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    113f <is_wildcarded+0x2f>
mov    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpb   $0x2a,(%rbx,%rcx,1)
je     1143 <is_wildcarded+0x33>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1130 <is_wildcarded+0x20>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_wildcarded(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
store i32 0, i32* %4
br label %8
8: ; preds = %22, %1
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 42
br i1 %19, label %20, label %21
20: ; preds = %12
store i32 1, i32* %2
br label %26
21: ; preds = %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %8
25: ; preds = %8
store i32 0, i32* %2
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @is_wildcarded(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %8
6: ; preds = %8
%7 = icmp eq i64 %13, %5
br i1 %7, label %14, label %8
8: ; preds = %4, %6
%9 = phi i64 [ 0, %4 ], [ %13, %6 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 42
%13 = add nuw nsw i64 %9, 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %1
%15 = phi i32 [ 0, %1 ], [ 0, %6 ], [ 1, %8 ]
ret i32 %15
}
unsigned int __bswap_32(unsigned int __bsx) {
  return ((((__bsx) & -16777216) >> 24) | (((__bsx)&16711680) >> 8) |
          (((__bsx)&65280) << 8) | (((__bsx)&255) << 24));
}


x86 assembly (clang, -O0):
<__bswap_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__bswap_32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = lshr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @__bswap_32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void fileout_diff() {}


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

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

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

LLVM IR (-O2):
define void @fileout_diff() {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t n = 0;
  while (s[n] != '\0') {
    n++;
  }
  return n;
}


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

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

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_move_current_standard_to_next(int *cursor) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(454, cursor, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_move_current_standard_to_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1c6,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_move_current_standard_to_next>:
mov    %rdi,%rsi
mov    $0x1c6,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_move_current_standard_to_next(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = load double*, double** %5
%9 = call i32 @_ada_use_c2phc(i32 454, i32* %6, i32* %7, double* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @solcon_move_current_standard_to_next(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 454, i32* %0, i32* undef, double* undef)
ret i32 %2
}
void XkbGetKeyTypes() {}


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

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

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

LLVM IR (-O2):
define void @XkbGetKeyTypes() {
ret void
}
const char *getSpec(void) { return "typ_spec { name=typ_PositionType; }"; }


x86 assembly (clang, -O0):
<getSpec>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSpec>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [36 x i8] c"typ_spec { name=typ_PositionType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [36 x i8] c"typ_spec { name=typ_PositionType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_extracti128_si256(int /*<<< orphan*/, int);
int sum_m128i_int(int /*<<< orphan*/);
int sum_m256i_int(__m256i vec) {
  return sum_m128i_int(_mm256_extracti128_si256(vec, 0)) +
         sum_m128i_int(_mm256_extracti128_si256(vec, 1));
}


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

x86 assembly (clang, -O2):
<sum_m256i_int>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %esi,%esi
call   1030 <_mm256_extracti128_si256@plt>
mov    %eax,%edi
call   1040 <sum_m128i_int@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x1,%esi
call   1030 <_mm256_extracti128_si256@plt>
mov    %eax,%edi
call   1040 <sum_m128i_int@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sum_m256i_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_mm256_extracti128_si256(i32 %3, i32 0)
%5 = call i32 @sum_m128i_int(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @_mm256_extracti128_si256(i32 %6, i32 1)
%8 = call i32 @sum_m128i_int(i32 %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @sum_m256i_int(i32 %0) {
%2 = tail call i32 @_mm256_extracti128_si256(i32 %0, i32 0)
%3 = tail call i32 @sum_m128i_int(i32 %2)
%4 = tail call i32 @_mm256_extracti128_si256(i32 %0, i32 1)
%5 = tail call i32 @sum_m128i_int(i32 %4)
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int dup2(int, int);
int xdup2(int oldfd, int newfd) {
  int ret = dup2(oldfd, newfd);
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xdup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <dup2@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    113b <xdup2+0x2b>
jmp    113b <xdup2+0x2b>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdup2>:
jmp    1030 <dup2@plt>

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

LLVM IR (-O2):
define i32 @xdup2(i32 %0, i32 %1) {
%3 = tail call i32 @dup2(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ initialise_transport_c();
void initialise_transport() { initialise_transport_c(); }


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

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

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

LLVM IR (-O2):
define void @initialise_transport() {
%1 = tail call i32 (...) @initialise_transport_c()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_printlast(char *);
int /*<<< orphan*/ ft_putchar(char);
int main(int ac, char **av) {
  if (ac == 2) {
    ft_printlast(av[1]);
  }
  ft_putchar('\n');
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    114d <main+0x2d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <ft_printlast@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    112f <main+0xf>
mov    0x8(%rsi),%rdi
call   1040 <ft_printlast@plt>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @ft_printlast(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = tail call i32 @ft_putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memcpy_impl(void *dest, const void *src, size_t n) {
  memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memcpy_impl>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define weak void @__aeabi_memcpy_impl(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void write_err(void) {
  fputs("\nError: error during the writing of the output file, probably you "
        "have finished your disk space\n\n",
        stdout);
  exit(1);
}


x86 assembly (clang, -O0):
<write_err>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<write_err>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [98 x i8] c"\0AError: error during the writing of the output file, probably you have finished your disk space\0A\0A\00"
@stdout = global i32 0
define void @write_err() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [98 x i8] c"\0AError: error during the writing of the output file, probably you have finished your disk space\0A\0A\00"
@stdout = global i32 0
define void @write_err() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t ZBUFFv06_recommendedDOutSize(void) { return (128 * 1024); }


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

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

LLVM IR (-O0):
define i64 @ZBUFFv06_recommendedDOutSize() {
ret i64 131072
}

LLVM IR (-O2):
define i64 @ZBUFFv06_recommendedDOutSize() {
ret i64 131072
}
/* Variables and functions */
int /*<<< orphan*/ glColor3f(double, double, double);
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glScalef(double, double, double);
int /*<<< orphan*/ glutSolidIcosahedron();
void drawSIcos(void) {
  glColor3f(0.8, 0.5, 0.5);
  glPushMatrix();
  glScalef(6.0, 6.0, 6.0);
  glutSolidIcosahedron();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawSIcos>:
push   %rbp
mov    %rsp,%rbp
movsd  0xeac(%rip),%xmm0
movsd  0xeac(%rip),%xmm2
movaps %xmm2,%xmm1
call   1040 <glColor3f@plt>
mov    $0x0,%al
call   1060 <glPushMatrix@plt>
movsd  0xe85(%rip),%xmm2
movaps %xmm2,%xmm0
movaps %xmm2,%xmm1
call   1050 <glScalef@plt>
mov    $0x0,%al
call   1070 <glutSolidIcosahedron@plt>
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawSIcos>:
push   %rax
movsd  0xea7(%rip),%xmm0
movsd  0xea7(%rip),%xmm1
movaps %xmm1,%xmm2
call   1040 <glColor3f@plt>
xor    %eax,%eax
call   1060 <glPushMatrix@plt>
movsd  0xe98(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1050 <glScalef@plt>
xor    %eax,%eax
call   1070 <glutSolidIcosahedron@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawSIcos() {
%1 = call i32 @glColor3f(double 8.000000e-01, double 5.000000e-01, double 5.000000e-01)
%2 = call i32 (...) @glPushMatrix()
%3 = call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = call i32 (...) @glutSolidIcosahedron()
%5 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawSIcos() {
%1 = tail call i32 @glColor3f(double 8.000000e-01, double 5.000000e-01, double 5.000000e-01)
%2 = tail call i32 (...) @glPushMatrix()
%3 = tail call i32 @glScalef(double 6.000000e+00, double 6.000000e+00, double 6.000000e+00)
%4 = tail call i32 (...) @glutSolidIcosahedron()
%5 = tail call i32 (...) @glPopMatrix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gfx_set_display_video_downscale(unsigned short,
                                                   unsigned short);
int gfx_set_video_vertical_downscale(unsigned short srch, unsigned short dsth) {
  gfx_set_display_video_downscale(srch, dsth);
  return 0;
}


x86 assembly (clang, -O0):
<gfx_set_video_vertical_downscale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzwl -0x4(%rbp),%esi
call   1030 <gfx_set_display_video_downscale@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gfx_set_video_vertical_downscale(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @gfx_set_display_video_downscale(i16 zeroext %0, i16 zeroext %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void answerSomething(char *string) { printf("%s\n", string); }


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

x86 assembly (clang, -O2):
<answerSomething>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @answerSomething(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @answerSomething(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *, int);
void Move_Ret_To_Mem_L(char *name, int index) {
  Inst_Printf("movl",
              "%%eax,"
              "%s+%d",
              name, index * 4);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Mem_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
lea    0xed0(%rip),%rdi
lea    0xece(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Mem_L>:
mov    %rdi,%rdx
lea    0x0(,%rsi,4),%ecx
lea    0xedf(%rip),%rdi
lea    0xedd(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"movl\00"
@.str.1 = [12 x i8] c"%%eax,%s+%d\00"
define void @Move_Ret_To_Mem_L(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 4
%8 = call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"movl\00"
@.str.1 = [12 x i8] c"%%eax,%s+%d\00"
define void @Move_Ret_To_Mem_L(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OUT(int, int);
void spiFlush(void) { OUT(0x01, (1 << 7)); }


x86 assembly (clang, -O0):
<spiFlush>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x80,%esi
call   1030 <OUT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spiFlush>:
mov    $0x1,%edi
mov    $0x80,%esi
jmp    1030 <OUT@plt>

LLVM IR (-O0):
define void @spiFlush() {
%1 = call i32 @OUT(i32 1, i32 128)
ret void
}

LLVM IR (-O2):
define void @spiFlush() {
%1 = tail call i32 @OUT(i32 1, i32 128)
ret void
}
/* Variables and functions */
int ENOSYS;
int errno;
int setxattr(const char *path, const char *name, void *value, size_t size,
             int flags) {
  return (errno = ENOSYS, -1);
}


x86 assembly (clang, -O0):
<setxattr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setxattr>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setxattr(i8* %0, i8* %1, i8* %2, i64 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%11 = load i32, i32* @ENOSYS
store i32 %11, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @setxattr(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, i32 %4) {
%6 = load i32, i32* @ENOSYS
store i32 %6, i32* @errno
ret i32 -1
}
int memagrep_search(pattern_len, pattern_buffer, input_len, input_buffer,
                    output_len, output)
int pattern_len;
char *pattern_buffer;
int input_len;
char *input_buffer;
int output_len;
void *output;
{
  return (agrep_search(pattern_len, pattern_buffer, -1, input_len, input_buffer,
                       output_len, output));
}


x86 assembly (clang, -O0):
<memagrep_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    -0x30(%rbp),%rax
mov    $0xffffffff,%edx
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <agrep_search@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memagrep_search>:
push   %rax
mov    %r8d,%eax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %r9,(%rsp)
mov    $0xffffffff,%edx
mov    %eax,%r9d
xor    %eax,%eax
call   1030 <agrep_search@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @memagrep_search(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = tail call i32 (i32, i8*, i32, i32, i8*, i32, i8*, ...) bitcast (i32 (...)* @agrep_search to i32 (i32, i8*, i32, i32, i8*, i32, i8*, ...)*)(i32 %0, i8* %1, i32 -1, i32 %2, i8* %3, i32 %4, i8* %5)
ret i32 %7
}
int test_imm_7Cuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x7C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Cuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 124
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int test_imm_99int8_mem(signed char *val) {
  return ((*val) & (0x99 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_99int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 153
%7 = icmp ne i32 %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_99int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -103
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ write_u32(unsigned char *, unsigned int);
void write_u64(unsigned char *dest, unsigned long long src) {
  write_u32(dest + 0, (unsigned int)src);
  write_u32(dest + 4, (unsigned int)(src >> 32));
}


x86 assembly (clang, -O0):
<write_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1030 <write_u32@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
mov    %eax,%esi
call   1030 <write_u32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_u64>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <write_u32@plt>
add    $0x4,%rbx
shr    $0x20,%r14
mov    %rbx,%rdi
mov    %r14d,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write_u32@plt>

LLVM IR (-O0):
define void @write_u64(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = call i32 @write_u32(i8* %6, i32 %8)
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 4
%12 = load i64, i64* %4
%13 = lshr i64 %12, 32
%14 = trunc i64 %13 to i32
%15 = call i32 @write_u32(i8* %11, i32 %14)
ret void
}

LLVM IR (-O2):
define void @write_u64(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = tail call i32 @write_u32(i8* %0, i32 %3)
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = lshr i64 %1, 32
%7 = trunc i64 %6 to i32
%8 = tail call i32 @write_u32(i8* %5, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void die(void) {
  fputs("Try `fcd-flash --help' for more information.\n", stderr);
  exit(EXIT_FAILURE);
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"Try `fcd-flash --help' for more information.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @die() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Try `fcd-flash --help' for more information.\0A\00"
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @die() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
float float32ScaledFromBitfield(unsigned int value, float min,
                                float invscaler) {
  return (float)(min + invscaler * value);
}


x86 assembly (clang, -O0):
<float32ScaledFromBitfield>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<float32ScaledFromBitfield>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm2
mulss  %xmm1,%xmm2
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @float32ScaledFromBitfield(i32 %0, float %1, float %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %6
%9 = load i32, i32* %4
%10 = uitofp i32 %9 to float
%11 = call float @llvm.fmuladd.f32(float %8, float %10, float %7)
ret float %11
}

LLVM IR (-O2):
define float @float32ScaledFromBitfield(i32 %0, float %1, float %2) {
%4 = uitofp i32 %0 to float
%5 = tail call float @llvm.fmuladd.f32(float %2, float %4, float %1)
ret float %5
}
int fun502() { return 502; }


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

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

LLVM IR (-O0):
define i32 @fun502() {
ret i32 502
}

LLVM IR (-O2):
define i32 @fun502() {
ret i32 502
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
divide(int a, int b) {
  int c;
  c = a / b;
  printf("the result is %d", c);
}


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

x86 assembly (clang, -O2):
<divide>:
mov    %edi,%eax
cltd
idiv   %esi
lea    0xee4(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"the result is %d\00"
define i32 @divide(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = sdiv i32 %7, %8
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [17 x i8] c"the result is %d\00"
define i32 @divide(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 undef
}
int func(void) {
  int n = 3;
  int m = 5;
  n >= m;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @func() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = icmp sge i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 0
}

LLVM IR (-O2):
define i32 @func() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PathStatusHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void PathStatusUpdated() { UAVObjUpdated(PathStatusHandle()); }


x86 assembly (clang, -O0):
<PathStatusUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <PathStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PathStatusUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <PathStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @PathStatusUpdated() {
%1 = call i32 (...) @PathStatusHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PathStatusUpdated() {
%1 = tail call i32 (...) @PathStatusHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ puts(char *);
void c(void) {
  FILE *nfPtr;
  if ((nfPtr = fopen("newmast.dat", "w")) == NULL) {
    puts("Non e' stato possibile scrivere il file");
  } else {
    puts("File non presente, e' stato creato");
  }
  fclose(nfPtr);
  return;
}


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    116a <c+0x3a>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
jmp    1176 <c+0x46>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecd(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
lea    0xebd(%rip),%rax
lea    0xede(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"newmast.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [40 x i8] c"Non e' stato possibile scrivere il file\00"
@.str.3 = [35 x i8] c"File non presente, e' stato creato\00"
define void @c() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"newmast.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [40 x i8] c"Non e' stato possibile scrivere il file\00"
@.str.3 = [35 x i8] c"File non presente, e' stato creato\00"
define void @c() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
%5 = tail call i32 @fclose(i32* %1)
ret void
}
const char *libccnxCommonAbout_Name(void) { return "Libccnx Common"; }


x86 assembly (clang, -O0):
<libccnxCommonAbout_Name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<libccnxCommonAbout_Name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Libccnx Common\00"
define i8* @libccnxCommonAbout_Name() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"Libccnx Common\00"
define i8* @libccnxCommonAbout_Name() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
double fnequ(double a, double b) { return a != b; }


x86 assembly (clang, -O0):
<fnequ>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
setne  %al
setp   %cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnequ>:
cmpneqsd %xmm1,%xmm0
movsd  0xef3(%rip),%xmm1
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fnequ(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp une double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @fnequ(double %0, double %1) {
%3 = fcmp une double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ teste(int, char **);
int main(int argc, char *argv[]) {
  if (argc == 1)
    printf("Modo de uso: %s <arq. de teste1> <arq. de teste2> ... <arq. de "
           "testeN>\n",
           argv[0]);
  else
    teste(argc, argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1158 <main+0x38>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1164 <main+0x44>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <teste@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jne    1137 <main+0x17>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
jmp    113c <main+0x1c>
call   1040 <teste@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [72 x i8] c"Modo de uso: %s <arq. de teste1> <arq. de teste2> ... <arq. de testeN>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %17
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i8**, i8*** %5
%16 = call i32 @teste(i32 %14, i8** %15)
br label %17
17: ; preds = %13, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [72 x i8] c"Modo de uso: %s <arq. de teste1> <arq. de teste2> ... <arq. de testeN>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %9
7: ; preds = %2
%8 = tail call i32 @teste(i32 %0, i8** %1)
br label %9
9: ; preds = %7, %4
ret i32 0
}
int fun1050() { return 1050; }


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

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

LLVM IR (-O0):
define i32 @fun1050() {
ret i32 1050
}

LLVM IR (-O2):
define i32 @fun1050() {
ret i32 1050
}
/* Variables and functions */
int /*<<< orphan*/ __CRAB_assert(int);
void check(int *s, int n) {
  __CRAB_assert(s[n] >= 0);
  __CRAB_assert(s[n] <= 1);
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__CRAB_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    (%rdi,%rbx,4),%edi
not    %edi
shr    $0x1f,%edi
call   1030 <__CRAB_assert@plt>
xor    %edi,%edi
cmpl   $0x2,(%r14,%rbx,4)
setl   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <__CRAB_assert@plt>

LLVM IR (-O0):
define void @check(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
%10 = icmp sge i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @__CRAB_assert(i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = icmp sle i32 %17, 1
%19 = zext i1 %18 to i32
%20 = call i32 @__CRAB_assert(i32 %19)
ret void
}

LLVM IR (-O2):
define void @check(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = xor i32 %5, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @__CRAB_assert(i32 %7)
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
%11 = zext i1 %10 to i32
%12 = tail call i32 @__CRAB_assert(i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_matrix(double *a) {
  if (a) {
    free(a);
  }
}


x86 assembly (clang, -O0):
<free_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <free_matrix+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @free_matrix(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = icmp ne double* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double*, double** %2
%7 = call i32 @free(double* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @free_matrix(double* %0) {
%2 = icmp eq double* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(double* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_fatal(char *);
void *malloc(size_t);
void *xmalloc(size_t num) {
  void *ptr_new = malloc(num);
  if (!ptr_new)
    error_fatal("unable to allocate memory");
  return ptr_new;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <xmalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <error_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"unable to allocate memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error_fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"unable to allocate memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error_fatal(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
long long bit15() { return 0x0000000000008000LL; }


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

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

LLVM IR (-O0):
define i64 @bit15() {
ret i64 32768
}

LLVM IR (-O2):
define i64 @bit15() {
ret i64 32768
}