xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ block(int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  block((scanf("%d", &n), n));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1040 <block@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <block@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
%4 = call i32 @block(i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = call i32 @block(i32 %4)
ret i32 0
}
void RTCrc32Start(void) {}


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

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

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

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

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ led_mask;
};
typedef TYPE_1__ XKeyboardState;

/* Variables and functions */
unsigned long get_XKeyboardState_led_mask(void *_p) {
  return (unsigned long)((XKeyboardState *)_p)->led_mask;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XKeyboardState_led_mask(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
int is_branch_absolute(const unsigned int instr) {
  if (instr & 0x2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_branch_absolute>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1122 <is_branch_absolute+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1129 <is_branch_absolute+0x29>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_branch_absolute>:
mov    %edi,%eax
shr    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_branch_absolute(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1
ret i32 %3
}
int sign(int i) {
  if (i < 0)
    return -1;
  if (i > 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <sign+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    113a <sign+0x3a>
cmpl   $0x0,-0x8(%rbp)
jle    1133 <sign+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <sign+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @sign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
int iabs(int x) {
  static const int INT_BITS = (sizeof(int) * 8) - 1;
  int y = x >> INT_BITS;
  return (x ^ y) - y;
}


x86 assembly (clang, -O0):
<iabs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@iabs.INT_BITS = internal constant i32 31
define i32 @iabs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @iabs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGINT;
scalar_t__ foreground_pgid();
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
void interrupt_handler(int signo) {
  pid_t pgid = foreground_pgid();
  kill(-(int)pgid, SIGINT);
}


x86 assembly (clang, -O0):
<interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foreground_pgid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    %edi,%edi
sub    %eax,%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_handler>:
push   %rax
xor    %eax,%eax
call   1030 <foreground_pgid@plt>
neg    %eax
mov    0x2eb7(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
pop    %rax
jmp    1040 <kill@plt>

LLVM IR (-O0):
@SIGINT = global i32 0
define void @interrupt_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = call i64 (...) @foreground_pgid()
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 0, %6
%8 = load i32, i32* @SIGINT
%9 = call i32 @kill(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
define void @interrupt_handler(i32 %0) {
%2 = tail call i64 (...) @foreground_pgid()
%3 = trunc i64 %2 to i32
%4 = sub nsw i32 0, %3
%5 = load i32, i32* @SIGINT
%6 = tail call i32 @kill(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int uic_connect(int *);
int /*<<< orphan*/ uic_msg_send(int, char *);
int main(void) {
  int client_fd;
  int res;
  res = uic_connect(&client_fd);
  if (res != 0) {
    printf("Couldn't connect to live replacement service\n");
  }
  uic_msg_send(client_fd, "livereplace ckpt version 2");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <uic_connect@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1161 <main+0x31>
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
lea    0xec3(%rip),%rsi
call   1030 <uic_msg_send@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1050 <uic_connect@plt>
test   %eax,%eax
je     114b <main+0x1b>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edi
lea    0xeaa(%rip),%rsi
call   1040 <uic_msg_send@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Couldn't connect to live replacement service\0A\00"
@.str.1 = [27 x i8] c"livereplace ckpt version 2\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @uic_connect(i32* %2)
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = load i32, i32* %2
%11 = call i32 @uic_msg_send(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"livereplace ckpt version 2\00"
@str = [45 x i8] c"Couldn't connect to live replacement service\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @uic_connect(i32* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
%9 = call i32 @uic_msg_send(i32 %8, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
double Cal_GrandTotal(double x) {
  double grand_total;
  grand_total = x * (1 + 0.174);
  return grand_total;
}


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

x86 assembly (clang, -O2):
<Cal_GrandTotal>:
mulsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @Cal_GrandTotal(double %0) {
%2 = fmul double %0, 1.174000e+00
ret double %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ REG_UART_BASE(scalar_t__);
__attribute__((always_)) __attribute__((flatten)) uint32_t
UART_FIFO(uint32_t i) {
  return (REG_UART_BASE(i) + 0x0);
}


x86 assembly (clang, -O0):
<UART_FIFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <REG_UART_BASE@plt>
add    $0x0,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_FIFO>:
jmp    1030 <REG_UART_BASE@plt>

LLVM IR (-O0):
define i64 @UART_FIFO(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @REG_UART_BASE(i64 %3)
%5 = add nsw i64 %4, 0
ret i64 %5
}

LLVM IR (-O2):
define i64 @UART_FIFO(i64 %0) {
%2 = tail call i64 @REG_UART_BASE(i64 %0)
ret i64 %2
}
extern int TakeUint16(int x) {
  if ((0xFFFF & (unsigned int)x) == 0xFFFE)
    return 11;
  return 0;
}


x86 assembly (clang, -O0):
<TakeUint16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffff,%eax
cmp    $0xfffe,%eax
jne    1126 <TakeUint16+0x26>
movl   $0xb,-0x4(%rbp)
jmp    112d <TakeUint16+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeUint16>:
xor    %ecx,%ecx
cmp    $0xfffe,%di
mov    $0xb,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @TakeUint16(i32 %0) {
%2 = and i32 %0, 65535
%3 = icmp eq i32 %2, 65534
%4 = select i1 %3, i32 11, i32 0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ set_act_state(int);
int /*<<< orphan*/ wait();
int main(void) {
  while (1) {
    set_act_state(1);
    wait();
    set_act_state(0);
    wait();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <set_act_state@plt>
mov    $0x0,%al
call   1040 <wait@plt>
xor    %edi,%edi
call   1030 <set_act_state@plt>
mov    $0x0,%al
call   1040 <wait@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <set_act_state@plt>
xor    %eax,%eax
call   1040 <wait@plt>
xor    %edi,%edi
call   1030 <set_act_state@plt>
xor    %eax,%eax
call   1040 <wait@plt>
jmp    1130 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @set_act_state(i32 1)
%4 = call i32 (...) @wait()
%5 = call i32 @set_act_state(i32 0)
%6 = call i32 (...) @wait()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @set_act_state(i32 1)
%3 = tail call i32 (...) @wait()
%4 = tail call i32 @set_act_state(i32 0)
%5 = tail call i32 (...) @wait()
br label %1
}
/* Variables and functions */
void *malloc_fail(size_t size) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @malloc_fail(i64 %0) {
ret i8* null
}
int acpi_gpio_update_gpiod_lookup_flags(unsigned long *lookupflags,
                                        struct acpi_gpio_info *info) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.acpi_gpio_info = type opaque
define i32 @acpi_gpio_update_gpiod_lookup_flags(i64* %0, %struct.acpi_gpio_info* %1) {
%3 = alloca i64*
%4 = alloca %struct.acpi_gpio_info*
store i64* %0, i64** %3
store %struct.acpi_gpio_info* %1, %struct.acpi_gpio_info** %4
ret i32 0
}

LLVM IR (-O2):
%struct.acpi_gpio_info = type opaque
define i32 @acpi_gpio_update_gpiod_lookup_flags(i64* nocapture readnone %0, %struct.acpi_gpio_info* nocapture readnone %1) {
ret i32 0
}
const char *hxd_vendor(void) { return "william@25thandClement.com"; }


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @hxd_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [27 x i8] c"william@25thandClement.com\00"
define i8* @hxd_vendor() {
ret i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xad() {
  Assert_real((islower(173) == 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_islower.c",
              870, ("islower should be 0 for 0xad"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xad>:
push   %rax
mov    $0xad,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x366,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xad\00"
define void @t_islower_0xad() {
%1 = call i64 @islower(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xad\00"
define void @t_islower_0xad() {
%1 = tail call i64 @islower(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double max(double x, double y) {
  if (x > y)
    return x;
  else
    return y;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Type definitions */
struct piece {
  int dummy;
};

/* Variables and functions */
struct piece *text_next(struct piece *, struct piece *);
void text_step(struct piece **t) {
  struct piece *x = text_next(t[0], t[1]);
  t[1] = t[0], t[0] = x;
}


x86 assembly (clang, -O0):
<text_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <text_next@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_step>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    0x8(%rbx),%rsi
call   1030 <text_next@plt>
mov    (%rbx),%rcx
mov    %rcx,0x8(%rbx)
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.piece = type { i32 }
define void @text_step(%struct.piece** %0) {
%2 = alloca %struct.piece**
%3 = alloca %struct.piece*
store %struct.piece** %0, %struct.piece*** %2
%4 = load %struct.piece**, %struct.piece*** %2
%5 = getelementptr inbounds %struct.piece*, %struct.piece** %4, i64 0
%6 = load %struct.piece*, %struct.piece** %5
%7 = load %struct.piece**, %struct.piece*** %2
%8 = getelementptr inbounds %struct.piece*, %struct.piece** %7, i64 1
%9 = load %struct.piece*, %struct.piece** %8
%10 = call %struct.piece* @text_next(%struct.piece* %6, %struct.piece* %9)
store %struct.piece* %10, %struct.piece** %3
%11 = load %struct.piece**, %struct.piece*** %2
%12 = getelementptr inbounds %struct.piece*, %struct.piece** %11, i64 0
%13 = load %struct.piece*, %struct.piece** %12
%14 = load %struct.piece**, %struct.piece*** %2
%15 = getelementptr inbounds %struct.piece*, %struct.piece** %14, i64 1
store %struct.piece* %13, %struct.piece** %15
%16 = load %struct.piece*, %struct.piece** %3
%17 = load %struct.piece**, %struct.piece*** %2
%18 = getelementptr inbounds %struct.piece*, %struct.piece** %17, i64 0
store %struct.piece* %16, %struct.piece** %18
ret void
}

LLVM IR (-O2):
%struct.piece = type { i32 }
define void @text_step(%struct.piece** nocapture %0) {
%2 = load %struct.piece*, %struct.piece** %0
%3 = getelementptr inbounds %struct.piece*, %struct.piece** %0, i64 1
%4 = load %struct.piece*, %struct.piece** %3
%5 = tail call %struct.piece* @text_next(%struct.piece* %2, %struct.piece* %4)
%6 = load %struct.piece*, %struct.piece** %0
store %struct.piece* %6, %struct.piece** %3
store %struct.piece* %5, %struct.piece** %0
ret void
}
void clearSignflag(char flags[]) { flags[8 - 8] = '0'; }


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

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

LLVM IR (-O0):
define void @clearSignflag(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 48, i8* %4
ret void
}

LLVM IR (-O2):
define void @clearSignflag(i8* nocapture writeonly %0) {
store i8 48, i8* %0
ret void
}
/* Variables and functions */
int yaffs_mount_common(int /*<<< orphan*/, char const *, int,
                       int /*<<< orphan*/);
int yaffs_mount2(const char *path, int readonly) {
  return yaffs_mount_common((0), path, readonly, 0);
}


x86 assembly (clang, -O0):
<yaffs_mount2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
xor    %ecx,%ecx
mov    %ecx,%edi
call   1030 <yaffs_mount_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yaffs_mount2>:
mov    %esi,%edx
mov    %rdi,%rsi
xor    %edi,%edi
xor    %ecx,%ecx
jmp    1030 <yaffs_mount_common@plt>

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

LLVM IR (-O2):
define i32 @yaffs_mount2(i8* %0, i32 %1) {
%3 = tail call i32 @yaffs_mount_common(i32 0, i8* %0, i32 %1, i32 0)
ret i32 %3
}
int get_sign(double value) {
  if (value == 0)
    return 0;
  else if (value > 0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<get_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112d <get_sign+0x2d>
jp     112d <get_sign+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1152 <get_sign+0x52>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114b <get_sign+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <get_sign+0x52>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sign>:
xor    %eax,%eax
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_sign(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_sign(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, i32 1, i32 -1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ critical(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void ecritical(const char *string) {
  critical("%s: %s", string, strerror(errno));
}


x86 assembly (clang, -O0):
<ecritical>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
call   1030 <critical@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ecritical>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <critical@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @ecritical(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @critical(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define void @ecritical(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @critical(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int atoi(char *);
int main(int argc, char *argv[]) {
  int index = atoi(argv[1]);
  char **ptr = argv + index;
  char *str = *ptr;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
store i32 %12, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
store i8** %16, i8*** %7
%17 = load i8**, i8*** %7
%18 = load i8*, i8** %17
store i8* %18, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int time(int /*<<< orphan*/ *);
int main() {
  int i = 123, j = 5;
  if (i != 0 || i > time(NULL) || i != j || i > 5 || j < 10) {
    printf("1\n");
  } else {
    printf("2\n");
  }
  printf("3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7b,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1183 <main+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jg     1183 <main+0x63>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1183 <main+0x63>
cmpl   $0x5,-0x8(%rbp)
jg     1183 <main+0x63>
cmpl   $0xa,-0xc(%rbp)
jge    1194 <main+0x74>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <main+0x80>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
@.str.2 = [3 x i8] c"3\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 123, i32* %2
store i32 5, i32* %3
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %20, label %6
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @time(i32* null)
%9 = icmp sgt i32 %7, %8
br i1 %9, label %20, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = icmp ne i32 %11, %12
br i1 %13, label %20, label %14
14: ; preds = %10
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 5
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 10
br i1 %19, label %20, label %22
20: ; preds = %17, %14, %10, %6, %0
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %24
22: ; preds = %17
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [2 x i8] c"1\00"
@str.3 = [2 x i8] c"3\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int meta() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @meta() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
char ft_getchar(void) {
  char a;
  read(0, &a, 1);
  return (a);
}


x86 assembly (clang, -O0):
<ft_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_getchar>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x7(%rsp),%al
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @ft_getchar() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_productCreate();
int /*<<< orphan*/ test_productGeters();
void test_Products() {
  test_productCreate();
  test_productGeters();
}


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

x86 assembly (clang, -O2):
<test_Products>:
push   %rax
xor    %eax,%eax
call   1030 <test_productCreate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_productGeters@plt>

LLVM IR (-O0):
define void @test_Products() {
%1 = call i32 (...) @test_productCreate()
%2 = call i32 (...) @test_productGeters()
ret void
}

LLVM IR (-O2):
define void @test_Products() {
%1 = tail call i32 (...) @test_productCreate()
%2 = tail call i32 (...) @test_productGeters()
ret void
}
/* Variables and functions */
int d(int);
int /*<<< orphan*/ niceprint(char *);
int /*<<< orphan*/ printf(char *, int);
void stream(void) {
  niceprint(
      "A waterway cuts accross the party's path. The stream is "
      "shallow and easily crossed, and the characters can drink and refresh "
      "their water supplies. Edible fish inhabit the stream, so that the DC "
      "of any foraging attempts for food in this area is reduced to 10. "
      "Crossing the stream reduces the drow pursuit level by 1.\n\n");
  printf("Width: %d feet\n\n", 5 * (d(4) + d(4)));
}


x86 assembly (clang, -O0):
<stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1050 <niceprint@plt>
mov    $0x4,%edi
call   1030 <d@plt>
mov    %eax,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <d@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
imul   $0x5,%eax,%esi
lea    0xfd2(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <niceprint@plt>
mov    $0x4,%edi
call   1030 <d@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1030 <d@plt>
add    %ebx,%eax
lea    (%rax,%rax,4),%esi
lea    0xfdf(%rip),%rdi
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [318 x i8] c"A waterway cuts accross the party's path. The stream is shallow and easily crossed, and the characters can drink and refresh their water supplies. Edible fish inhabit the stream, so that the DC of any foraging attempts for food in this area is reduced to 10. Crossing the stream reduces the drow pursuit level by 1.\0A\0A\00"
@.str.1 = [17 x i8] c"Width: %d feet\0A\0A\00"
define void @stream() {
%1 = call i32 @niceprint(i8* getelementptr inbounds ([318 x i8], [318 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @d(i32 4)
%3 = call i32 @d(i32 4)
%4 = add nsw i32 %2, %3
%5 = mul nsw i32 5, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [318 x i8] c"A waterway cuts accross the party's path. The stream is shallow and easily crossed, and the characters can drink and refresh their water supplies. Edible fish inhabit the stream, so that the DC of any foraging attempts for food in this area is reduced to 10. Crossing the stream reduces the drow pursuit level by 1.\0A\0A\00"
@.str.1 = [17 x i8] c"Width: %d feet\0A\0A\00"
define void @stream() {
%1 = tail call i32 @niceprint(i8* getelementptr inbounds ([318 x i8], [318 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @d(i32 4)
%3 = tail call i32 @d(i32 4)
%4 = add nsw i32 %3, %2
%5 = mul nsw i32 %4, 5
%6 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
void print_command(char *data, int len) {}


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

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

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

LLVM IR (-O2):
define void @print_command(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x10() {
  Assert_real((isodigit(16) == 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",
              85, ("isodigit should be 0 for 0x10"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x10>:
push   %rax
mov    $0x10,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x55,%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 0x10\00"
define void @t_isodigit_0x10() {
%1 = call i64 @isodigit(i32 16)
%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 85, 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 0x10\00"
define void @t_isodigit_0x10() {
%1 = tail call i64 @isodigit(i32 16)
%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 85, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ alldone(int);
int /*<<< orphan*/ non_fatal(char *, char *);
void fatal(char *s1, char *s2) {
  non_fatal(s1, s2);
  alldone(1);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <non_fatal@plt>
mov    $0x1,%edi
call   1030 <alldone@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal>:
push   %rax
call   1040 <non_fatal@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <alldone@plt>

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

LLVM IR (-O2):
define void @fatal(i8* %0, i8* %1) {
%3 = tail call i32 @non_fatal(i8* %0, i8* %1)
%4 = tail call i32 @alldone(i32 1)
ret void
}
/* Type definitions */
typedef union sigval {
  int dummy;
} sigval;

/* Variables and functions */
void notify_func(union sigval s) { (void)s; }


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

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

LLVM IR (-O0):
%union.sigval = type { i32 }
define void @notify_func(i32 %0) {
%2 = alloca %union.sigval
%3 = getelementptr inbounds %union.sigval, %union.sigval* %2, i32 0, i32 0
store i32 %0, i32* %3
ret void
}

LLVM IR (-O2):
define void @notify_func(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOCK_UN;
int flock(int, int /*<<< orphan*/);
int logfile_unlock(int fd) {
  if (fd < 0) {
    return -1;
  }
  return flock(fd, LOCK_UN);
}


x86 assembly (clang, -O0):
<logfile_unlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <logfile_unlock+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <logfile_unlock+0x35>
mov    -0x8(%rbp),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1030 <flock@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logfile_unlock>:
test   %edi,%edi
js     1122 <logfile_unlock+0x12>
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
jmp    1030 <flock@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@LOCK_UN = global i32 0
define i32 @logfile_unlock(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @LOCK_UN
%5 = tail call i32 @flock(i32 %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ p16e_adc();
int /*<<< orphan*/ p16e_eeprom();
int /*<<< orphan*/ p16e_int_pin();
int /*<<< orphan*/ p16e_int_ports();
int /*<<< orphan*/ p16e_mssp();
int /*<<< orphan*/ p16e_tmr0();
int /*<<< orphan*/ p16e_tmr1();
int /*<<< orphan*/ p16e_tmr2();
int /*<<< orphan*/ p16e_wdt_2();
int /*<<< orphan*/ serial(int /*<<< orphan*/);
void PIC16F1789_periferic(void) {
  p16e_mssp();
  p16e_adc();
  p16e_int_pin();
  p16e_int_ports();
  p16e_tmr0();
  p16e_wdt_2();
  p16e_eeprom();
  p16e_tmr1();
  p16e_tmr2();
  serial(0);
}


x86 assembly (clang, -O0):
<PIC16F1789_periferic>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <p16e_mssp@plt>
mov    $0x0,%al
call   1060 <p16e_adc@plt>
mov    $0x0,%al
call   10a0 <p16e_int_pin@plt>
mov    $0x0,%al
call   1090 <p16e_int_ports@plt>
mov    $0x0,%al
call   1080 <p16e_tmr0@plt>
mov    $0x0,%al
call   1050 <p16e_wdt_2@plt>
mov    $0x0,%al
call   10c0 <p16e_eeprom@plt>
mov    $0x0,%al
call   10b0 <p16e_tmr1@plt>
mov    $0x0,%al
call   1070 <p16e_tmr2@plt>
xor    %edi,%edi
call   1040 <serial@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIC16F1789_periferic>:
push   %rax
xor    %eax,%eax
call   1030 <p16e_mssp@plt>
xor    %eax,%eax
call   1060 <p16e_adc@plt>
xor    %eax,%eax
call   10a0 <p16e_int_pin@plt>
xor    %eax,%eax
call   1090 <p16e_int_ports@plt>
xor    %eax,%eax
call   1080 <p16e_tmr0@plt>
xor    %eax,%eax
call   1050 <p16e_wdt_2@plt>
xor    %eax,%eax
call   10c0 <p16e_eeprom@plt>
xor    %eax,%eax
call   10b0 <p16e_tmr1@plt>
xor    %eax,%eax
call   1070 <p16e_tmr2@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <serial@plt>

LLVM IR (-O0):
define void @PIC16F1789_periferic() {
%1 = call i32 (...) @p16e_mssp()
%2 = call i32 (...) @p16e_adc()
%3 = call i32 (...) @p16e_int_pin()
%4 = call i32 (...) @p16e_int_ports()
%5 = call i32 (...) @p16e_tmr0()
%6 = call i32 (...) @p16e_wdt_2()
%7 = call i32 (...) @p16e_eeprom()
%8 = call i32 (...) @p16e_tmr1()
%9 = call i32 (...) @p16e_tmr2()
%10 = call i32 @serial(i32 0)
ret void
}

LLVM IR (-O2):
define void @PIC16F1789_periferic() {
%1 = tail call i32 (...) @p16e_mssp()
%2 = tail call i32 (...) @p16e_adc()
%3 = tail call i32 (...) @p16e_int_pin()
%4 = tail call i32 (...) @p16e_int_ports()
%5 = tail call i32 (...) @p16e_tmr0()
%6 = tail call i32 (...) @p16e_wdt_2()
%7 = tail call i32 (...) @p16e_eeprom()
%8 = tail call i32 (...) @p16e_tmr1()
%9 = tail call i32 (...) @p16e_tmr2()
%10 = tail call i32 @serial(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *dlerror();
void *dlopen_simple(char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
void *dlopen_fatal(const char *name) {
  void *rv = dlopen_simple(name);
  if (!rv) {
    fprintf(stderr, "Cannot load %s (ELF): %s\n", name, dlerror());
    abort();
  }
  return rv;
}


x86 assembly (clang, -O0):
<dlopen_fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <dlopen_simple@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    119c <dlopen_fatal+0x5c>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <dlerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe70(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlopen_fatal>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <dlopen_simple@plt>
test   %rax,%rax
je     1157 <dlopen_fatal+0x17>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e82(%rip),%rax
mov    (%rax),%ebp
xor    %eax,%eax
call   1030 <dlerror@plt>
lea    0xe92(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1060 <fprintf@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Cannot load %s (ELF): %s\0A\00"
define i8* @dlopen_fatal(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @dlopen_simple(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i8* (...) @dlerror()
%12 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = call i32 (...) @abort()
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Cannot load %s (ELF): %s\0A\00"
define i8* @dlopen_fatal(i8* %0) {
%2 = tail call i8* @dlopen_simple(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i8* (...) @dlerror()
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %6)
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %1
ret i8* %2
}
void funk(int veto[][10]) {
  for (int a = 0; a < 2; a++) {
    for (int b = 0; b < 10; b++) {
      veto[a][b] = (a + b) * 2;
    }
  }
}


x86 assembly (clang, -O0):
<funk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    116a <funk+0x6a>
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    1157 <funk+0x57>
mov    -0xc(%rbp),%edx
add    -0x10(%rbp),%edx
shl    $0x1,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <funk+0x20>
jmp    115c <funk+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <funk+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<funk>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movaps 0xeff(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movaps 0xf04(%rip),%xmm0
movups %xmm0,0x20(%rdi)
movaps 0xf09(%rip),%xmm0
movups %xmm0,0x30(%rdi)
movaps 0xf0e(%rip),%xmm0
movups %xmm0,0x40(%rdi)
ret

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

LLVM IR (-O2):
define void @funk([10 x i32]* nocapture writeonly %0) {
%2 = bitcast [10 x i32]* %0 to <4 x i32>*
store <4 x i32> <i32 0, i32 2, i32 4, i32 6>, <4 x i32>* %2
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 8, i32 10, i32 12, i32 14>, <4 x i32>* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 0, i64 8
%6 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> <i32 16, i32 18, i32 2, i32 4>, <4 x i32>* %6
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 1, i64 2
%8 = bitcast i32* %7 to <4 x i32>*
store <4 x i32> <i32 6, i32 8, i32 10, i32 12>, <4 x i32>* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 1, i64 6
%10 = bitcast i32* %9 to <4 x i32>*
store <4 x i32> <i32 14, i32 16, i32 18, i32 20>, <4 x i32>* %10
ret void
}
extern void pinio_enable_flippers(void) {}


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

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

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

LLVM IR (-O2):
define void @pinio_enable_flippers() {
ret void
}