xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void doNext(int num) {
  if (num > 1)
    doNext(num - 1);
  printf("%d ", num);
}


x86 assembly (clang, -O0):
<doNext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1140 <doNext+0x20>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <doNext@plt>
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doNext>:
push   %rbx
mov    %edi,%ebx
cmp    $0x2,%edi
jl     1130 <doNext+0x10>
lea    -0x1(%rbx),%edi
call   1040 <doNext@plt>
lea    0xec9(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @doNext(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i32 %0, -1
tail call void @doNext(i32 %4)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct katcp_dispatch {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
store_clear_mode_katcp(struct katcp_dispatch *, int /*<<< orphan*/, void *,
                       void (*)(struct katcp_dispatch *, unsigned int));
void set_clear_state_katcp(struct katcp_dispatch *d, void *p,
                           void (*clear)(struct katcp_dispatch *d,
                                         unsigned int mode)) {
  store_clear_mode_katcp(d, 0, p, clear);
}


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

x86 assembly (clang, -O2):
<set_clear_state_katcp>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <store_clear_mode_katcp@plt>

LLVM IR (-O0):
%struct.katcp_dispatch = type { i32 }
define void @set_clear_state_katcp(%struct.katcp_dispatch* %0, i8* %1, void (%struct.katcp_dispatch*, i32)* %2) {
%4 = alloca %struct.katcp_dispatch*
%5 = alloca i8*
%6 = alloca void (%struct.katcp_dispatch*, i32)*
store %struct.katcp_dispatch* %0, %struct.katcp_dispatch** %4
store i8* %1, i8** %5
store void (%struct.katcp_dispatch*, i32)* %2, void (%struct.katcp_dispatch*, i32)** %6
%7 = load %struct.katcp_dispatch*, %struct.katcp_dispatch** %4
%8 = load i8*, i8** %5
%9 = load void (%struct.katcp_dispatch*, i32)*, void (%struct.katcp_dispatch*, i32)** %6
%10 = call i32 @store_clear_mode_katcp(%struct.katcp_dispatch* %7, i32 0, i8* %8, void (%struct.katcp_dispatch*, i32)* %9)
ret void
}

LLVM IR (-O2):
%struct.katcp_dispatch = type { i32 }
define void @set_clear_state_katcp(%struct.katcp_dispatch* %0, i8* %1, void (%struct.katcp_dispatch*, i32)* %2) {
%4 = tail call i32 @store_clear_mode_katcp(%struct.katcp_dispatch* %0, i32 0, i8* %1, void (%struct.katcp_dispatch*, i32)* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
int ioctl(int, int /*<<< orphan*/);
int cbm_iec_get(int f, int line) {
  return (ioctl(f, _IO(0xcb, 12)) & line) != 0;
}


x86 assembly (clang, -O0):
<cbm_iec_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xcb,%edi
mov    $0xc,%esi
call   1030 <_IO@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbm_iec_get>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xcb,%edi
mov    $0xc,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @cbm_iec_get(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @_IO(i32 203, i32 12)
%7 = call i32 @ioctl(i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %7, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @cbm_iec_get(i32 %0, i32 %1) {
%3 = tail call i32 @_IO(i32 203, i32 12)
%4 = tail call i32 @ioctl(i32 %0, i32 %3)
%5 = and i32 %4, %1
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_93() {
  Assert_real((isqrt(93) == 9),
              "/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/stdlib/isqrt.c",
              470, ("Integer square root of 93 should be 9"));
}


x86 assembly (clang, -O0):
<t_sqrt_93>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5d,%edi
call   1030 <isqrt@plt>
cmp    $0x9,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x1d6,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_93>:
push   %rax
mov    $0x5d,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x9,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x1d6,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 93 should be 9\00"
define void @t_sqrt_93() {
%1 = call i32 @isqrt(i32 93)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 470, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 93 should be 9\00"
define void @t_sqrt_93() {
%1 = tail call i32 @isqrt(i32 93)
%2 = icmp eq i32 %1, 9
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 470, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__12__GeneralIO__makeOutput();
void SensirionSht11LogicP__0__DATA__makeOutput(void) {
  Msp430GpioC__12__GeneralIO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @SensirionSht11LogicP__0__DATA__makeOutput() {
%1 = tail call i32 (...) @Msp430GpioC__12__GeneralIO__makeOutput()
ret void
}
/* Variables and functions */
int partitioning(double *, int, int);
void quick_sort(double array[], int left, int right) {
  if (left < right) {
    int positionOfPivot = partitioning(array, left, right);
    quick_sort(array, left, positionOfPivot - 1);
    quick_sort(array, positionOfPivot + 1, right);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
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 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partitioning@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+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   1030 <partitioning@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @quick_sort(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store double* %0, double** %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 double*, double** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partitioning(double* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load double*, double** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load double*, double** %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 @quick_sort(double* %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 @partitioning(double* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(double* %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
}
int get_random_number_between_0(int and) {
  int r = rand();
  return r % (and+1);
}


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

x86 assembly (clang, -O2):
<get_random_number_between_0>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebx
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @get_random_number_between_0(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = add nsw i32 %0, 1
%4 = srem i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int redirect_output(char *external_buffer) {
  external_buffer[0] = 'A';
  puts("redirect_output ");
  return 0;
}


x86 assembly (clang, -O0):
<redirect_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x41,(%rax)
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"redirect_output \00"
define i32 @redirect_output(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 65, i8* %4
%5 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"redirect_output \00"
define i32 @redirect_output(i8* nocapture writeonly %0) {
store i8 65, i8* %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
char *get_node(void) {
  static char buf[128];
  (void)gethostname(buf, sizeof(buf));
  return (buf);
}


x86 assembly (clang, -O0):
<get_node>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f25(%rip),%rdi
mov    $0x80,%esi
call   1030 <gethostname@plt>
lea    0x2f14(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_node>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <gethostname@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_node.buf = internal global [128 x i8] zeroinitializer
define i8* @get_node() {
%1 = call i32 @gethostname(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_node.buf, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_node.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@get_node.buf = internal global [128 x i8] zeroinitializer
define i8* @get_node() {
%1 = tail call i32 @gethostname(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_node.buf, i64 0, i64 0), i32 128)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_node.buf, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ wDateTimePush(char, int /*<<< orphan*/);
int /*<<< orphan*/ wStackPopDateTime();
void wBuiltinYear() { wDateTimePush('y', wStackPopDateTime()); }


x86 assembly (clang, -O0):
<wBuiltinYear>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wStackPopDateTime@plt>
mov    %eax,%esi
mov    $0x79,%edi
call   1030 <wDateTimePush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBuiltinYear>:
push   %rax
xor    %eax,%eax
call   1040 <wStackPopDateTime@plt>
mov    $0x79,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <wDateTimePush@plt>

LLVM IR (-O0):
define void @wBuiltinYear() {
%1 = call i32 (...) @wStackPopDateTime()
%2 = call i32 @wDateTimePush(i8 signext 121, i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinYear() {
%1 = tail call i32 (...) @wStackPopDateTime()
%2 = tail call i32 @wDateTimePush(i8 signext 121, i32 %1)
ret void
}
__attribute__((visibility("hidden"))) int is_stackable(const int symbology) {
  if (symbology < 53 && symbology != 40) {
    return 1;
  }
  switch (symbology) {
  case 60:
  case 69:
  case 72:
  case 75:
  case 77:
  case 86:
  case 87:
  case 89:
  case 129:
  case 74:
  case 110:
    return 1;
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_stackable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x35,-0x8(%rbp)
jge    1127 <is_stackable+0x27>
cmpl   $0x28,-0x8(%rbp)
je     1127 <is_stackable+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1163 <is_stackable+0x63>
mov    -0x8(%rbp),%eax
add    $0xffffffc4,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x45,%eax
ja     115c <is_stackable+0x5c>
mov    -0x10(%rbp),%rax
lea    0xeb9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    1163 <is_stackable+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_stackable>:
mov    $0x1,%eax
cmp    $0x34,%edi
jg     1110 <is_stackable+0x10>
cmp    $0x28,%edi
je     1110 <is_stackable+0x10>
ret
add    $0xffffffc4,%edi
cmp    $0x45,%edi
ja     1128 <is_stackable+0x28>
lea    0xee1(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
xor    %eax,%eax
ret

LLVM IR (-O0):
define hidden i32 @is_stackable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 53
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 40
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %14
10: ; preds = %6, %1
%11 = load i32, i32* %3
switch i32 %11, label %13 [
i32 60, label %12
i32 69, label %12
i32 72, label %12
i32 75, label %12
i32 77, label %12
i32 86, label %12
i32 87, label %12
i32 89, label %12
i32 129, label %12
i32 74, label %12
i32 110, label %12
]
12: ; preds = %10, %10, %10, %10, %10, %10, %10, %10, %10, %10, %10
store i32 1, i32* %2
br label %14
13: ; preds = %10
store i32 0, i32* %2
br label %14
14: ; preds = %13, %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define hidden i32 @is_stackable(i32 %0) {
%2 = icmp slt i32 %0, 53
%3 = icmp ne i32 %0, 40
%4 = and i1 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
switch i32 %0, label %6 [
i32 60, label %7
i32 69, label %7
i32 72, label %7
i32 75, label %7
i32 77, label %7
i32 86, label %7
i32 87, label %7
i32 89, label %7
i32 129, label %7
i32 74, label %7
i32 110, label %7
]
6: ; preds = %5
br label %7
7: ; preds = %5, %5, %5, %5, %5, %5, %5, %5, %5, %5, %5, %1, %6
%8 = phi i32 [ 0, %6 ], [ 1, %1 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ], [ 1, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  while (1) {
    int a;
    scanf("%d", &a);
    if (a == 42)
      break;
    else
      printf("%d\n", a);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2a,-0x8(%rbp)
jne    114e <main+0x2e>
jmp    1162 <main+0x42>
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
je     117c <main+0x5c>
lea    0xeb9(%rip),%r14
lea    0xeaf(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
cmp    $0x2a,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 42
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 42
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x0d() {
  Assert_real((isodigit(13) == 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_isodigit.c",
              70, ("isodigit should be 0 for 0x0d"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x0d>:
push   %rax
mov    $0xd,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x46,%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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x0d\00"
define void @t_isodigit_0x0d() {
%1 = call i64 @isodigit(i32 13)
%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 70, 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x0d\00"
define void @t_isodigit_0x0d() {
%1 = tail call i64 @isodigit(i32 13)
%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 70, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char);
int print_str(char *s) {
  char *start = s;
  while (*s) {
    print_char(*s);
    s++;
  }
  return s - start;
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <print_str+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <print_char@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <print_str+0x14>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
mov    %rdi,%rbx
test   %al,%al
je     1144 <print_str+0x34>
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <print_char@plt>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_str+0x20>
sub    %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @print_str(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @print_char(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i8* [ %0, %1 ], [ %8, %4 ]
%13 = ptrtoint i8* %12 to i64
%14 = ptrtoint i8* %0 to i64
%15 = sub i64 %13, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}
/* Variables and functions */
int execs_common(char const *, char const *, char *const *, char *);
int /*<<< orphan*/ strlen(char const *);
int execse(const char *path, const char *args, char *const envp[]) {
  char buf[strlen(args) + 1];
  return execs_common(path, args, envp, buf);
}


x86 assembly (clang, -O0):
<execse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <execs_common@plt>
mov    -0x20(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execse>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <execs_common@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @execse(i8* %0, i8* %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8** %2, i8*** %6
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %7
%14 = alloca i8, i64 %12
store i64 %12, i64* %8
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i8**, i8*** %6
%18 = call i32 @execs_common(i8* %15, i8* %16, i8** %17, i8* %14)
%19 = load i8*, i8** %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @execse(i8* %0, i8* %1, i8** %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, 1
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = call i32 @execs_common(i8* %0, i8* %1, i8** %2, i8* %7)
ret i32 %8
}
void RTVfsIoStrmSgRead(void) {}


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

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

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

LLVM IR (-O2):
define void @RTVfsIoStrmSgRead() {
ret void
}
double mulr(double a, double b, double c, double d) { return a * c - b * d; }


x86 assembly (clang, -O0):
<mulr>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mulr>:
mulsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mulr(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %7
%11 = load double, double* %6
%12 = load double, double* %8
%13 = fmul double %11, %12
%14 = fneg double %13
%15 = call double @llvm.fmuladd.f64(double %9, double %10, double %14)
ret double %15
}

LLVM IR (-O2):
define double @mulr(double %0, double %1, double %2, double %3) {
%5 = fneg double %1
%6 = fmul double %5, %3
%7 = tail call double @llvm.fmuladd.f64(double %0, double %2, double %6)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void spin(char *func_name) {
  printf("\n\nspining in %s%s", func_name);
  while (1) {
  }
}


x86 assembly (clang, -O0):
<spin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    112c <spin+0x1c>

x86 assembly (clang, -O2):
<spin>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1120 <spin+0x10>

LLVM IR (-O0):
@.str = [18 x i8] c"\0A\0Aspining in %s%s\00"
define void @spin(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0A\0Aspining in %s%s\00"
define void @spin(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void not_reg32(unsigned int reg32) {
  put8(0xF7);
  put8(0xD0 + reg32);
}


x86 assembly (clang, -O0):
<not_reg32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xd0,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_reg32>:
push   %rbx
mov    %edi,%ebx
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xd0,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @not_reg32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 247)
%4 = load i32, i32* %2
%5 = add i32 208, %4
%6 = call i32 @put8(i32 %5)
ret void
}

LLVM IR (-O2):
define void @not_reg32(i32 %0) {
%2 = tail call i32 @put8(i32 247)
%3 = add i32 %0, 208
%4 = tail call i32 @put8(i32 %3)
ret void
}
/* Type definitions */
struct pc_temp_ocv_lut {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int interpolate_pc(struct pc_temp_ocv_lut *pc_temp_ocv, int batt_temp_degc,
                   int ocv) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<interpolate_pc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ec9(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate_pc>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.pc_temp_ocv_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_pc(%struct.pc_temp_ocv_lut* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pc_temp_ocv_lut*
%5 = alloca i32
%6 = alloca i32
store %struct.pc_temp_ocv_lut* %0, %struct.pc_temp_ocv_lut** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.pc_temp_ocv_lut = type { i32 }
@EINVAL = global i32 0
define i32 @interpolate_pc(%struct.pc_temp_ocv_lut* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
void gtk_window_propagate_key_event() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_propagate_key_event() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f21(long j) {
  if ((j & ((1UL << (21)) - 1)) >= ((1UL << ((21) - 1)) + 2))
    abort();
}


x86 assembly (clang, -O0):
<f21>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x1fffff,%rax
cmp    $0x100002,%rax
jb     1139 <f21+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f21>:
and    $0x1ffffe,%edi
cmp    $0x100002,%edi
jae    111f <f21+0xf>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f21(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 2097151
%5 = icmp uge i64 %4, 1048578
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @f21(i64 %0) {
%2 = and i64 %0, 2097150
%3 = icmp ugt i64 %2, 1048577
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret void
}
/* Variables and functions */
char *piece_replace(char *, char, char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void test_piece_replace(void) {
  char str[100];
  strcpy(str, "zero,one,two,three,four");
  printf("should be zero,one,two,nine,four: is = %s\n",
         piece_replace(str, ',', "nine", 3));
}


x86 assembly (clang, -O0):
<test_piece_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x70(%rbp),%rdi
lea    0xebd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x2c,%esi
lea    0xeeb(%rip),%rdx
mov    $0x3,%ecx
call   1050 <piece_replace@plt>
mov    %rax,%rsi
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_piece_replace>:
push   %rbx
sub    $0x70,%rsp
lea    0xec4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xef5(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    $0x3,%ecx
call   1050 <piece_replace@plt>
lea    0xeb1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"zero,one,two,three,four\00"
@.str.1 = [43 x i8] c"should be zero,one,two,nine,four: is = %s\0A\00"
@.str.2 = [5 x i8] c"nine\00"
define void @test_piece_replace() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i8* @piece_replace(i8* %4, i8 signext 44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 3)
%6 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"zero,one,two,three,four\00"
@.str.1 = [43 x i8] c"should be zero,one,two,nine,four: is = %s\0A\00"
@.str.2 = [5 x i8] c"nine\00"
define void @test_piece_replace() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @piece_replace(i8* %2, i8 signext 44, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 3)
%5 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nocc_warning(char *, char const *);
int extn_loadextn(const char *fname) {
  nocc_warning("cannot load extension [%s], no dynamic library support", fname);
  return 0;
}


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

x86 assembly (clang, -O2):
<extn_loadextn>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <nocc_warning@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"cannot load extension [%s], no dynamic library support\00"
define i32 @extn_loadextn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @nocc_warning(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"cannot load extension [%s], no dynamic library support\00"
define i32 @extn_loadextn(i8* %0) {
%2 = tail call i32 @nocc_warning(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
double round(double);
double remround(double a, double d) {
  double carry = round(a / d);
  return a - carry * d;
}


x86 assembly (clang, -O0):
<remround>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <round@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remround>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
divsd  %xmm1,%xmm0
call   1030 <round@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @remround(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
%9 = call double @llvm.round.f64(double %8)
store double %9, double* %5
%10 = load double, double* %3
%11 = load double, double* %5
%12 = load double, double* %4
%13 = fneg double %11
%14 = call double @llvm.fmuladd.f64(double %13, double %12, double %10)
ret double %14
}

LLVM IR (-O2):
define double @remround(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.round.f64(double %3)
%5 = fneg double %4
%6 = tail call double @llvm.fmuladd.f64(double %5, double %1, double %0)
ret double %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ch(uint32_t x, uint32_t y, uint32_t z) { return (x & y) ^ (~x & z); }


x86 assembly (clang, -O0):
<ch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0xc(%rbp),%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch>:
mov    %esi,%eax
xor    %edx,%eax
and    %edi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @ch(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %7, %8
%10 = load i32, i32* %4
%11 = xor i32 %10, -1
%12 = load i32, i32* %6
%13 = and i32 %11, %12
%14 = xor i32 %9, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ch(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, %0
%5 = xor i32 %0, -1
%6 = and i32 %5, %2
%7 = or i32 %6, %4
ret i32 %7
}
int getRangeEnd(int rStart, int p, int s) { return rStart + s / p - 1; }


x86 assembly (clang, -O0):
<getRangeEnd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRangeEnd>:
mov    %edx,%eax
cltd
idiv   %esi
add    %edi,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @getRangeEnd(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
%11 = add nsw i32 %7, %10
%12 = sub nsw i32 %11, 1
ret i32 %12
}

LLVM IR (-O2):
define i32 @getRangeEnd(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %2, %1
%5 = add i32 %0, -1
%6 = add i32 %5, %4
ret i32 %6
}
void foo(char *x) { x[0] = 0; }


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

x86 assembly (clang, -O2):
<foo>:
movb   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @foo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
ret void
}

LLVM IR (-O2):
define void @foo(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
int ikibul(int y) {
  int basamak, ikisayisi = 0;
  while (y > 0) {
    basamak = y % 10;
    y /= 10;
    if (basamak == 2) {
      ikisayisi++;
    }
  }
  return ikisayisi;
}


x86 assembly (clang, -O0):
<ikibul>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    114c <ikibul+0x4c>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1147 <ikibul+0x47>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <ikibul+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ikibul>:
xor    %eax,%eax
test   %edi,%edi
jle    1138 <ikibul+0x38>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
imul   $0xcccccccd,%edi,%esi
add    $0x66666666,%esi
ror    %esi
cmp    $0x1999999a,%esi
adc    $0x0,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <ikibul+0x10>
ret

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

LLVM IR (-O2):
define i32 @ikibul(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %12
3: ; preds = %1, %3
%4 = phi i32 [ %10, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = udiv i32 %5, 10
%8 = icmp eq i32 %6, 2
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %4, %9
%11 = icmp ult i32 %5, 10
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %10, %3 ]
ret i32 %13
}
int test_imm_76uint16_reg(unsigned short val) {
  return ((val) & (0x76 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_76uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x76,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_76uint16_reg>:
test   $0x76,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_76uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 118
%6 = icmp ne i32 %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_76uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 118
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *calloc(size_t, int);
void *CallocWrapper_(size_t size) { return calloc(size, 1); }


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

x86 assembly (clang, -O2):
<CallocWrapper_>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @CallocWrapper_(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @calloc(i64 %3, i32 1)
ret i8* %4
}

LLVM IR (-O2):
define i8* @CallocWrapper_(i64 %0) {
%2 = tail call i8* @calloc(i64 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void SAR_B_IMM(int reg, int count) {
  addbyte(0xc0);
  addbyte(0xc0 | reg | 0x38);
  addbyte(count);
}


x86 assembly (clang, -O0):
<SAR_B_IMM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xc0,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
or     $0xc0,%edi
or     $0x38,%edi
call   1030 <addbyte@plt>
mov    -0x8(%rbp),%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SAR_B_IMM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0xc0,%edi
call   1030 <addbyte@plt>
or     $0xf8,%ebp
mov    %ebp,%edi
call   1030 <addbyte@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @SAR_B_IMM(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @addbyte(i32 192)
%6 = load i32, i32* %3
%7 = or i32 192, %6
%8 = or i32 %7, 56
%9 = call i32 @addbyte(i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @addbyte(i32 %10)
ret void
}

LLVM IR (-O2):
define void @SAR_B_IMM(i32 %0, i32 %1) {
%3 = tail call i32 @addbyte(i32 192)
%4 = or i32 %0, 248
%5 = tail call i32 @addbyte(i32 %4)
%6 = tail call i32 @addbyte(i32 %1)
ret void
}
int f(int *restrict p, int *restrict q) { return 5; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i32* noalias nocapture readnone %0, i32* noalias nocapture readnone %1) {
ret i32 5
}
int codigoRecebimentoInvalido(const int codigoRecebimento) {
  return codigoRecebimento < 0;
}


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

x86 assembly (clang, -O2):
<codigoRecebimentoInvalido>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

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

LLVM IR (-O2):
define i32 @codigoRecebimentoInvalido(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
int pwm_config(struct pwm_device *pwm, unsigned duty_us, unsigned period_us) {
  return 0;
}


x86 assembly (clang, -O0):
<pwm_config>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.pwm_device = type opaque
define i32 @pwm_config(%struct.pwm_device* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pwm_device*
%5 = alloca i32
%6 = alloca i32
store %struct.pwm_device* %0, %struct.pwm_device** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.pwm_device = type opaque
define i32 @pwm_config(%struct.pwm_device* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}