xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/
google_map_output_selectable_map_thumbtack(int /*<<< orphan*/ *, char *, double,
                                           double);
void google_map_station_output_selectable_station(FILE *output_file,
                                                  char *station,
                                                  double longitude,
                                                  double latitude) {
  google_map_output_selectable_map_thumbtack(output_file, station, latitude,
                                             longitude);
}


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

x86 assembly (clang, -O2):
<google_map_station_output_selectable_station>:
movaps %xmm0,%xmm2
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
jmp    1030 <google_map_output_selectable_map_thumbtack@plt>

LLVM IR (-O0):
define void @google_map_station_output_selectable_station(i32* %0, i8* %1, double %2, double %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca double
%8 = alloca double
store i32* %0, i32** %5
store i8* %1, i8** %6
store double %2, double* %7
store double %3, double* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = load double, double* %8
%12 = load double, double* %7
%13 = call i32 @google_map_output_selectable_map_thumbtack(i32* %9, i8* %10, double %11, double %12)
ret void
}

LLVM IR (-O2):
define void @google_map_station_output_selectable_station(i32* %0, i8* %1, double %2, double %3) {
%5 = tail call i32 @google_map_output_selectable_map_thumbtack(i32* %0, i8* %1, double %3, double %2)
ret void
}
/* Variables and functions */
double exp(double);
double dAUX1bp2b(double x) { return -2.0 * (1 + x) * exp(x); }


x86 assembly (clang, -O0):
<dAUX1bp2b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
movsd  0xece(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dAUX1bp2b>:
push   %rax
movsd  0xee7(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  0xee3(%rip),%xmm1
movsd  %xmm1,(%rsp)
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dAUX1bp2b(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double 1.000000e+00, %3
%5 = fmul double -2.000000e+00, %4
%6 = load double, double* %2
%7 = call double @exp(double %6)
%8 = fmul double %5, %7
ret double %8
}

LLVM IR (-O2):
define double @dAUX1bp2b(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = fmul double %2, -2.000000e+00
%4 = tail call double @exp(double %0)
%5 = fmul double %3, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ SendInterrupt(int, int, int, int);
void ScuSendExternalInterrupt04(void) {
  SendInterrupt(0x54, 0x4, 0x8000, 0x00100000);
}


x86 assembly (clang, -O0):
<ScuSendExternalInterrupt04>:
push   %rbp
mov    %rsp,%rbp
mov    $0x54,%edi
mov    $0x4,%esi
mov    $0x8000,%edx
mov    $0x100000,%ecx
call   1030 <SendInterrupt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScuSendExternalInterrupt04>:
mov    $0x54,%edi
mov    $0x4,%esi
mov    $0x8000,%edx
mov    $0x100000,%ecx
jmp    1030 <SendInterrupt@plt>

LLVM IR (-O0):
define void @ScuSendExternalInterrupt04() {
%1 = call i32 @SendInterrupt(i32 84, i32 4, i32 32768, i32 1048576)
ret void
}

LLVM IR (-O2):
define void @ScuSendExternalInterrupt04() {
%1 = tail call i32 @SendInterrupt(i32 84, i32 4, i32 32768, i32 1048576)
ret void
}
long long szuu() { return 0xffff00007fff7fffLL; }


x86 assembly (clang, -O0):
<szuu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff00007fff7fff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<szuu>:
movabs $0xffff00007fff7fff,%rax
ret

LLVM IR (-O0):
define i64 @szuu() {
ret i64 -281472829259777
}

LLVM IR (-O2):
define i64 @szuu() {
ret i64 -281472829259777
}
char *ini_lskip(char *s) {
  while (*s && ({
    int c = (*s);
    !!((c >= '\t' && c <= '\r') || c == ' ');
  }))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<ini_lskip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1163 <ini_lskip+0x63>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jl     1140 <ini_lskip+0x40>
mov    $0x1,%al
cmpl   $0xd,-0xc(%rbp)
mov    %al,-0x12(%rbp)
jle    114a <ini_lskip+0x4a>
cmpl   $0x20,-0xc(%rbp)
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1173 <ini_lskip+0x73>
jmp    1184 <ini_lskip+0x84>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ini_lskip+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ini_lskip>:
mov    %rdi,%rax
jmp    1114 <ini_lskip+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
lea    -0x9(%rcx),%edx
cmp    $0x5,%dl
jb     1110 <ini_lskip+0x10>
cmp    $0x20,%cl
je     1110 <ini_lskip+0x10>
ret

LLVM IR (-O0):
define i8* @ini_lskip(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
br label %5
5: ; preds = %31, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 9
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 13
br i1 %18, label %22, label %19
19: ; preds = %16, %10
%20 = load i32, i32* %3
%21 = icmp eq i32 %20, 32
br label %22
22: ; preds = %19, %16
%23 = phi i1 [ true, %16 ], [ %21, %19 ]
%24 = xor i1 %23, true
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
store i32 %26, i32* %4
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 0
br label %29
29: ; preds = %22, %5
%30 = phi i1 [ false, %5 ], [ %28, %22 ]
br i1 %30, label %31, label %34
31: ; preds = %29
%32 = load i8*, i8** %2
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %2
br label %5
34: ; preds = %29
%35 = load i8*, i8** %2
ret i8* %35
}

LLVM IR (-O2):
define i8* @ini_lskip(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %7 [
i8 9, label %5
i8 32, label %5
i8 13, label %5
i8 12, label %5
i8 11, label %5
i8 10, label %5
]
5: ; preds = %2, %2, %2, %2, %2, %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ motorSet(int, int);
void intakeIn() {
  motorSet(5, -127);
  motorSet(6, 127);
}


x86 assembly (clang, -O0):
<intakeIn>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
mov    $0xffffff81,%esi
call   1030 <motorSet@plt>
mov    $0x6,%edi
mov    $0x7f,%esi
call   1030 <motorSet@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intakeIn>:
push   %rax
mov    $0x5,%edi
mov    $0xffffff81,%esi
call   1030 <motorSet@plt>
mov    $0x6,%edi
mov    $0x7f,%esi
pop    %rax
jmp    1030 <motorSet@plt>

LLVM IR (-O0):
define void @intakeIn() {
%1 = call i32 @motorSet(i32 5, i32 -127)
%2 = call i32 @motorSet(i32 6, i32 127)
ret void
}

LLVM IR (-O2):
define void @intakeIn() {
%1 = tail call i32 @motorSet(i32 5, i32 -127)
%2 = tail call i32 @motorSet(i32 6, i32 127)
ret void
}
/* Variables and functions */
int Partition(int *, int, int);
void Quicksort(int A[], int p, int r) {
  if (p < r) {
    int q = Partition(A, p, r);
    Quicksort(A, p, q - 1);
    Quicksort(A, q + 1, r);
  }
}


x86 assembly (clang, -O0):
<Quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <Quicksort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <Quicksort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <Quicksort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Quicksort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <Quicksort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <Quicksort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <Quicksort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Quicksort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @Quicksort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
void moveDown(int *x, int *y) { (*y)++; }


x86 assembly (clang, -O0):
<moveDown>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveDown>:
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
define void @moveDown(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %5
ret void
}

LLVM IR (-O2):
define void @moveDown(i32* nocapture readnone %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
ret void
}
void fcn5() {
  int count, other;
  for (count = 0; count < 100; count += 3) {
    other = count % (count + 5);
    other /= count * (count * count * count);
  }
}


x86 assembly (clang, -O0):
<fcn5>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    114c <fcn5+0x4c>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
imul   %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <fcn5+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @fcn5() {
ret void
}
int pathcon_nm3_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @pathcon_nm3_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @pathcon_nm3_n_out() {
ret i32 2
}
void fc36(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      goto a;
    a:
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

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

LLVM IR (-O2):
define void @fc36(i32 %0) {
ret void
}
double df(double x) { return (1.0 - x) * x; }


x86 assembly (clang, -O0):
<df>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<df>:
movsd  0xef8(%rip),%xmm1
subsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @df(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @df(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fmul double %2, %0
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int eeprom_read_byte(int /*<<< orphan*/ *);
uint16_t eeconfig_read_keymap(void) {
  return (eeprom_read_byte((uint8_t *)4) |
          (eeprom_read_byte((uint8_t *)33) << 8));
}


x86 assembly (clang, -O0):
<eeconfig_read_keymap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1030 <eeprom_read_byte@plt>
mov    %eax,-0x4(%rbp)
mov    $0x21,%edi
call   1030 <eeprom_read_byte@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_read_keymap>:
push   %rbx
mov    $0x4,%edi
call   1030 <eeprom_read_byte@plt>
mov    %eax,%ebx
mov    $0x21,%edi
call   1030 <eeprom_read_byte@plt>
shl    $0x8,%eax
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @eeconfig_read_keymap() {
%1 = call i32 @eeprom_read_byte(i32* inttoptr (i64 4 to i32*))
%2 = call i32 @eeprom_read_byte(i32* inttoptr (i64 33 to i32*))
%3 = shl i32 %2, 8
%4 = or i32 %1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @eeconfig_read_keymap() {
%1 = tail call i32 @eeprom_read_byte(i32* inttoptr (i64 4 to i32*))
%2 = tail call i32 @eeprom_read_byte(i32* inttoptr (i64 33 to i32*))
%3 = shl i32 %2, 8
%4 = or i32 %3, %1
ret i32 %4
}
void diff_dc(int num_pixel, int dct_quant[]) {
  int i;
  int last = dct_quant[0];
  for (i = 64; i < num_pixel; i += 64) {
    dct_quant[i] -= last;
    last += dct_quant[i];
  }
}


x86 assembly (clang, -O0):
<diff_dc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movl   $0x40,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1159 <diff_dc+0x59>
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
sub    %esi,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <diff_dc+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<diff_dc>:
cmp    $0x41,%edi
jl     1125 <diff_dc+0x25>
mov    (%rsi),%edx
mov    %edi,%r8d
mov    $0x40,%ecx
nop
mov    (%rsi,%rcx,4),%eax
mov    %eax,%edi
sub    %edx,%edi
mov    %edi,(%rsi,%rcx,4)
add    $0x40,%rcx
mov    %eax,%edx
cmp    %r8,%rcx
jb     1110 <diff_dc+0x10>
ret

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

LLVM IR (-O2):
define void @diff_dc(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 64
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = load i32, i32* %1
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 64, %4 ], [ %13, %7 ]
%9 = phi i32 [ %5, %4 ], [ %11, %7 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %8
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, %9
store i32 %12, i32* %10
%13 = add nuw nsw i64 %8, 64
%14 = icmp ult i64 %13, %6
br i1 %14, label %7, label %15
15: ; preds = %7, %2
ret void
}
int wip_cm_calc_divi(float div) { return (int)div; }


x86 assembly (clang, -O0):
<wip_cm_calc_divi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wip_cm_calc_divi>:
cvttss2si %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @wip_cm_calc_divi(float %0) {
%2 = fptosi float %0 to i32
ret i32 %2
}
unsigned int f74(unsigned int x, unsigned long int y) {
  return (x << y) + (x >> ((-y) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f74>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shr    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f74>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f74(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
%8 = shl i32 %5, %7
%9 = load i32, i32* %3
%10 = load i64, i64* %4
%11 = sub i64 0, %10
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = lshr i32 %9, %13
%15 = add i32 %8, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f74(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl i32 %0, %3
%5 = sub i32 0, %3
%6 = and i32 %5, 31
%7 = lshr i32 %0, %6
%8 = add i32 %7, %4
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void output_line(char *line) { printf("%s\n", line); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @output_line(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int multiply(int, int);
int multiply_recursive(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  int x = 6, y = 13;
  int s1 = multiply(x, y);
  printf("%d x %d = %d\n\n", x, y, s1);
  int s2 = multiply_recursive(x, y);
  printf("%d x %d = %d\n", x, y, s2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x6,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <multiply@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <multiply_recursive@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x6,%edi
mov    $0xd,%esi
call   1030 <multiply@plt>
lea    0xeb9(%rip),%rdi
mov    $0x6,%esi
mov    $0xd,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
mov    $0x6,%edi
mov    $0xd,%esi
call   1050 <multiply_recursive@plt>
lea    0xea1(%rip),%rdi
mov    $0x6,%esi
mov    $0xd,%edx
mov    %eax,%ecx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%d x %d = %d\0A\0A\00"
@.str.1 = [14 x i8] c"%d x %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 6, i32* %1
store i32 13, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @multiply(i32 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @multiply_recursive(i32 %12, i32 %13)
store i32 %14, i32* %4
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%d x %d = %d\0A\0A\00"
@.str.1 = [14 x i8] c"%d x %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @multiply(i32 6, i32 13)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 6, i32 13, i32 %1)
%3 = tail call i32 @multiply_recursive(i32 6, i32 13)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 13, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Sys_SetFPCW();
void Sys_Init(void) { Sys_SetFPCW(); }


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

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

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

LLVM IR (-O2):
define void @Sys_Init() {
%1 = tail call i32 (...) @Sys_SetFPCW()
ret void
}
int fun1331() { return 1331; }


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

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

LLVM IR (-O0):
define i32 @fun1331() {
ret i32 1331
}

LLVM IR (-O2):
define i32 @fun1331() {
ret i32 1331
}
/* Variables and functions */
int(Memento_check)(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Memento_check() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __inc_remove_counter();
int __renameatx_np(int, char const *, int, char const *, unsigned int);
int renameatx_np(int oldfd, const char *old, int newfd, const char *new,
                 unsigned int flags) {
  int res = __renameatx_np(oldfd, old, newfd, new, flags);
  if (res == 0) {
    __inc_remove_counter();
  }
  return res;
}


x86 assembly (clang, -O0):
<renameatx_np>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <__renameatx_np@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    1165 <renameatx_np+0x45>
mov    $0x0,%al
call   1040 <__inc_remove_counter@plt>
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<renameatx_np>:
push   %rbx
call   1030 <__renameatx_np@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1133 <renameatx_np+0x13>
xor    %eax,%eax
call   1040 <__inc_remove_counter@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @renameatx_np(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @__renameatx_np(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 (...) @__inc_remove_counter()
br label %10
10: ; preds = %8, %5
ret i32 %6
}
void asn1StoreTag(unsigned char **Ref, unsigned short Tag) {
  if ((Tag & 0x1F00) == 0x1F00)
    *(*Ref)++ = Tag >> 8;
  *(*Ref)++ = Tag & 0xFF;
}


x86 assembly (clang, -O0):
<asn1StoreTag>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0x1f00,%eax
cmp    $0x1f00,%eax
jne    113f <asn1StoreTag+0x3f>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1StoreTag>:
mov    %esi,%eax
mov    %esi,%ecx
not    %ecx
test   $0x1f00,%ecx
jne    111a <asn1StoreTag+0x1a>
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %ah,(%rcx)
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @asn1StoreTag(i8** %0, i16 zeroext %1) {
%3 = alloca i8**
%4 = alloca i16
store i8** %0, i8*** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 7936
%8 = icmp eq i32 %7, 7936
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
%12 = ashr i32 %11, 8
%13 = trunc i32 %12 to i8
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %14
store i8 %13, i8* %15
br label %17
17: ; preds = %9, %2
%18 = load i16, i16* %4
%19 = zext i16 %18 to i32
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8**, i8*** %3
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %22
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @asn1StoreTag(i8** nocapture %0, i16 zeroext %1) {
%3 = and i16 %1, 7936
%4 = icmp eq i16 %3, 7936
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = lshr i16 %1, 8
%7 = trunc i16 %6 to i8
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
store i8 %7, i8* %8
br label %10
10: ; preds = %5, %2
%11 = trunc i16 %1 to i8
%12 = load i8*, i8** %0
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %0
store i8 %11, i8* %12
ret void
}
int returnInt() { return 42; }


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

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

LLVM IR (-O0):
define i32 @returnInt() {
ret i32 42
}

LLVM IR (-O2):
define i32 @returnInt() {
ret i32 42
}
/* Variables and functions */
unsigned long crcsum(unsigned char *, unsigned long, int);
void crcappend(unsigned char *message, unsigned long length) {
  unsigned long crc;
  crc = crcsum(message, length, 0xFFFF);
  message[length] = (unsigned char)(crc & 0xff);
  message[length + 1] = (unsigned char)((crc >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<crcappend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffff,%edx
call   1030 <crcsum@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %dl,0x1(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crcappend>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0xffff,%edx
call   1030 <crcsum@plt>
mov    %ax,(%rbx,%r14,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @crcappend(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i64 @crcsum(i8* %6, i64 %7, i32 65535)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = and i64 %9, 255
%11 = trunc i64 %10 to i8
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 %11, i8* %14
%15 = load i64, i64* %5
%16 = lshr i64 %15, 8
%17 = and i64 %16, 255
%18 = trunc i64 %17 to i8
%19 = load i8*, i8** %3
%20 = load i64, i64* %4
%21 = add i64 %20, 1
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 %18, i8* %22
ret void
}

LLVM IR (-O2):
define void @crcappend(i8* %0, i64 %1) {
%3 = tail call i64 @crcsum(i8* %0, i64 %1, i32 65535)
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 %1
store i8 %4, i8* %5
%6 = lshr i64 %3, 8
%7 = trunc i64 %6 to i8
%8 = add i64 %1, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %7, i8* %9
ret void
}
/* Variables and functions */
bool set_stone(char *br, char stone, int pos) {
  if (*(br + pos) == ' ') {
    *(br + pos) = stone;
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<set_stone>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1140 <set_stone+0x40>
mov    -0x11(%rbp),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
movl   $0x1,-0x4(%rbp)
jmp    1147 <set_stone+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_stone>:
movslq %edx,%rcx
xor    %eax,%eax
cmpb   $0x20,(%rdi,%rcx,1)
jne    1114 <set_stone+0x14>
mov    %sil,(%rdi,%rcx,1)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @set_stone(i8* nocapture %0, i8 signext %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 32
br i1 %7, label %8, label %9
8: ; preds = %3
store i8 %1, i8* %5
br label %9
9: ; preds = %3, %8
%10 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int testfunc(int arg1, int arg2) {
  printf("Hello. arg1 = %d, arg2 = %d\n", arg1, arg2);
}


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

x86 assembly (clang, -O2):
<testfunc>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Hello. arg1 = %d, arg2 = %d\0A\00"
define i32 @testfunc(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 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@.str = [29 x i8] c"Hello. arg1 = %d, arg2 = %d\0A\00"
define i32 @testfunc(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void test_non_identifiers() {
  int i, x;
#pragma omp parallel sections;
  { foo(); }
#pragma omp parallel sections linear(x);
  { foo(); }
#pragma omp parallel sections private(x);
  { foo(); }
#pragma omp parallel sections, private(x);
  { foo(); }
}


x86 assembly (clang, -O0):
<test_non_identifiers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_non_identifiers>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_non_identifiers() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @foo()
%4 = call i32 (...) @foo()
%5 = call i32 (...) @foo()
%6 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @test_non_identifiers() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
ret void
}
/* Variables and functions */
long lmin(long, long);
long lmina(long a[], int length) {
  long min = a[0];
  int i;
  for (i = 0; i < length; i++) {
    min = lmin(min, a[i]);
  }
  return min;
}


x86 assembly (clang, -O0):
<lmina>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <lmina+0x54>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
call   1030 <lmin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <lmina+0x21>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmina>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%rax
test   %esi,%esi
jle    1155 <lmina+0x45>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %rax,%rdi
mov    %rax,%rsi
call   1030 <lmin@plt>
cmp    $0x1,%ebp
je     1155 <lmina+0x45>
mov    %ebp,%ebp
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rsi
mov    %rax,%rdi
call   1030 <lmin@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <lmina+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @lmina(i64* nocapture %0, i32 %1) {
%3 = load i64, i64* %0
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = zext i32 %1 to i64
%7 = tail call i64 @lmin(i64 %3, i64 %3)
%8 = icmp eq i32 %1, 1
br i1 %8, label %17, label %9
9: ; preds = %5, %9
%10 = phi i64 [ %15, %9 ], [ 1, %5 ]
%11 = phi i64 [ %14, %9 ], [ %7, %5 ]
%12 = getelementptr inbounds i64, i64* %0, i64 %10
%13 = load i64, i64* %12
%14 = tail call i64 @lmin(i64 %11, i64 %13)
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %17, label %9
17: ; preds = %9, %5, %2
%18 = phi i64 [ %3, %2 ], [ %7, %5 ], [ %14, %9 ]
ret i64 %18
}
void qtui_dummy_function(void) {}


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

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

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

LLVM IR (-O2):
define void @qtui_dummy_function() {
ret void
}
int sgs_getoct(char c) { return c - '0'; }


x86 assembly (clang, -O0):
<sgs_getoct>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgs_getoct>:
lea    -0x30(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sgs_getoct(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 48
ret i32 %5
}

LLVM IR (-O2):
define i32 @sgs_getoct(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -48
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xf8() {
  Assert_real((isbdigit(248) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              1245, ("isbdigit should be 0 for 0xf8"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xf8>:
push   %rax
mov    $0xf8,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x4dd,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xf8\00"
define void @t_isbdigit_0xf8() {
%1 = tail call i64 @isbdigit(i32 248)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1245, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rfs__client_start();
void rfs_init(void) { rfs__client_start(); }


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

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

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

LLVM IR (-O2):
define void @rfs_init() {
%1 = tail call i32 (...) @rfs__client_start()
ret void
}
/* Variables and functions */
int f(int /*<<< orphan*/);
int main() { return f(0); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int init_driver() {
  fprintf(stderr, "weeee from driver\n");
  return 0;
}


x86 assembly (clang, -O0):
<init_driver>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"weeee from driver\0A\00"
define i32 @init_driver() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"weeee from driver\0A\00"
define i32 @init_driver() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void prompt(void) { printf("> "); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"> \00"
define void @prompt() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int ltrim(float x) { return ((x >= 0.5f) ? 1 : 0) - ((x < -0.5f) ? 1 : 0); }


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomiss %xmm1,%xmm0
cmovae %ecx,%eax
movss  -0x4(%rbp),%xmm1
movss  0xed0(%rip),%xmm0
xor    %ecx,%ecx
mov    $0x1,%edx
ucomiss %xmm1,%xmm0
cmova  %edx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
setae  %al
movss  0xef0(%rip),%xmm1
xor    %ecx,%ecx
ucomiss %xmm0,%xmm1
seta   %cl
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ltrim(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oge float %3, 5.000000e-01
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
%7 = load float, float* %2
%8 = fcmp olt float %7, -5.000000e-01
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = sub nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @ltrim(float %0) {
%2 = fcmp oge float %0, 5.000000e-01
%3 = zext i1 %2 to i32
%4 = fcmp olt float %0, -5.000000e-01
%5 = sext i1 %4 to i32
%6 = add nsw i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ output_with_tab(char *);
void gen_def_word(void) { output_with_tab(".dw "); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c".dw \00"
define void @gen_def_word() {
%1 = call i32 @output_with_tab(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".dw \00"
define void @gen_def_word() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_91uint8_mem(unsigned char *val) {
  return ((*val) & (0x91 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_91uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -111
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}