xunge/DecIR huggingface dataset:
int olderFirst(int age1, int age2) {
  if (age1 >= age2)
    return age1;
  else
    return age2;
}


x86 assembly (clang, -O0):
<olderFirst>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1121 <olderFirst+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <olderFirst+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<olderFirst>:
mov    %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @olderFirst(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
void testA() {}


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

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

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

LLVM IR (-O2):
define void @testA() {
ret void
}
float constrain(float x, float minx, float maxx) {
  if (x > maxx) {
    return maxx;
  }
  if (x < minx) {
    return minx;
  }
  return x;
}


x86 assembly (clang, -O0):
<constrain>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1131 <constrain+0x31>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <constrain+0x5d>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <constrain+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <constrain+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<constrain>:
maxss  %xmm0,%xmm1
movaps %xmm2,%xmm3
cmpltss %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm1,%xmm0
andps  %xmm2,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @constrain(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %2
%5 = fcmp olt float %0, %1
%6 = select i1 %5, float %1, float %0
%7 = select i1 %4, float %2, float %6
ret float %7
}
int isOddDigit(int n) {
  int r;
  while (n != 0) {
    r = n % 10;
    if (!(r & 0x1))
      return 0;
    n /= 10;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isOddDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114d <isOddDigit+0x4d>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    113a <isOddDigit+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1154 <isOddDigit+0x54>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1107 <isOddDigit+0x7>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOddDigit>:
mov    $0x1,%eax
test   %edi,%edi
je     1137 <isOddDigit+0x37>
nopl   0x0(%rax)
test   $0x1,%dil
je     1138 <isOddDigit+0x38>
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    $0x9,%edi
cmp    $0x12,%edi
mov    %ecx,%edi
ja     1110 <isOddDigit+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isOddDigit(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %9
%4 = phi i32 [ %6, %9 ], [ %0, %1 ]
%5 = srem i32 %4, 10
%6 = sdiv i32 %4, 10
%7 = and i32 %5, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %3
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %9, %1
%13 = phi i32 [ 1, %1 ], [ 1, %9 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int a = 0, b = 0;
  int x;
  for (x = 0; x < 3; x++) {
    break;
    b = 1;
  }
  assert(a == b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1143 <main+0x33>
jmp    1143 <main+0x33>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %12
8: ; preds = %5
br label %12
9: ; No predecessors!
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
br label %5
12: ; preds = %8, %5
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp eq i32 %13, %14
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
int ft_isdigit(int c) {
  if (c >= '0' && c <= '9') {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isdigit+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <ft_isdigit+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <ft_isdigit+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int is_beginning_of_text(int position_in_string) {
  return position_in_string == 0;
}


x86 assembly (clang, -O0):
<is_beginning_of_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_beginning_of_text>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_beginning_of_text(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int roundf(float);
int __attribute__((always_)) fast_roundf(float x) { return roundf(x); }


x86 assembly (clang, -O0):
<fast_roundf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <roundf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_roundf>:
jmp    1030 <roundf@plt>

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

LLVM IR (-O2):
define i32 @fast_roundf(float %0) {
%2 = tail call i32 @roundf(float %0)
ret i32 %2
}
/* Variables and functions */
int SIGALRM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void sighandler(int signo) {
  if (signo == SIGALRM) {
    fprintf(stdout, "timeout reading answer from sta, exiting\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<sighandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2eb3(%rip),%rcx
cmp    (%rcx),%eax
jne    115c <sighandler+0x3c>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighandler>:
push   %rax
mov    0x2ec0(%rip),%rax
cmp    %edi,(%rax)
je     112e <sighandler+0xe>
pop    %rax
ret
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@stdout = global i32 0
@.str = [42 x i8] c"timeout reading answer from sta, exiting\0A\00"
define void @sighandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGALRM
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stdout
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@stdout = global i32 0
@.str = [42 x i8] c"timeout reading answer from sta, exiting\0A\00"
define void @sighandler(i32 %0) {
%2 = load i32, i32* @SIGALRM
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stdout
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fuck(void) {
  printf("WTF!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"WTF!\00"
define i32 @fuck() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clear_command_list();
int /*<<< orphan*/ init_command_list();
int sd_rehash(int argc, char **argv, int in, int out, int err) {
  (void)argc;
  (void)argv;
  (void)in;
  (void)out;
  (void)err;
  clear_command_list();
  init_command_list();
  return 0;
}


x86 assembly (clang, -O0):
<sd_rehash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <clear_command_list@plt>
mov    $0x0,%al
call   1040 <init_command_list@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_rehash>:
push   %rax
xor    %eax,%eax
call   1030 <clear_command_list@plt>
xor    %eax,%eax
call   1040 <init_command_list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sd_rehash(i32 %0, i8** %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8** %1, i8*** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8**, i8*** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 (...) @clear_command_list()
%17 = call i32 (...) @init_command_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @sd_rehash(i32 %0, i8** nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 (...) @clear_command_list()
%7 = tail call i32 (...) @init_command_list()
ret i32 0
}
void enableAprsPwm(void) {}


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

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

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

LLVM IR (-O2):
define void @enableAprsPwm() {
ret void
}
int skip_atoi(const char **s) {
  unsigned int i = 0;
  while (((**s) >= '0' && (**s) <= '9')) {
    i = i * 10 + *((*s)++) - '0';
  }
  return i;
}


x86 assembly (clang, -O0):
<skip_atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     113a <skip_atoi+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <skip_atoi+0x4a>
jmp    116f <skip_atoi+0x6f>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <skip_atoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_atoi>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
add    $0xd0,%dl
xor    %eax,%eax
cmp    $0x9,%dl
ja     113f <skip_atoi+0x3f>
add    $0x1,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    (%rax,%rax,4),%eax
mov    %rcx,(%rdi)
movsbl -0x1(%rcx),%edx
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rcx),%edx
add    $0xd0,%dl
add    $0x1,%rcx
cmp    $0xa,%dl
jb     1120 <skip_atoi+0x20>
ret

LLVM IR (-O0):
define i32 @skip_atoi(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp sge i32 %8, 48
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 57
br label %16
16: ; preds = %10, %4
%17 = phi i1 [ false, %4 ], [ %15, %10 ]
br i1 %17, label %18, label %28
18: ; preds = %16
%19 = load i32, i32* %3
%20 = mul i32 %19, 10
%21 = load i8**, i8*** %2
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %21
%24 = load i8, i8* %22
%25 = sext i8 %24 to i32
%26 = add i32 %20, %25
%27 = sub i32 %26, 48
store i32 %27, i32* %3
br label %4
28: ; preds = %16
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @skip_atoi(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %2, %1 ]
%8 = phi i32 [ %14, %6 ], [ 0, %1 ]
%9 = mul i32 %8, 10
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %10, i8** %0
%11 = load i8, i8* %7
%12 = sext i8 %11 to i32
%13 = add i32 %9, -48
%14 = add i32 %13, %12
%15 = load i8, i8* %10
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %14, %6 ]
ret i32 %19
}
void gtk_im_multicontext_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_multicontext_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void output_function_csv_pre() {
  printf("\"Host\",\"Port\",\"Time\",\"Response\"\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"\22Host\22,\22Port\22,\22Time\22,\22Response\22\0A\00"
define void @output_function_csv_pre() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"\22Host\22,\22Port\22,\22Time\22,\22Response\22\00"
define void @output_function_csv_pre() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int simpleSocketClose(int socketId) {
  close(socketId);
  return 0;
}


x86 assembly (clang, -O0):
<simpleSocketClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @simpleSocketClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
void x_bs(c) int c;
{
  int i;
  i = x_size(c);
  while (i--)
    x_e_putc('\b');
}


x86 assembly (clang, -O0):
<x_bs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <x_size@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     115d <x_bs+0x3d>
mov    $0x8,%edi
mov    $0x0,%al
call   1030 <x_e_putc@plt>
jmp    1138 <x_bs+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_bs>:
push   %rbx
xor    %eax,%eax
call   1040 <x_size@plt>
test   %eax,%eax
je     1141 <x_bs+0x21>
mov    %eax,%ebx
xchg   %ax,%ax
mov    $0x8,%edi
xor    %eax,%eax
call   1030 <x_e_putc@plt>
add    $0xffffffff,%ebx
jne    1130 <x_bs+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @x_bs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (i32, ...) bitcast (i32 (...)* @x_size to i32 (i32, ...)*)(i32 %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, -1
store i32 %8, i32* %3
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %12
10: ; preds = %6
%11 = call i32 (i32, ...) bitcast (i32 (...)* @x_e_putc to i32 (i32, ...)*)(i32 8)
br label %6
12: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @x_bs(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @x_size to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %2, %1 ]
%6 = add nsw i32 %5, -1
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @x_e_putc to i32 (i32, ...)*)(i32 8)
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handle_41(int /*<<< orphan*/);
int gen_41() { handle_41(0); }


x86 assembly (clang, -O0):
<gen_41>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <handle_41@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_41>:
xor    %edi,%edi
jmp    1030 <handle_41@plt>

LLVM IR (-O0):
define i32 @gen_41() {
%1 = alloca i32
%2 = call i32 @handle_41(i32 0)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @gen_41() {
%1 = tail call i32 @handle_41(i32 0)
ret i32 undef
}
int test_imm_31uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x31 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_31uint64_midword_reg>:
test   $0x310000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_31uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 49
%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_31uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 3211264
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct Ann {
  int dummy;
};

/* Variables and functions */
struct Ann *AnnCreateNet(int, int *);
struct Ann *AnnCreateNet2(int iunits, int ounits) {
  int units[2];
  units[0] = ounits;
  units[1] = iunits;
  return AnnCreateNet(2, units);
}


x86 assembly (clang, -O0):
<AnnCreateNet2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rsi
mov    $0x2,%edi
call   1030 <AnnCreateNet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AnnCreateNet2>:
push   %rax
mov    %esi,(%rsp)
mov    %edi,0x4(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
call   1030 <AnnCreateNet@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.Ann = type { i32 }
define %struct.Ann* @AnnCreateNet2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %6, i32* %7
%8 = load i32, i32* %3
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %8, i32* %9
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%11 = call %struct.Ann* @AnnCreateNet(i32 2, i32* %10)
ret %struct.Ann* %11
}

LLVM IR (-O2):
%struct.Ann = type { i32 }
define %struct.Ann* @AnnCreateNet2(i32 %0, i32 %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %1, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %0, i32* %6
%7 = call %struct.Ann* @AnnCreateNet(i32 2, i32* %5)
ret %struct.Ann* %7
}
/* Type definitions */
struct tms {
  int dummy;
};
typedef int /*<<< orphan*/ clock_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ _times(struct tms *);
int /*<<< orphan*/ errno;
clock_t times(struct tms *buffer) {
  if (buffer == 0) {
    errno = EINVAL;
    return (clock_t)(-1);
  }
  return _times(buffer);
}


x86 assembly (clang, -O0):
<times>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <times+0x35>
mov    0x2eaa(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea9(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <times+0x41>
mov    -0x10(%rbp),%rdi
call   1030 <_times@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<times>:
test   %rdi,%rdi
je     111a <times+0xa>
jmp    1030 <_times@plt>
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    0x2eb6(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @times(%struct.tms* %0) {
%2 = alloca i32
%3 = alloca %struct.tms*
store %struct.tms* %0, %struct.tms** %3
%4 = load %struct.tms*, %struct.tms** %3
%5 = icmp eq %struct.tms* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load i32, i32* @EINVAL
store i32 %7, i32* @errno
store i32 -1, i32* %2
br label %11
8: ; preds = %1
%9 = load %struct.tms*, %struct.tms** %3
%10 = call i32 @_times(%struct.tms* %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.tms = type { i32 }
@EINVAL = global i32 0
@errno = global i32 0
define i32 @times(%struct.tms* %0) {
%2 = icmp eq %struct.tms* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
br label %7
5: ; preds = %1
%6 = tail call i32 @_times(%struct.tms* %0)
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ -1, %3 ], [ %6, %5 ]
ret i32 %8
}
void testing2() {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-overflow"
  int j = 4;
  j + 4 < j;
#pragma GCC diagnostic pop
}


x86 assembly (clang, -O0):
<testing2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testing2() {
%1 = alloca i32
store i32 4, i32* %1
%2 = load i32, i32* %1
%3 = add nsw i32 %2, 4
%4 = load i32, i32* %1
%5 = icmp slt i32 %3, %4
%6 = zext i1 %5 to i32
ret void
}

LLVM IR (-O2):
define void @testing2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: f3d [-l LENGTH] [-o OFFSET] FILE\n"
                  "\n"
                  "f3d v"
                  "0.2"
                  ": N64 Fast3D display list decoder\n"
                  "\n"
                  "Optional arguments:\n"
                  " -l LENGTH    length of data to decode in bytes (default: "
                  "length of file)\n"
                  " -o OFFSET    starting offset in FILE (default: 0)\n"
                  "\n"
                  "File arguments:\n"
                  " FILE        input file\n"
                  " [OUTPUT]    output file (default: stdout)\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [314 x i8] c"Usage: f3d [-l LENGTH] [-o OFFSET] FILE\0A\0Af3d v0.2: N64 Fast3D display list decoder\0A\0AOptional arguments:\0A -l LENGTH length of data to decode in bytes (default: length of file)\0A -o OFFSET starting offset in FILE (default: 0)\0A\0AFile arguments:\0A FILE input file\0A [OUTPUT] output file (default: stdout)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [314 x i8] c"Usage: f3d [-l LENGTH] [-o OFFSET] FILE\0A\0Af3d v0.2: N64 Fast3D display list decoder\0A\0AOptional arguments:\0A -l LENGTH length of data to decode in bytes (default: length of file)\0A -o OFFSET starting offset in FILE (default: 0)\0A\0AFile arguments:\0A FILE input file\0A [OUTPUT] output file (default: stdout)\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([314 x i8], [314 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int mxml_string_putc(int ch, void *p) {
  char **pp;
  pp = (char **)p;
  if (pp[0] < pp[1])
    pp[0][0] = ch;
  pp[0]++;
  return (0);
}


x86 assembly (clang, -O0):
<mxml_string_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x18(%rbp),%rcx
cmp    0x8(%rcx),%rax
jae    1136 <mxml_string_putc+0x36>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mxml_string_putc>:
mov    (%rsi),%rax
cmp    0x8(%rsi),%rax
jae    110f <mxml_string_putc+0xf>
mov    %dil,(%rax)
mov    (%rsi),%rax
add    $0x1,%rax
mov    %rax,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mxml_string_putc(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %1, i64 8
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = icmp ult i8* %4, %7
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = trunc i32 %0 to i8
store i8 %10, i8* %4
%11 = load i8*, i8** %3
br label %12
12: ; preds = %9, %2
%13 = phi i8* [ %11, %9 ], [ %4, %2 ]
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8* %14, i8** %3
ret i32 0
}
/* Variables and functions */
long double remainerl(long double, long double);
long double remquol(long double x, long double y, int *quo) {
  *quo = (int)x / (int)y;
  return remainerl(x, y);
}


x86 assembly (clang, -O0):
<remquol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
mov    %rdi,-0x28(%rbp)
fldt   -0x10(%rbp)
fnstcw -0x32(%rbp)
movzwl -0x32(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x34(%rbp)
fldcw  -0x34(%rbp)
fistpl -0x2c(%rbp)
fldcw  -0x32(%rbp)
mov    -0x2c(%rbp),%eax
fldt   -0x20(%rbp)
fnstcw -0x36(%rbp)
movzwl -0x36(%rbp),%ecx
or     $0xc00,%ecx
mov    %cx,-0x38(%rbp)
fldcw  -0x38(%rbp)
fistpl -0x30(%rbp)
fldcw  -0x36(%rbp)
mov    -0x30(%rbp),%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <remainerl@plt>
fld    %st(0)
fstp   %st(0)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remquol>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fnstcw -0xe(%rsp)
movzwl -0xe(%rsp),%eax
or     $0xc00,%eax
mov    %ax,-0xa(%rsp)
fldcw  -0xa(%rsp)
fistpl -0x8(%rsp)
fldcw  -0xe(%rsp)
mov    -0x8(%rsp),%eax
fnstcw -0x10(%rsp)
movzwl -0x10(%rsp),%ecx
or     $0xc00,%ecx
mov    %cx,-0xc(%rsp)
fldcw  -0xc(%rsp)
fistpl -0x4(%rsp)
fldcw  -0x10(%rsp)
cltd
idivl  -0x4(%rsp)
mov    %eax,(%rdi)
jmp    1030 <remainerl@plt>

LLVM IR (-O0):
define x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca i32*
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store i32* %2, i32** %6
%7 = load x86_fp80, x86_fp80* %4
%8 = fptosi x86_fp80 %7 to i32
%9 = load x86_fp80, x86_fp80* %5
%10 = fptosi x86_fp80 %9 to i32
%11 = sdiv i32 %8, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load x86_fp80, x86_fp80* %4
%14 = load x86_fp80, x86_fp80* %5
%15 = call x86_fp80 @remainerl(x86_fp80 %13, x86_fp80 %14)
ret x86_fp80 %15
}

LLVM IR (-O2):
define x86_fp80 @remquol(x86_fp80 %0, x86_fp80 %1, i32* nocapture writeonly %2) {
%4 = fptosi x86_fp80 %0 to i32
%5 = fptosi x86_fp80 %1 to i32
%6 = sdiv i32 %4, %5
store i32 %6, i32* %2
%7 = tail call x86_fp80 @remainerl(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %7
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_log2l();
scalar_t__ log2l(long double);
void test_log2l(long double ld) {
  if (log2l(ld) != log2l(ld))
    link_failure_log2l();
}


x86 assembly (clang, -O0):
<test_log2l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log2l@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <log2l@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_log2l+0x43>
mov    $0x0,%al
call   1040 <link_failure_log2l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_log2l>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <log2l@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <log2l@plt>
cmp    %rax,%rbx
jne    1151 <test_log2l+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_log2l@plt>

LLVM IR (-O0):
define void @test_log2l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @log2l(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @log2l(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_log2l()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_log2l(x86_fp80 %0) {
%2 = tail call i64 @log2l(x86_fp80 %0)
%3 = tail call i64 @log2l(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_log2l()
br label %7
7: ; preds = %5, %1
ret void
}
void header(void) {}


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

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

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

LLVM IR (-O2):
define void @header() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XSelectionClearEvent;

/* Variables and functions */
unsigned long get_XSelectionClearEvent_window(void *_p) {
  return (unsigned long)((XSelectionClearEvent *)_p)->window;
}


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

x86 assembly (clang, -O2):
<get_XSelectionClearEvent_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XSelectionClearEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XSelectionClearEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int main() {
  unsigned long n = 100, ns = n * n, npo = n + 1;
  printf("Problem 6: %lu\n",
         ((ns * npo * npo) / 4 - ((2 * n + 1) * n * npo) / 6));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x64,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rsi
imul   -0x20(%rbp),%rsi
imul   -0x20(%rbp),%rsi
shr    $0x2,%rsi
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
imul   -0x10(%rbp),%rax
imul   -0x20(%rbp),%rax
mov    $0x6,%ecx
xor    %edx,%edx
div    %rcx
sub    %rax,%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Problem 6: %lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i32 0, i32* %1
store i64 100, i64* %2
%5 = load i64, i64* %2
%6 = load i64, i64* %2
%7 = mul i64 %5, %6
store i64 %7, i64* %3
%8 = load i64, i64* %2
%9 = add i64 %8, 1
store i64 %9, i64* %4
%10 = load i64, i64* %3
%11 = load i64, i64* %4
%12 = mul i64 %10, %11
%13 = load i64, i64* %4
%14 = mul i64 %12, %13
%15 = udiv i64 %14, 4
%16 = load i64, i64* %2
%17 = mul i64 2, %16
%18 = add i64 %17, 1
%19 = load i64, i64* %2
%20 = mul i64 %18, %19
%21 = load i64, i64* %4
%22 = mul i64 %20, %21
%23 = udiv i64 %22, 6
%24 = sub i64 %15, %23
%25 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Problem 6: %lu\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i64 25164150)
ret i32 0
}
double dminus(double x) { return -x; }


x86 assembly (clang, -O0):
<dminus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dminus>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define double @dminus(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
ret double %4
}

LLVM IR (-O2):
define double @dminus(double %0) {
%2 = fneg double %0
ret double %2
}
int SpawnExecBG(char *arguments[]) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SpawnExecBG(i8** nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
float fabs(float);
float floor(float);
float modfloor(float f, float t) {
  t = fabs(t);
  return (floor(f / t) * t);
}


x86 assembly (clang, -O0):
<modfloor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fabs@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
mulss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modfloor>:
sub    $0x18,%rsp
andps  0xee5(%rip),%xmm1
movaps %xmm1,(%rsp)
divss  %xmm1,%xmm0
call   1030 <floorf@plt>
mulss  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @modfloor(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = call float @fabs(float %5)
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %4
%9 = fdiv float %7, %8
%10 = call float @floor(float %9)
%11 = load float, float* %4
%12 = fmul float %10, %11
ret float %12
}

LLVM IR (-O2):
define float @modfloor(float %0, float %1) {
%3 = tail call float @llvm.fabs.f32(float %1)
%4 = fdiv float %0, %3
%5 = tail call float @llvm.floor.f32(float %4)
%6 = fmul float %3, %5
ret float %6
}
void free_2darr(double **arr, int rows) {
  for (int i = 0; i < rows; i++) {
    free(arr[i]);
  }
  free(arr);
}


x86 assembly (clang, -O0):
<free_2darr>:
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    1151 <free_2darr+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_2darr+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_2darr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <free_2darr+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_2darr+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_2darr(double** nocapture %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 %8
6: ; preds = %8, %2
%7 = bitcast double** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds double*, double** %0, i64 %9
%11 = bitcast double** %10 to i8**
%12 = load i8*, i8** %11
tail call void @free(i8* %12)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ fhandle_printf_e(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ file_unix_getstderr();
void nocc_outerrmsg(char *string) {
  fhandle_printf_e((file_unix_getstderr()), "%s\n", string);
  return;
}


x86 assembly (clang, -O0):
<nocc_outerrmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <file_unix_getstderr@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1040 <fhandle_printf_e@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocc_outerrmsg>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <file_unix_getstderr@plt>
lea    0xece(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fhandle_printf_e@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @nocc_outerrmsg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @file_unix_getstderr()
%4 = load i8*, i8** %2
%5 = call i32 @fhandle_printf_e(i32 %3, 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 @nocc_outerrmsg(i8* %0) {
%2 = tail call i32 (...) @file_unix_getstderr()
%3 = tail call i32 @fhandle_printf_e(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int **malloc(int);
int main() {
  int val[] = {1, 2, 3, 4, 5};
  volatile int **ptr = malloc(sizeof(int *));
  *ptr = &val[1];
  return (*ptr)[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rcx
add    $0x4,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.val = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32**
store i32 0, i32* %1
%4 = bitcast [5 x i32]* %2 to i8*
%5 = call i32** @malloc(i32 8)
store i32** %5, i32*** %3
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%7 = load i32**, i32*** %3
store i32* %6, i32** %7
%8 = load i32**, i32*** %3
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load volatile i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
@__const.main.val = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = tail call i32** @malloc(i32 8)
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 3
%5 = load volatile i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void printAllCodons(char **group, int number) {
  int i = 0;
  for (i = 0; i < number; i++) {
    printf("Codon #%d is %s\n", (i + 1), group[i]);
  }
}


x86 assembly (clang, -O0):
<printAllCodons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
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    1165 <printAllCodons+0x55>
mov    -0x10(%rbp),%esi
add    $0x1,%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <printAllCodons+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAllCodons>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <printAllCodons+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
add    $0x1,%rbx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    %rbx,%r12
jne    1130 <printAllCodons+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Codon #%d is %s\0A\00"
define void @printAllCodons(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 = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 1
%13 = load i8**, i8*** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Codon #%d is %s\0A\00"
define void @printAllCodons(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 ], [ %8, %6 ]
%8 = add nuw nsw i64 %7, 1
%9 = getelementptr inbounds i8*, i8** %0, i64 %7
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = icmp eq i64 %8, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}