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

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
scalar_t__ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/);
int sighold(int sig) {
  sigset_t mask;
  sigemptyset(&mask);
  if (sigaddset(&mask, sig) < 0)
    return -1;
  return sigprocmask(SIG_BLOCK, &mask, 0);
}


x86 assembly (clang, -O0):
<sighold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigaddset@plt>
cmp    $0x0,%rax
jge    1166 <sighold+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    117d <sighold+0x4d>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighold>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
test   %rax,%rax
js     1169 <sighold+0x39>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
jmp    116e <sighold+0x3e>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @sighold(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @sigemptyset(i32* %4)
%6 = load i32, i32* %3
%7 = call i64 @sigaddset(i32* %4, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %13
10: ; preds = %1
%11 = load i32, i32* @SIG_BLOCK
%12 = call i32 @sigprocmask(i32 %11, i32* %4, i32 0)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @sighold(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i64 @sigaddset(i32* %2, i32 %0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* @SIG_BLOCK
%9 = call i32 @sigprocmask(i32 %8, i32* %2, i32 0)
br label %10
10: ; preds = %1, %7
%11 = phi i32 [ %9, %7 ], [ -1, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr1Operand(int, int, int, int);
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ GenStartCommentLine();
int /*<<< orphan*/ printf2(char *);
void GenJumpIfZero(int label) {
  GenStartCommentLine();
  printf2("JumpIfZero\n");
  GenPrintInstr2Operands(0x0F, 0, 0x03, 0, 0x03, 0);
  GenPrintInstr1Operand(0x1D, 8, 0x0F, label);
}


x86 assembly (clang, -O0):
<GenJumpIfZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GenStartCommentLine@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf2@plt>
mov    $0xf,%edi
xor    %r9d,%r9d
mov    $0x3,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
mov    %r9d,%ecx
call   1050 <GenPrintInstr2Operands@plt>
mov    -0x4(%rbp),%ecx
mov    $0x1d,%edi
mov    $0x8,%esi
mov    $0xf,%edx
call   1060 <GenPrintInstr1Operand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenJumpIfZero>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <GenStartCommentLine@plt>
lea    0xeaf(%rip),%rdi
call   1040 <printf2@plt>
mov    $0xf,%edi
xor    %esi,%esi
mov    $0x3,%edx
xor    %ecx,%ecx
mov    $0x3,%r8d
xor    %r9d,%r9d
call   1050 <GenPrintInstr2Operands@plt>
mov    $0x1d,%edi
mov    $0x8,%esi
mov    $0xf,%edx
mov    %ebx,%ecx
pop    %rbx
jmp    1060 <GenPrintInstr1Operand@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"JumpIfZero\0A\00"
define void @GenJumpIfZero(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @GenStartCommentLine()
%4 = call i32 @printf2(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @GenPrintInstr2Operands(i32 15, i32 0, i32 3, i32 0, i32 3, i32 0)
%6 = load i32, i32* %2
%7 = call i32 @GenPrintInstr1Operand(i32 29, i32 8, i32 15, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"JumpIfZero\0A\00"
define void @GenJumpIfZero(i32 %0) {
%2 = tail call i32 (...) @GenStartCommentLine()
%3 = tail call i32 @printf2(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @GenPrintInstr2Operands(i32 15, i32 0, i32 3, i32 0, i32 3, i32 0)
%5 = tail call i32 @GenPrintInstr1Operand(i32 29, i32 8, i32 15, i32 %0)
ret void
}
/* Type definitions */
struct sched_param {
  int dummy;
};
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_attr_getschedparam(const pthread_attr_t *a, struct sched_param *b) {
  assert(0);
}


x86 assembly (clang, -O0):
<pthread_attr_getschedparam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.sched_param = type { i32 }
define i32 @pthread_attr_getschedparam(i32* %0, %struct.sched_param* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca %struct.sched_param*
store i32* %0, i32** %4
store %struct.sched_param* %1, %struct.sched_param** %5
%6 = call i32 @assert(i32 0)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
define i32 @pthread_attr_getschedparam(i32* nocapture readnone %0, %struct.sched_param* nocapture readnone %1) {
%3 = tail call i32 @assert(i32 0)
ret i32 undef
}
void foo_2_1_2_2_1_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_2_2_1_2_2_2_2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spi_write16(int, unsigned char);
void MCP23s17_WriteGPIO_B(unsigned char data) { spi_write16((0x13), data); }


x86 assembly (clang, -O0):
<MCP23s17_WriteGPIO_B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x13,%edi
movzbl -0x1(%rbp),%esi
call   1030 <spi_write16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MCP23s17_WriteGPIO_B>:
mov    %edi,%esi
mov    $0x13,%edi
jmp    1030 <spi_write16@plt>

LLVM IR (-O0):
define void @MCP23s17_WriteGPIO_B(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @spi_write16(i32 19, i8 zeroext %3)
ret void
}

LLVM IR (-O2):
define void @MCP23s17_WriteGPIO_B(i8 zeroext %0) {
%2 = tail call i32 @spi_write16(i32 19, i8 zeroext %0)
ret void
}
/* Variables and functions */
scalar_t__ VW_MarkUpdateBlock(int, int, int, int);
int /*<<< orphan*/ VW_Plot(int, int, int);
void VWB_Plot(int x, int y, int color) {
  if (VW_MarkUpdateBlock(x, y, x, y))
    VW_Plot(x, y, color);
}


x86 assembly (clang, -O0):
<VWB_Plot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
call   1040 <VW_MarkUpdateBlock@plt>
cmp    $0x0,%rax
je     115a <VWB_Plot+0x3a>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <VW_Plot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VWB_Plot>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %edi,%edx
mov    %esi,%ecx
call   1040 <VW_MarkUpdateBlock@plt>
test   %rax,%rax
je     1149 <VWB_Plot+0x29>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <VW_Plot@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @VWB_Plot(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 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i64 @VW_MarkUpdateBlock(i32 %7, i32 %8, i32 %9, i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = load i32, i32* %6
%17 = call i32 @VW_Plot(i32 %14, i32 %15, i32 %16)
br label %18
18: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
define void @VWB_Plot(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @VW_MarkUpdateBlock(i32 %0, i32 %1, i32 %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @VW_Plot(i32 %0, i32 %1, i32 %2)
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
struct hdr_histogram {
  int dummy;
};
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ counts_get_normalised(struct hdr_histogram *,
                                         int /*<<< orphan*/);
int64_t hdr_count_at_index(struct hdr_histogram *h, int32_t index) {
  return counts_get_normalised(h, index);
}


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

x86 assembly (clang, -O2):
<hdr_count_at_index>:
jmp    1030 <counts_get_normalised@plt>

LLVM IR (-O0):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_count_at_index(%struct.hdr_histogram* %0, i32 %1) {
%3 = alloca %struct.hdr_histogram*
%4 = alloca i32
store %struct.hdr_histogram* %0, %struct.hdr_histogram** %3
store i32 %1, i32* %4
%5 = load %struct.hdr_histogram*, %struct.hdr_histogram** %3
%6 = load i32, i32* %4
%7 = call i32 @counts_get_normalised(%struct.hdr_histogram* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.hdr_histogram = type { i32 }
define i32 @hdr_count_at_index(%struct.hdr_histogram* %0, i32 %1) {
%3 = tail call i32 @counts_get_normalised(%struct.hdr_histogram* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void timerHandler(void *string, unsigned long currentTime,
                  unsigned long scheduledTime) {
  printf("timer went off.\n");
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"timer went off.\0A\00"
define void @timerHandler(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"timer went off.\00"
define void @timerHandler(i8* nocapture readnone %0, i64 %1, i64 %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
void glClear(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glClear() {
ret void
}
/* Variables and functions */
double **matriz_quadrada(int);
int /*<<< orphan*/ preenche_identidade(double **, int);
double **matriz_identidade(int dim) {
  double **I = matriz_quadrada(dim);
  preenche_identidade(I, dim);
  return I;
}


x86 assembly (clang, -O0):
<matriz_identidade>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <matriz_quadrada@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1040 <preenche_identidade@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matriz_identidade>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <matriz_quadrada@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1040 <preenche_identidade@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double** @matriz_identidade(i32 %0) {
%2 = alloca i32
%3 = alloca double**
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call double** @matriz_quadrada(i32 %4)
store double** %5, double*** %3
%6 = load double**, double*** %3
%7 = load i32, i32* %2
%8 = call i32 @preenche_identidade(double** %6, i32 %7)
%9 = load double**, double*** %3
ret double** %9
}

LLVM IR (-O2):
define double** @matriz_identidade(i32 %0) {
%2 = tail call double** @matriz_quadrada(i32 %0)
%3 = tail call i32 @preenche_identidade(double** %2, i32 %0)
ret double** %2
}
/* Variables and functions */
int /*<<< orphan*/ cgcalr();
int /*<<< orphan*/ commit();
int /*<<< orphan*/ gentext();
int /*<<< orphan*/ load();
void gencalr(void) {
  gentext();
  commit();
  cgcalr();
  load();
}


x86 assembly (clang, -O0):
<gencalr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gentext@plt>
mov    $0x0,%al
call   1050 <commit@plt>
mov    $0x0,%al
call   1030 <cgcalr@plt>
mov    $0x0,%al
call   1060 <load@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gencalr>:
push   %rax
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
call   1050 <commit@plt>
xor    %eax,%eax
call   1030 <cgcalr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <load@plt>

LLVM IR (-O0):
define void @gencalr() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @commit()
%3 = call i32 (...) @cgcalr()
%4 = call i32 (...) @load()
ret void
}

LLVM IR (-O2):
define void @gencalr() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @commit()
%3 = tail call i32 (...) @cgcalr()
%4 = tail call i32 (...) @load()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  int res;
  do {
    assert(1);
    assert(2);
    res = 1 + 2;
  } while (0);
  int i = 0;
  int j = 0;
  int res2;
  do {
    assert(++i);
    assert(++j);
    res2 = ++i + ++j;
  } while (0);
  printf("1 + 2 = %d, 1 + 1 = %d\n", res, res2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
call   1040 <assert@plt>
movl   $0x3,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0x8(%rbp)
call   1040 <assert@plt>
mov    -0xc(%rbp),%edi
add    $0x1,%edi
mov    %edi,-0xc(%rbp)
call   1040 <assert@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x2,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
mov    $0x1,%edi
call   1040 <assert@plt>
lea    0xeb0(%rip),%rdi
mov    $0x3,%esi
mov    $0x4,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [24 x i8] c"1 + 2 = %d, 1 + 1 = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 2)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 3, i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int read(int, char *, int);
int safe_read(int fd, char *buffer, int size) {
  int ret = read(fd, buffer, size);
  if (ret < 0) {
    perror("read");
    exit(EXIT_FAILURE);
  }
  return ret;
}


x86 assembly (clang, -O0):
<safe_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    1178 <safe_read+0x48>
lea    0xe9b(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_read>:
push   %rax
call   1030 <read@plt>
test   %eax,%eax
js     113c <safe_read+0xc>
pop    %rcx
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"read\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @read(i32 %8, i8* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp slt i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %3
%15 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
@.str = [5 x i8] c"read\00"
@EXIT_FAILURE = global i32 0
define i32 @safe_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
ret i32 %4
}
/* Variables and functions */
void menu_end_entry(void) {}


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

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

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

LLVM IR (-O2):
define void @menu_end_entry() {
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
int i_trunc(double n) { return (int)floor(n); }


x86 assembly (clang, -O0):
<i_trunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_trunc>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @i_trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @floor(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @i_trunc(double %0) {
%2 = tail call i64 @floor(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_bwing() {
  printf("                   _____--____\n            __--^^^TT>  | |   ^^-_\n "
         "           ^^--________|_|______\\\n                    |          "
         "\\\n                  _-^           \\\n               "
         "_-^______________\\\n                 | \\          -==)\n           "
         "      | |============|\n                 |_/__________-==)\n         "
         "        ^-_           /\n                    \\          /\n         "
         "           \\         /\n                    \\         /\n          "
         "          \\        /\n                    \\        /\n             "
         "       \\       /\n                    \\       /\n                  "
         "  \\      /\n                    \\      /\n                    \\   "
         "  /\n                    \\     /\n                    \\     /\n    "
         "              _-^^^^-__\n            +==^^^^--____-^\n\n");
}


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

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

LLVM IR (-O0):
@.str = [758 x i8] c" _____--____\0A __--^^^TT> | | ^^-_\0A ^^--________|_|______\\\0A | \\\0A _-^ \\\0A _-^______________\\\0A | \\ -==)\0A | |============|\0A |_/__________-==)\0A ^-_ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A _-^^^^-__\0A +==^^^^--____-^\0A\0A\00"
define void @print_bwing() {
%1 = call i32 @printf(i8* getelementptr inbounds ([758 x i8], [758 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [757 x i8] c" _____--____\0A __--^^^TT> | | ^^-_\0A ^^--________|_|______\\\0A | \\\0A _-^ \\\0A _-^______________\\\0A | \\ -==)\0A | |============|\0A |_/__________-==)\0A ^-_ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A \\ /\0A _-^^^^-__\0A +==^^^^--____-^\0A\00"
define void @print_bwing() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([757 x i8], [757 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _XReadPad() {
  printf("_XReadPad called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"_XReadPad called\00"
define i32 @_XReadPad() {
%1 = 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*/ uint8_t;

/* Variables and functions */
int hash(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ const *, size_t, int,
         int);
int shake128(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen) {
  return hash(out, outlen, in, inlen, 200 - (128 / 4), 0x1f);
}


x86 assembly (clang, -O0):
<shake128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xa8,%r8d
mov    $0x1f,%r9d
call   1030 <hash@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shake128>:
mov    $0xa8,%r8d
mov    $0x1f,%r9d
jmp    1030 <hash@plt>

LLVM IR (-O0):
define i32 @shake128(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i64 %3, i64* %8
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = load i32*, i32** %7
%12 = load i64, i64* %8
%13 = call i32 @hash(i32* %9, i64 %10, i32* %11, i64 %12, i32 168, i32 31)
ret i32 %13
}

LLVM IR (-O2):
define i32 @shake128(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = tail call i32 @hash(i32* %0, i64 %1, i32* %2, i64 %3, i32 168, i32 31)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kfree(char *);
scalar_t__ kmalloc(int, int /*<<< orphan*/);
int /*<<< orphan*/ vga_puts(int, char *, int);
int /*<<< orphan*/ vsprintf(char *, char const *, char *);
int printd(const char *fmtstr, ...) {
  char *pdbuf = (char *)kmalloc(1024, 0);
  char *args = (char *)(((char *)&fmtstr) + 4);
  vsprintf(pdbuf, fmtstr, args);
  vga_puts(3, pdbuf, 0x4);
  kfree(pdbuf);
  return 0;
}


x86 assembly (clang, -O0):
<printd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x400,%edi
xor    %esi,%esi
mov    %esi,-0x1c(%rbp)
call   1060 <kmalloc@plt>
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <vsprintf@plt>
mov    -0x10(%rbp),%rsi
mov    $0x3,%edi
mov    $0x4,%edx
call   1050 <vga_puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <kfree@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printd>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,(%rsp)
mov    $0x400,%edi
xor    %esi,%esi
call   1060 <kmalloc@plt>
mov    %rax,%rbx
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <vsprintf@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1050 <vga_puts@plt>
mov    %rbx,%rdi
call   1030 <kfree@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @printd(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call i64 @kmalloc(i32 1024, i32 0)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = bitcast i8** %2 to i8*
%8 = getelementptr inbounds i8, i8* %7, i64 4
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = load i8*, i8** %4
%12 = call i32 @vsprintf(i8* %9, i8* %10, i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @vga_puts(i32 3, i8* %13, i32 4)
%15 = load i8*, i8** %3
%16 = call i32 @kfree(i8* %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @printd(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = tail call i64 @kmalloc(i32 1024, i32 0)
%4 = inttoptr i64 %3 to i8*
%5 = bitcast i8** %2 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 4
%7 = call i32 @vsprintf(i8* %4, i8* %0, i8* %6)
%8 = call i32 @vga_puts(i32 3, i8* %4, i32 4)
%9 = call i32 @kfree(i8* %4)
ret i32 0
}
int set_str(char **res, char *val) {
  *res = val;
  return 0;
}


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

x86 assembly (clang, -O2):
<set_str>:
mov    %rsi,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @set_str(i8** nocapture writeonly %0, i8* %1) {
store i8* %1, i8** %0
ret i32 0
}
int getTipusOrdenacio(char tipus) {
  switch (tipus) {
  case '<':
    return 0;
  case '>':
    return 1;
  default:
    return 2;
  }
}


x86 assembly (clang, -O0):
<getTipusOrdenacio>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x3c,%eax
je     1130 <getTipusOrdenacio+0x30>
jmp    111f <getTipusOrdenacio+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x3e,%eax
je     113c <getTipusOrdenacio+0x3c>
jmp    1148 <getTipusOrdenacio+0x48>
movl   $0x0,-0x4(%rbp)
jmp    114f <getTipusOrdenacio+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    114f <getTipusOrdenacio+0x4f>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTipusOrdenacio>:
xor    %eax,%eax
cmp    $0x3e,%dil
sete   %al
mov    $0x2,%ecx
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x3c,%dil
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getTipusOrdenacio(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %8 [
i32 60, label %6
i32 62, label %7
]
6: ; preds = %1
store i32 0, i32* %2
br label %9
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 2, i32* %2
br label %9
9: ; preds = %8, %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @getTipusOrdenacio(i8 signext %0) {
%2 = icmp eq i8 %0, 62
%3 = select i1 %2, i32 1, i32 2
%4 = icmp eq i8 %0, 60
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Variables and functions */
char *malloc(int);
char *allocate_something(int size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<allocate_something>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @allocate_something(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
/* Variables and functions */
int increment(int);
int /*<<< orphan*/ printf(char *, ...);
void other_function(void) {
  printf("I'm going to increment 5!\n");
  printf("Here it is: %d\n", increment(5));
}


x86 assembly (clang, -O0):
<other_function>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x5,%edi
call   1030 <increment@plt>
mov    %eax,%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<other_function>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1040 <increment@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"I'm going to increment 5!\0A\00"
@.str.1 = [16 x i8] c"Here it is: %d\0A\00"
define void @other_function() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @increment(i32 5)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Here it is: %d\0A\00"
@str = [26 x i8] c"I'm going to increment 5!\00"
define void @other_function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @increment(i32 5)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
scalar_t__ isblank(char const);
void discardBlankChars(const char *string, int *pos) {
  while (isblank(string[*pos])) {
    (*pos)++;
  }
}


x86 assembly (clang, -O0):
<discardBlankChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
je     114e <discardBlankChars+0x3e>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1120 <discardBlankChars+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discardBlankChars>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movslq (%rsi),%rax
movsbl (%rdi,%rax,1),%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1030 <isblank@plt>
test   %rax,%rax
je     114b <discardBlankChars+0x3b>
movslq (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %ecx,(%rbx)
movsbl 0x1(%r14,%rax,1),%edi
jmp    1130 <discardBlankChars+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @discardBlankChars(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i64 @isblank(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %2, %9
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = tail call i64 @isblank(i8 signext %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %9
17: ; preds = %9, %2
ret void
}
void foo783() {}


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

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

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

LLVM IR (-O2):
define void @foo783() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void Error(char *errstr) {
  printf("\n-- Error: %s\n", errstr);
  exit(0);
}


x86 assembly (clang, -O0):
<Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Error>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"\0A-- Error: %s\0A\00"
define void @Error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x49() {
  Assert_real((iscntrl(73) == 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_iscntrl.c",
              370, ("iscntrl should be 0 for I"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x49>:
push   %rax
mov    $0x49,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x172,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for I\00"
define void @t_iscntrl_0x49() {
%1 = call i64 @iscntrl(i32 73)
%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 370, i8* getelementptr inbounds ([26 x i8], [26 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for I\00"
define void @t_iscntrl_0x49() {
%1 = tail call i64 @iscntrl(i32 73)
%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 370, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void warning(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @warning(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *str = "Hello world.\n";
  printf("%s", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello world.\0A\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int spaceCount(char const *);
int main(int argc, const char *argv[]) {
  const char *sentence = "He was not in the cab at the time.";
  printf("\"%s\" has %d spaces\n", sentence, spaceCount(sentence));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <spaceCount@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <spaceCount@plt>
lea    0xeec(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"He was not in the cab at the time.\00"
@.str.1 = [20 x i8] c"\22%s\22 has %d spaces\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %6
%9 = call i32 @spaceCount(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"He was not in the cab at the time.\00"
@.str.1 = [20 x i8] c"\22%s\22 has %d spaces\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @spaceCount(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_v32_10_sse4() {}


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

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

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

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

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xreparent;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xreparent_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xreparent.serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xreparent_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
helpmessage() {}


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

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

LLVM IR (-O0):
define i32 @helpmessage() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @helpmessage() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
bool prefix(const char *pre, const char *str) {
  return strncmp(pre, str, strlen(pre)) == 0;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @prefix(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 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @prefix(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char *p;
  p = (char *)(0xffffffff);
  printf("%c\n", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xffffffff,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed4(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = load i8, i8* inttoptr (i64 4294967295 to i8*)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quickSort(int *, int /*<<< orphan*/, int);
int main() {
  int arr[] = {10, 7, 8, 9, 1, 5};
  int n = sizeof(arr) / sizeof(arr[0]);
  quickSort(arr, 0, n - 1);
  printf("Sorted array: n");
  printArray(arr, n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <quickSort@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xed4(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1040 <quickSort@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 10, i32 7, i32 8, i32 9, i32 1, i32 5]
@.str = [16 x i8] c"Sorted array: n\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [6 x i32]* %2 to i8*
store i32 6, i32* %3
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = call i32 @quickSort(i32* %5, i32 0, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%11 = load i32, i32* %3
%12 = call i32 @printArray(i32* %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 10, i32 7, i32 8, i32 9, i32 1, i32 5]
@.str = [16 x i8] c"Sorted array: n\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @quickSort(i32* %3, i32 0, i32 5)
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printArray(i32* %3, i32 6)
ret i32 0
}