xunge/DecIR huggingface dataset:
float FloatMax(float input1, float input2) {
  return input1 > input2 ? input1 : input2;
}


x86 assembly (clang, -O0):
<FloatMax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <FloatMax+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <FloatMax+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<FloatMax>:
maxss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @FloatMax(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ogt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @FloatMax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t i = 0;
  while (s[i] != '\0') {
    i++;
  }
  return i;
}


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
}
int Section3Third(int *number) { return *number % 100 / 10; }


x86 assembly (clang, -O0):
<Section3Third>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section3Third>:
movslq (%rdi),%rax
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%eax
movsbl %al,%eax
imul   $0x67,%eax,%eax
movzwl %ax,%eax
movswl %ax,%ecx
shr    $0xf,%eax
shr    $0xa,%ecx
add    %al,%cl
movsbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @Section3Third(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = srem i32 %4, 100
%6 = sdiv i32 %5, 10
ret i32 %6
}

LLVM IR (-O2):
define i32 @Section3Third(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = srem i32 %2, 100
%4 = trunc i32 %3 to i8
%5 = sdiv i8 %4, 10
%6 = sext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dap_write_word(int, int);
void target_lock(void) {
  dap_write_word(((0x400e0a00) + 0x04 + (0) * 0x200), 0x5a00000b | (0 << 8));
}


x86 assembly (clang, -O0):
<target_lock>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400e0a04,%edi
mov    $0x5a00000b,%esi
call   1030 <dap_write_word@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_lock>:
mov    $0x400e0a04,%edi
mov    $0x5a00000b,%esi
jmp    1030 <dap_write_word@plt>

LLVM IR (-O0):
define void @target_lock() {
%1 = call i32 @dap_write_word(i32 1074661892, i32 1509949451)
ret void
}

LLVM IR (-O2):
define void @target_lock() {
%1 = tail call i32 @dap_write_word(i32 1074661892, i32 1509949451)
ret void
}
void DELAY(void) {
  int i, j;
  for (i = 0; i < 10000000; i++) {
    j = i;
    i = j;
    i++;
  }
}


x86 assembly (clang, -O0):
<DELAY>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x989680,-0x4(%rbp)
jge    113b <DELAY+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <DELAY+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @DELAY() {
ret void
}
/* Variables and functions */
int rand();
int Random(int _imin, int _imax) {
  return (_imin + (rand() % (_imax - _imin + 1)));
}


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

x86 assembly (clang, -O2):
<Random>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Random(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 = call i32 (...) @rand()
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = add nsw i32 %9, 1
%11 = srem i32 %6, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @Random(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void rt_delete_scanlinereceives(void *voidhandle) { ; }


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

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

LLVM IR (-O0):
define void @rt_delete_scanlinereceives(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @rt_delete_scanlinereceives(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void elm_io_info(char *preamble, va_list ap) { vfprintf(stdout, preamble, ap); }


x86 assembly (clang, -O0):
<elm_io_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elm_io_info>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
define void @elm_io_info(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret void
}
int corner_after(int clipedge) {
  if ((clipedge & 0xc) == 4)
    return (2);
  else if ((clipedge & 0x6) == 2)
    return (1);
  else if ((clipedge & 0x3) == 1)
    return (0);
  return (3);
}


x86 assembly (clang, -O0):
<corner_after>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xc,%eax
cmp    $0x4,%eax
jne    1122 <corner_after+0x22>
movl   $0x2,-0x4(%rbp)
jmp    1169 <corner_after+0x69>
mov    -0x8(%rbp),%eax
and    $0x6,%eax
cmp    $0x2,%eax
jne    113d <corner_after+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1169 <corner_after+0x69>
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x1,%eax
jne    1158 <corner_after+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1169 <corner_after+0x69>
jmp    115d <corner_after+0x5d>
jmp    1162 <corner_after+0x62>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<corner_after>:
mov    %edi,%ecx
and    $0xc,%ecx
mov    $0x2,%eax
cmp    $0x4,%ecx
je     112c <corner_after+0x2c>
mov    %edi,%ecx
and    $0x6,%ecx
mov    $0x1,%eax
cmp    $0x2,%ecx
je     112c <corner_after+0x2c>
and    $0x3,%edi
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
lea    (%rax,%rax,2),%eax
ret

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

LLVM IR (-O2):
define i32 @corner_after(i32 %0) {
%2 = and i32 %0, 12
%3 = icmp eq i32 %2, 4
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = and i32 %0, 6
%6 = icmp eq i32 %5, 2
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 1
%10 = select i1 %9, i32 0, i32 3
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 2, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t diminuto_absolute_int64_t_f(int64_t value) {
  return (value < 0) ? -value : value;
}


x86 assembly (clang, -O0):
<diminuto_absolute_int64_t_f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <diminuto_absolute_int64_t_f+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <diminuto_absolute_int64_t_f+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @diminuto_absolute_int64_t_f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @diminuto_absolute_int64_t_f(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
size_t strlen(char *);
void chomp(char *s) {
  size_t length = strlen(s);
  if (s[length - 1] == '\n')
    s[length - 1] = '\0';
}


x86 assembly (clang, -O0):
<chomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1152 <chomp+0x42>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmpb   $0xa,-0x1(%rax,%rbx,1)
jne    1125 <chomp+0x15>
movb   $0x0,-0x1(%rbx,%rax,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @chomp(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, -1
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 0, i8* %4
br label %8
8: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int scanf(char *, unsigned int *);
void check_intInput(unsigned int *a) {
  if ((scanf("%u%*c", a)) != 1) {
    printf("Not digit!");
    exit(EXIT_FAILURE);
  }
  if (*a < 0) {
    printf("Can't be negative!");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<check_intInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     116f <check_intInput+0x3f>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jae    1196 <check_intInput+0x66>
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_intInput>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1147 <check_intInput+0x17>
pop    %rax
ret
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%u%*c\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [19 x i8] c"Can't be negative!\00"
define void @check_intInput(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = load i32*, i32** %2
%12 = load i32, i32* %11
%13 = icmp ult i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%u%*c\00"
@.str.1 = [11 x i8] c"Not digit!\00"
@EXIT_FAILURE = global i32 0
define void @check_intInput(i32* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MultM(double **, double **, double **);
int /*<<< orphan*/ genZRotMatrix(double, double **);
void CoordRotZ(double theta, double m[3][3]) {
  double a[3][3];
  genZRotMatrix(theta, a);
  MultM(m, a, m);
}


x86 assembly (clang, -O0):
<CoordRotZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x60(%rbp),%rdi
call   1030 <genZRotMatrix@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <MultM@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CoordRotZ>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <genZRotMatrix@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <MultM@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @CoordRotZ(double %0, [3 x double]* %1) {
%3 = alloca double
%4 = alloca [3 x double]*
%5 = alloca [3 x [3 x double]]
store double %0, double* %3
store [3 x double]* %1, [3 x double]** %4
%6 = load double, double* %3
%7 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%8 = bitcast [3 x double]* %7 to double**
%9 = call i32 @genZRotMatrix(double %6, double** %8)
%10 = load [3 x double]*, [3 x double]** %4
%11 = bitcast [3 x double]* %10 to double**
%12 = getelementptr inbounds [3 x [3 x double]], [3 x [3 x double]]* %5, i64 0, i64 0
%13 = bitcast [3 x double]* %12 to double**
%14 = load [3 x double]*, [3 x double]** %4
%15 = bitcast [3 x double]* %14 to double**
%16 = call i32 @MultM(double** %11, double** %13, double** %15)
ret void
}

LLVM IR (-O2):
define void @CoordRotZ(double %0, [3 x double]* %1) {
%3 = alloca [3 x [3 x double]]
%4 = bitcast [3 x [3 x double]]* %3 to i8*
%5 = bitcast [3 x [3 x double]]* %3 to double**
%6 = call i32 @genZRotMatrix(double %0, double** %5)
%7 = bitcast [3 x double]* %1 to double**
%8 = call i32 @MultM(double** %7, double** %5, double** %7)
ret void
}
void svg_abs(int x, int y) {}


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

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

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

LLVM IR (-O2):
define void @svg_abs(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int lw_sock_recv_str_ex(int *, char *);
int lw_sock_recv_str(int *sock, char *str) {
  int result = 0;
  result = lw_sock_recv_str_ex(sock, str);
  return result;
}


x86 assembly (clang, -O0):
<lw_sock_recv_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lw_sock_recv_str_ex@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw_sock_recv_str>:
jmp    1030 <lw_sock_recv_str_ex@plt>

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

LLVM IR (-O2):
define i32 @lw_sock_recv_str(i32* %0, i8* %1) {
%3 = tail call i32 @lw_sock_recv_str_ex(i32* %0, i8* %1)
ret i32 %3
}
float CalcGflops(double computeTimeInSeconds, unsigned int iterations,
                 unsigned int nx, unsigned int ny) {
  return iterations * (double)((nx * ny) * 1e-9 * 8.0) / computeTimeInSeconds;
}


x86 assembly (clang, -O0):
<CalcGflops>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ecx
imul   %ecx,%eax
cvtsi2sd %rax,%xmm1
movsd  0xed8(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec4(%rip),%xmm2
mulsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x8(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcGflops>:
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
imul   %edx,%esi
cvtsi2sd %rsi,%xmm2
mulsd  0xee9(%rip),%xmm2
mulsd  0xee9(%rip),%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsd2ss %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @CalcGflops(double %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store double %0, double* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = uitofp i32 %9 to double
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = mul i32 %11, %12
%14 = uitofp i32 %13 to double
%15 = fmul double %14, 1.000000e-09
%16 = fmul double %15, 8.000000e+00
%17 = fmul double %10, %16
%18 = load double, double* %5
%19 = fdiv double %17, %18
%20 = fptrunc double %19 to float
ret float %20
}

LLVM IR (-O2):
define float @CalcGflops(double %0, i32 %1, i32 %2, i32 %3) {
%5 = uitofp i32 %1 to double
%6 = mul i32 %3, %2
%7 = uitofp i32 %6 to double
%8 = fmul double %7, 1.000000e-09
%9 = fmul double %8, 8.000000e+00
%10 = fmul double %9, %5
%11 = fdiv double %10, %0
%12 = fptrunc double %11 to float
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printno() { printf("No\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"No\00"
define void @printno() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_line(char *);
void gen_swap_stack(void) { output_line("ex (sp),hl"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"ex (sp),hl\00"
define void @gen_swap_stack() {
%1 = call i32 @output_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"ex (sp),hl\00"
define void @gen_swap_stack() {
%1 = tail call i32 @output_line(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sfmt_state_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gen_rand32(struct sfmt_state_t *);
float to_real2f(int /*<<< orphan*/);
float genrand_real2f(struct sfmt_state_t *s) {
  return to_real2f(gen_rand32(s));
}


x86 assembly (clang, -O0):
<genrand_real2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <gen_rand32@plt>
mov    %eax,%edi
call   1030 <to_real2f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real2f>:
push   %rax
call   1040 <gen_rand32@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <to_real2f@plt>

LLVM IR (-O0):
%struct.sfmt_state_t = type { i32 }
define float @genrand_real2f(%struct.sfmt_state_t* %0) {
%2 = alloca %struct.sfmt_state_t*
store %struct.sfmt_state_t* %0, %struct.sfmt_state_t** %2
%3 = load %struct.sfmt_state_t*, %struct.sfmt_state_t** %2
%4 = call i32 @gen_rand32(%struct.sfmt_state_t* %3)
%5 = call float @to_real2f(i32 %4)
ret float %5
}

LLVM IR (-O2):
%struct.sfmt_state_t = type { i32 }
define float @genrand_real2f(%struct.sfmt_state_t* %0) {
%2 = tail call i32 @gen_rand32(%struct.sfmt_state_t* %0)
%3 = tail call float @to_real2f(i32 %2)
ret float %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ PASS(char *);
int /*<<< orphan*/ RTLD_LAZY;
int /*<<< orphan*/ callAll(int /*<<< orphan*/ *);
int /*<<< orphan*/ dlopen(char *, int /*<<< orphan*/);
int main() {
  dlopen("libfoo.dylib", RTLD_LAZY);
  callAll(NULL);
  PASS("jump-table-dynamic-lookup");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <dlopen@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <callAll@plt>
lea    0xea9(%rip),%rdi
call   1050 <PASS@plt>
mov    0x2e70(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1040 <dlopen@plt>
xor    %edi,%edi
call   1030 <callAll@plt>
lea    0xeb9(%rip),%rdi
call   1050 <PASS@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"libfoo.dylib\00"
@RTLD_LAZY = global i32 0
@.str.1 = [26 x i8] c"jump-table-dynamic-lookup\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @RTLD_LAZY
%3 = call i32 @dlopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @callAll(i32* null)
%5 = call i32 @PASS(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [13 x i8] c"libfoo.dylib\00"
@RTLD_LAZY = global i32 0
@.str.1 = [26 x i8] c"jump-table-dynamic-lookup\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @RTLD_LAZY
%2 = tail call i32 @dlopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @callAll(i32* null)
%4 = tail call i32 @PASS(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
void *test_ptr_alloc_align(int);
void *align536870912() { return test_ptr_alloc_align(1073741824); }


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

x86 assembly (clang, -O2):
<align536870912>:
mov    $0x40000000,%edi
jmp    1030 <test_ptr_alloc_align@plt>

LLVM IR (-O0):
define i8* @align536870912() {
%1 = call i8* @test_ptr_alloc_align(i32 1073741824)
ret i8* %1
}

LLVM IR (-O2):
define i8* @align536870912() {
%1 = tail call i8* @test_ptr_alloc_align(i32 1073741824)
ret i8* %1
}
/* Type definitions */
struct task_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_tsk_thread_flag(struct task_struct *, int);
__attribute__((always_)) void clear_tsk_need_resched(struct task_struct *tsk) {
  clear_tsk_thread_flag(tsk, 3);
}


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

x86 assembly (clang, -O2):
<clear_tsk_need_resched>:
mov    $0x3,%esi
jmp    1030 <clear_tsk_thread_flag@plt>

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

LLVM IR (-O2):
%struct.task_struct = type { i32 }
define void @clear_tsk_need_resched(%struct.task_struct* %0) {
%2 = tail call i32 @clear_tsk_thread_flag(%struct.task_struct* %0, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int EVP_DecryptFinal_ex(int /*<<< orphan*/ *, unsigned char *, int *);
int EVP_DecryptInit_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) {
  int i;
  i = EVP_DecryptFinal_ex(ctx, out, outl);
  if (i)
    i = EVP_DecryptInit_ex(ctx, NULL, NULL, NULL, NULL);
  return (i);
}


x86 assembly (clang, -O0):
<EVP_OpenFinal>:
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 <EVP_DecryptFinal_ex@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     116c <EVP_OpenFinal+0x4c>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rsi
mov    %r8,%rdx
mov    %r8,%rcx
call   1040 <EVP_DecryptInit_ex@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_OpenFinal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <EVP_DecryptFinal_ex@plt>
test   %eax,%eax
je     113f <EVP_OpenFinal+0x1f>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <EVP_DecryptInit_ex@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @EVP_OpenFinal(i32* %0, i8* %1, i32* %2) {
%4 = tail call i32 @EVP_DecryptFinal_ex(i32* %0, i8* %1, i32* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @EVP_DecryptInit_ex(i32* %0, i32* null, i32* null, i32* null, i32* null)
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ %7, %6 ], [ 0, %3 ]
ret i32 %9
}
float clamp(float f, float m, float M) {
  return ((((f > M) ? M : f) > m) ? ((f > M) ? M : f) : m);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <clamp+0x31>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    113b <clamp+0x3b>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1181 <clamp+0x81>
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1168 <clamp+0x68>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1172 <clamp+0x72>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    118b <clamp+0x8b>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
minss  %xmm0,%xmm2
maxss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = fcmp ogt float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load float, float* %6
br label %14
12: ; preds = %3
%13 = load float, float* %4
br label %14
14: ; preds = %12, %10
%15 = phi float [ %11, %10 ], [ %13, %12 ]
%16 = load float, float* %5
%17 = fcmp ogt float %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = load float, float* %4
%20 = load float, float* %6
%21 = fcmp ogt float %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = load float, float* %6
br label %26
24: ; preds = %18
%25 = load float, float* %4
br label %26
26: ; preds = %24, %22
%27 = phi float [ %23, %22 ], [ %25, %24 ]
br label %30
28: ; preds = %14
%29 = load float, float* %5
br label %30
30: ; preds = %28, %26
%31 = phi float [ %27, %26 ], [ %29, %28 ]
ret float %31
}

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %2
%5 = select i1 %4, float %2, float %0
%6 = fcmp ogt float %5, %1
%7 = select i1 %6, float %5, float %1
ret float %7
}
void InitTab(char Tableau[], int long_tab) {
  int i = 0;
  for (i = 0; i < long_tab; i++) {
    Tableau[i] = 0;
  }
}


x86 assembly (clang, -O0):
<InitTab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113f <InitTab+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <InitTab+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InitTab>:
test   %esi,%esi
jle    1122 <InitTab+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @InitTab(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
store i32 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
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
store i8 0, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @InitTab(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show_bytes(unsigned char *start, int len) {
  int i = 0;
  for (; i < len; ++i)
    printf(" %.2x", start[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<show_bytes>:
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 <show_bytes+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <show_bytes+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1158 <show_bytes+0x38>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <show_bytes+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c" %.2x\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @show_bytes(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 = zext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), 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
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c" %.2x\00"
define void @show_bytes(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 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), 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
%15 = tail call i32 @putchar(i32 10)
ret void
}
void OnKEYSET_Allocate() {}


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

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

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

LLVM IR (-O2):
define void @OnKEYSET_Allocate() {
ret void
}
unsigned long gp2x_timer_raw_one_second(void) { return 7372800; }


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

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

LLVM IR (-O0):
define i64 @gp2x_timer_raw_one_second() {
ret i64 7372800
}

LLVM IR (-O2):
define i64 @gp2x_timer_raw_one_second() {
ret i64 7372800
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ errn_exit(int, char *);
int pthread_mutex_lock(int /*<<< orphan*/ *);
void _lock(pthread_mutex_t *l) {
  int n = pthread_mutex_lock(l);
  if (n)
    errn_exit(n, "_lock");
}


x86 assembly (clang, -O0):
<_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_lock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1151 <_lock+0x31>
mov    -0xc(%rbp),%edi
lea    0xeb4(%rip),%rsi
call   1030 <errn_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_lock>:
push   %rax
call   1040 <pthread_mutex_lock@plt>
test   %eax,%eax
je     1139 <_lock+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errn_exit@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"_lock\00"
define void @_lock(i32* %0) {
%2 = tail call i32 @pthread_mutex_lock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @errn_exit(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t uDMAErrorStatusGet(void) {
  return ((*((volatile uint32_t *)(0x400FF04C))));
}


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

x86 assembly (clang, -O2):
<uDMAErrorStatusGet>:
mov    0x400ff04c,%eax
ret

LLVM IR (-O0):
define i32 @uDMAErrorStatusGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074786380 to i32*)
ret i32 %1
}

LLVM IR (-O2):
define i32 @uDMAErrorStatusGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074786380 to i32*)
ret i32 %1
}
/* Variables and functions */
short add(int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, short, short);
int main(void) {
  short x = 10 * 256 + 1;
  short y = add(10, 0, 0, 1);
  printf("%d %d\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0xa01,-0x6(%rbp)
mov    $0xa,%edi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
call   1030 <add@plt>
mov    %ax,-0x8(%rbp)
mov    -0x6(%rbp),%ax
lea    0xea9(%rip),%rdi
movswl %ax,%esi
movswl -0x8(%rbp),%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <add@plt>
movswl %ax,%edx
lea    0xec2(%rip),%rdi
mov    $0xa01,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
store i32 0, i32* %1
store i16 2561, i16* %2
%4 = call signext i16 @add(i32 10, i32 0, i32 0, i32 1)
store i16 %4, i16* %3
%5 = load i16, i16* %2
%6 = load i16, i16* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i16 signext %5, i16 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call signext i16 @add(i32 10, i32 0, i32 0, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i16 signext 2561, i16 signext %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
char *strchr(char *, char);
char *gets(char *c) {
  read(STDIN_FILENO, c, 4096);
  char *end = strchr(c, '\n');
  if (end != 0)
    *end = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<gets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    $0x1000,%edx
call   1040 <read@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1167 <gets+0x47>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gets>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    $0x1000,%edx
call   1040 <read@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     114f <gets+0x2f>
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i8* @gets(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i32, i32* @STDIN_FILENO
%5 = load i8*, i8** %2
%6 = call i32 @read(i32 %4, i8* %5, i32 4096)
%7 = load i8*, i8** %2
%8 = call i8* @strchr(i8* %7, i8 signext 10)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = load i8*, i8** %3
store i8 0, i8* %12
br label %13
13: ; preds = %11, %1
ret i8* null
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define noalias i8* @gets(i8* %0) {
%2 = load i32, i32* @STDIN_FILENO
%3 = tail call i32 @read(i32 %2, i8* %0, i32 4096)
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%5 = icmp eq i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 0, i8* %4
br label %7
7: ; preds = %6, %1
ret i8* null
}
void fa126(void) {
a:
  ({
    P01A:
      goto P01A;
      ({
        P012A:
          goto P012A;
          0;
      });
    P01B:
      goto P01B;
      ({
        P013A:
          goto P013A;
          0;
      });
    P01C:
      goto P01C;
      0;
  });
P0B:
  goto P0B;
  ({
    P02A:
      goto P02A;
      ({
        P024A:
          goto P024A;
          0;
      });
    p02B:
      goto p02B;
      goto a;
    P02B:
      goto P02B;
      ({
        P025A:
          goto P025A;
          0;
      });
    P02C:
      goto P02C;
      0;
  });
P0C:
  goto P0C;
  0;
P0D:
  goto P0D;
}


x86 assembly (clang, -O0):
<fa126>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <fa126+0x9>
jmp    1109 <fa126+0x9>

x86 assembly (clang, -O2):
<fa126>:
jmp    1100 <fa126>

LLVM IR (-O0):
define void @fa126() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
br label %7
7: ; preds = %0
br label %8
8: ; preds = %8, %7
br label %8
9: ; No predecessors!
br label %10
10: ; preds = %10, %9
br label %10
11: ; preds = %11
br label %11
12: ; No predecessors!
br label %13
13: ; preds = %13, %12
br label %13
14: ; preds = %14
br label %14
15: ; preds = %15
br label %15
16: ; No predecessors!
br label %17
17: ; preds = %17, %16
br label %17
18: ; No predecessors!
br label %19
19: ; preds = %19, %18
br label %19
20: ; preds = %20
br label %20
21: ; preds = %21
br label %21
22: ; No predecessors!
br label %23
23: ; preds = %23, %22
br label %23
24: ; preds = %24
br label %24
25: ; preds = %25
br label %25
26: ; preds = %26
br label %26
}

LLVM IR (-O2):
define void @fa126() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *strncat(char *, char *, int);
int main() {
  char *s1 = "hello ";
  char *s2 = "world";
  char *s1_ = malloc(sizeof(strlen(s1) + strlen(s2) + 1));
  strcpy(s1_, s1);
  char *r = strncat(s1_, s2, 2);
  printf("r: %s\n", r);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xea6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1050 <strncat@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x8,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1050 <strncat@plt>
lea    0xe95(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"hello \00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [7 x i8] c"r: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %3
%6 = call i8* @malloc(i32 8)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = load i8*, i8** %4
%11 = load i8*, i8** %3
%12 = call i8* @strncat(i8* %10, i8* %11, i32 2)
store i8* %12, i8** %5
%13 = load i8*, i8** %5
%14 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"hello \00"
@.str.1 = [6 x i8] c"world\00"
@.str.2 = [7 x i8] c"r: %s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(8) i8* @malloc(i32 8)
%2 = tail call i32 @strcpy(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strncat(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret i32 0
}