xunge/DecIR huggingface dataset:
void psi_set_uint16_le(void *buf, unsigned idx, unsigned val) {
  unsigned char *tmp;
  tmp = (unsigned char *)buf + idx;
  tmp[0] = val & 0xff;
  tmp[1] = (val >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<psi_set_uint16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<psi_set_uint16_le>:
mov    %esi,%eax
mov    %dx,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @psi_set_uint16_le(i8* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = trunc i32 %2 to i8
store i8 %6, i8* %5
%7 = lshr i32 %2, 8
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %8, i8* %9
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ width;
};
typedef TYPE_1__ XWindowChanges;

/* Variables and functions */
int get_XWindowChanges_width(void *_p) {
  return (int)((XWindowChanges *)_p)->width;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XWindowChanges_width(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XWindowChanges_width(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
double __dasind(double);
double d_asind(double *x) { return (__dasind(*x)); }


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

x86 assembly (clang, -O2):
<d_asind>:
movsd  (%rdi),%xmm0
jmp    1030 <__dasind@plt>

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

LLVM IR (-O2):
define double @d_asind(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @__dasind(double %2)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ X25519(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
void curve25519_openssl(uint8_t *shared, uint8_t *my_priv, uint8_t *their_pub) {
  X25519(shared, my_priv, their_pub);
}


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

x86 assembly (clang, -O2):
<curve25519_openssl>:
jmp    1030 <X25519@plt>

LLVM IR (-O0):
define void @curve25519_openssl(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** %6
%10 = call i32 @X25519(i32* %7, i32* %8, i32* %9)
ret void
}

LLVM IR (-O2):
define void @curve25519_openssl(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @X25519(i32* %0, i32* %1, i32* %2)
ret void
}
void test12() {
  enum { A = -1, B = 4294967286 } a;
  switch (a) {
  case A:
  case B:
    break;
  }
}


x86 assembly (clang, -O0):
<test12>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
sub    $0xffffffffffffffff,%rax
je     1132 <test12+0x32>
jmp    111b <test12+0x1b>
mov    -0x10(%rbp),%rax
mov    $0xfffffff6,%ecx
sub    %rcx,%rax
jne    1137 <test12+0x37>
jmp    1132 <test12+0x32>
jmp    1137 <test12+0x37>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test12() {
%1 = alloca i64
%2 = load i64, i64* %1
switch i64 %2, label %4 [
i64 -1, label %3
i64 4294967286, label %3
]
3: ; preds = %0, %0
br label %4
4: ; preds = %0, %3
ret void
}

LLVM IR (-O2):
define void @test12() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void help_display() {
  printf("Usage: upackddir [OPTIONS] FILENAME...\n"
         "Extracts and creates PackdDir archives.\n\n"
         "Options:\n"
         "  -h, --help\t\tThis help.\n"
         "  -c, --create\t\tCreate new archive.\n"
         "  -f, --file=ARG\tWrite new archive to ARG."
         " Default is stdout.\n"
         "  -t, --list\t\tList contents.\n"
         "  -x ARG\t\tExtract file ARG from the archive.\n"
         "  --version\t\tDisplay version information.\n"
         "Report bugs to <fabiobonelli@libero.it>\n");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<help_display>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help_display>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [369 x i8] c"Usage: upackddir [OPTIONS] FILENAME...\0AExtracts and creates PackdDir archives.\0A\0AOptions:\0A -h, --help\09\09This help.\0A -c, --create\09\09Create new archive.\0A -f, --file=ARG\09Write new archive to ARG. Default is stdout.\0A -t, --list\09\09List contents.\0A -x ARG\09\09Extract file ARG from the archive.\0A --version\09\09Display version information.\0AReport bugs to <fabiobonelli@libero.it>\0A\00"
@EXIT_SUCCESS = global i32 0
define void @help_display() {
%1 = call i32 @printf(i8* getelementptr inbounds ([369 x i8], [369 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [368 x i8] c"Usage: upackddir [OPTIONS] FILENAME...\0AExtracts and creates PackdDir archives.\0A\0AOptions:\0A -h, --help\09\09This help.\0A -c, --create\09\09Create new archive.\0A -f, --file=ARG\09Write new archive to ARG. Default is stdout.\0A -t, --list\09\09List contents.\0A -x ARG\09\09Extract file ARG from the archive.\0A --version\09\09Display version information.\0AReport bugs to <fabiobonelli@libero.it>\00"
define void @help_display() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([368 x i8], [368 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
int sys_rename(int ofd, const char *old_path, int nfd, const char *new_path) {}


x86 assembly (clang, -O0):
<sys_rename>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @sys_rename(i32 %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_rename(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3) {
ret i32 undef
}
int isprint(int c) {
  return ((unsigned char)c >= 32) && ((unsigned char)c <= 126);
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x5(%rbp)
jl     112a <isprint+0x2a>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0x7e,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
movzbl %dil,%ecx
add    $0xffffffe0,%ecx
xor    %eax,%eax
cmp    $0x5f,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 32
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = icmp sle i32 %10, 126
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -32
%4 = icmp ult i32 %3, 95
%5 = zext i1 %4 to i32
ret i32 %5
}
unsigned int hash(const char *s, unsigned int hash_size) {
  unsigned int hashval;
  for (hashval = 0; *s != '\0'; s++) {
    hashval = ((unsigned int)*s | 0x20) + 31 * hashval;
  }
  return hashval % hash_size;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1146 <hash+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
or     $0x20,%eax
imul   $0x1f,-0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1112 <hash+0x12>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash+0x2c>
add    $0x1,%rdi
xor    %edx,%edx
mov    %edx,%eax
xchg   %ax,%ax
or     $0x20,%cl
movsbl %cl,%ecx
shl    $0x5,%eax
sub    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1110 <hash+0x10>
jmp    112e <hash+0x2e>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %13, %5 ], [ %0, %2 ]
%9 = or i8 %6, 32
%10 = sext i8 %9 to i32
%11 = mul i32 %7, 31
%12 = add i32 %11, %10
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %12, %5 ]
%18 = urem i32 %17, %1
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ bcm_host_init();
int /*<<< orphan*/ showbitmap(int, int, int);
int main(void) {
  bcm_host_init();
  showbitmap(320, 240, 0);
  showbitmap(320, 240, 1);
  showbitmap(320, 240, 2);
  showbitmap(240, 160, 0);
  showbitmap(400, 272, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <bcm_host_init@plt>
mov    $0x140,%edi
mov    $0xf0,%esi
xor    %edx,%edx
call   1030 <showbitmap@plt>
mov    $0x140,%edi
mov    $0xf0,%esi
mov    $0x1,%edx
call   1030 <showbitmap@plt>
mov    $0x140,%edi
mov    $0xf0,%esi
mov    $0x2,%edx
call   1030 <showbitmap@plt>
mov    $0xf0,%edi
mov    $0xa0,%esi
xor    %edx,%edx
call   1030 <showbitmap@plt>
mov    $0x190,%edi
mov    $0x110,%esi
xor    %edx,%edx
call   1030 <showbitmap@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <bcm_host_init@plt>
mov    $0x140,%edi
mov    $0xf0,%esi
xor    %edx,%edx
call   1030 <showbitmap@plt>
mov    $0x140,%edi
mov    $0xf0,%esi
mov    $0x1,%edx
call   1030 <showbitmap@plt>
mov    $0x140,%edi
mov    $0xf0,%esi
mov    $0x2,%edx
call   1030 <showbitmap@plt>
mov    $0xf0,%edi
mov    $0xa0,%esi
xor    %edx,%edx
call   1030 <showbitmap@plt>
mov    $0x190,%edi
mov    $0x110,%esi
xor    %edx,%edx
call   1030 <showbitmap@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bcm_host_init()
%3 = call i32 @showbitmap(i32 320, i32 240, i32 0)
%4 = call i32 @showbitmap(i32 320, i32 240, i32 1)
%5 = call i32 @showbitmap(i32 320, i32 240, i32 2)
%6 = call i32 @showbitmap(i32 240, i32 160, i32 0)
%7 = call i32 @showbitmap(i32 400, i32 272, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bcm_host_init()
%2 = tail call i32 @showbitmap(i32 320, i32 240, i32 0)
%3 = tail call i32 @showbitmap(i32 320, i32 240, i32 1)
%4 = tail call i32 @showbitmap(i32 320, i32 240, i32 2)
%5 = tail call i32 @showbitmap(i32 240, i32 160, i32 0)
%6 = tail call i32 @showbitmap(i32 400, i32 272, i32 0)
ret i32 0
}
unsigned int f(unsigned int a, unsigned int b, unsigned int c) {
  a += (unsigned short)b * (c >> 16);
  if (!a)
    return 10;
  return a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
movzwl %ax,%eax
mov    -0x10(%rbp),%ecx
shr    $0x10,%ecx
imul   %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1138 <f+0x38>
movl   $0xa,-0x4(%rbp)
jmp    113e <f+0x3e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movzwl %si,%ecx
shr    $0x10,%edx
imul   %edx,%ecx
add    %edi,%ecx
mov    $0xa,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = trunc i32 %8 to i16
%10 = zext i16 %9 to i32
%11 = load i32, i32* %7
%12 = lshr i32 %11, 16
%13 = mul i32 %10, %12
%14 = load i32, i32* %5
%15 = add i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %3
store i32 10, i32* %4
br label %21
19: ; preds = %3
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %19, %18
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %1, 65535
%5 = lshr i32 %2, 16
%6 = mul nuw i32 %5, %4
%7 = add i32 %6, %0
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 10, i32 %7
ret i32 %9
}
/* Variables and functions */
int fact(int);
int binomialCoefficient(int n, int k) {
  return fact(n) / (fact(k) * fact(n - k));
}


x86 assembly (clang, -O0):
<binomialCoefficient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <fact@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binomialCoefficient>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <fact@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <fact@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <fact@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @binomialCoefficient(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @fact(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @fact(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @fact(i32 %11)
%13 = mul nsw i32 %8, %12
%14 = sdiv i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @binomialCoefficient(i32 %0, i32 %1) {
%3 = tail call i32 @fact(i32 %0)
%4 = tail call i32 @fact(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @fact(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
/* Variables and functions */
size_t rb_scan_args_block_idx(char const *);
int rb_scan_args_f_block(const char *fmt) {
  return (fmt[rb_scan_args_block_idx(fmt)] == '&');
}


x86 assembly (clang, -O0):
<rb_scan_args_f_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rb_scan_args_block_idx@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x26,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_scan_args_f_block>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rb_scan_args_block_idx@plt>
xor    %ecx,%ecx
cmpb   $0x26,(%rbx,%rax,1)
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rb_scan_args_f_block(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @rb_scan_args_block_idx(i8* %4)
%6 = getelementptr inbounds i8, i8* %3, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 38
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rb_scan_args_f_block(i8* %0) {
%2 = tail call i64 @rb_scan_args_block_idx(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 %2
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 38
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128Timer3P__Timer__start();
void Atm128TimerInitC__1__Timer__start(void) {
  HplAtm128Timer3P__Timer__start();
}


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

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

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

LLVM IR (-O2):
define void @Atm128TimerInitC__1__Timer__start() {
%1 = tail call i32 (...) @HplAtm128Timer3P__Timer__start()
ret void
}
int main(void) {
  char *str;
  str = my_strstr("hello world", "world");
  if (str != (void *)0)
    while (*str) {
      write(1, str++, 1);
    }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1040 <my_strstr@plt>
cltq
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118e <main+0x6e>
jmp    115a <main+0x3a>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1189 <main+0x69>
mov    -0x10(%rbp),%rsi
mov    %rsi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x1,%edx
mov    %edx,%edi
mov    $0x0,%al
call   1030 <write@plt>
jmp    115a <main+0x3a>
jmp    118e <main+0x6e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
xor    %eax,%eax
call   1040 <my_strstr@plt>
test   %eax,%eax
je     1171 <main+0x51>
movslq %eax,%rbx
cmpb   $0x0,(%rbx)
je     1171 <main+0x51>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%r14
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r14,%rbx
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @my_strstr to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %18
8: ; preds = %0
br label %9
9: ; preds = %13, %8
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
%16 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %14, i32 1)
br label %9
17: ; preds = %9
br label %18
18: ; preds = %17, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [6 x i8] c"world\00"
define i32 @main() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @my_strstr to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = icmp eq i32 %1, 0
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5, %8
%9 = phi i8* [ %10, %8 ], [ %3, %5 ]
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 1, i8* %9, i32 1)
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %8
14: ; preds = %8, %5, %0
ret i32 0
}
char *Realloc(ptr, size)
char *ptr;
int size;
{
  char *new_ptr;
  if (!ptr)
    return (Malloc(size));
  if (!(new_ptr = realloc(ptr, size)))
    Fatal_Error("Out of memory!");
  return (new_ptr);
}


x86 assembly (clang, -O0):
<Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115f <Realloc+0x2f>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1030 <Malloc@plt>
cltq
mov    %rax,-0x8(%rbp)
jmp    1190 <Realloc+0x60>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1188 <Realloc+0x58>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <Fatal_Error@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Realloc>:
push   %rbx
test   %rdi,%rdi
je     1158 <Realloc+0x28>
movslq %esi,%rsi
call   1050 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1164 <Realloc+0x34>
lea    0xeb3(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <Fatal_Error@plt>
jmp    1164 <Realloc+0x34>
mov    %esi,%edi
xor    %eax,%eax
call   1030 <Malloc@plt>
movslq %eax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Out of memory!\00"
define i8* @Realloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i32, i32* %5
%11 = call i32 (i32, ...) bitcast (i32 (...)* @Malloc to i32 (i32, ...)*)(i32 %10)
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = call i8* @realloc(i8* %15, i64 %17)
store i8* %18, i8** %6
%19 = icmp ne i8* %18, null
br i1 %19, label %22, label %20
20: ; preds = %14
%21 = call i32 (i8*, ...) bitcast (i32 (...)* @Fatal_Error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %14
%23 = load i8*, i8** %6
store i8* %23, i8** %3
br label %24
24: ; preds = %22, %9
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
@.str = [15 x i8] c"Out of memory!\00"
define i8* @Realloc(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @Malloc to i32 (i32, ...)*)(i32 %1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
br label %14
8: ; preds = %2
%9 = sext i32 %1 to i64
%10 = tail call i8* @realloc(i8* %0, i64 %9)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 (i8*, ...) bitcast (i32 (...)* @Fatal_Error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %8, %12, %4
%15 = phi i8* [ %7, %4 ], [ null, %12 ], [ %10, %8 ]
ret i8* %15
}
struct pjs *pjs_from_arg(void *arg) {
  return arg;
}


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

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

LLVM IR (-O0):
%struct.pjs = type opaque
define %struct.pjs* @pjs_from_arg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.pjs*
ret %struct.pjs* %4
}

LLVM IR (-O2):
%struct.pjs = type opaque
define %struct.pjs* @pjs_from_arg(i8* readnone %0) {
%2 = bitcast i8* %0 to %struct.pjs*
ret %struct.pjs* %2
}
int rightInt(n) {
  int i;
  for (i = 0; n != 0; i++) {
    n /= 10;
  }
  if (i > 9) {
    printf("Int must not be more than 10 digits \n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<rightInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1148 <rightInt+0x38>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <rightInt+0x12>
cmpl   $0x9,-0xc(%rbp)
jle    116c <rightInt+0x5c>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <rightInt+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightInt>:
mov    $0x1,%eax
test   %edi,%edi
je     115a <rightInt+0x4a>
mov    $0xffffffff,%ecx
xchg   %ax,%ax
movslq %edi,%rdx
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdi
add    %esi,%edi
add    $0x9,%edx
add    $0x1,%ecx
cmp    $0x12,%edx
ja     1120 <rightInt+0x10>
cmp    $0x9,%ecx
jb     115a <rightInt+0x4a>
push   %rax
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Int must not be more than 10 digits \0A\00"
define i32 @rightInt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %11, %1
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sdiv i32 %9, 10
store i32 %10, i32* %3
br label %11
11: ; preds = %8
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
br label %5
14: ; preds = %5
%15 = load i32, i32* %4
%16 = icmp sgt i32 %15, 9
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %20
19: ; preds = %14
store i32 1, i32* %2
br label %20
20: ; preds = %19, %17
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@str = [37 x i8] c"Int must not be more than 10 digits \00"
define i32 @rightInt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = sdiv i32 %5, 10
%7 = add nuw nsw i32 %4, 1
%8 = add i32 %5, 9
%9 = icmp ult i32 %8, 19
br i1 %9, label %10, label %3
10: ; preds = %3
%11 = icmp ugt i32 %4, 8
br i1 %11, label %12, label %14
12: ; preds = %10
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %1, %10, %12
%15 = phi i32 [ 0, %12 ], [ 1, %10 ], [ 1, %1 ]
ret i32 %15
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *yuistrcpy(char *dest, const char *src) { return strcpy(dest, src); }


x86 assembly (clang, -O0):
<yuistrcpy>:
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   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yuistrcpy>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define i8* @yuistrcpy(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 i8* @strcpy(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @yuistrcpy(i8* returned %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %0
}
/* Type definitions */
struct timespec {
  double tv_sec;
  double tv_nsec;
};

/* Variables and functions */
double timespec_todouble(struct timespec ts) {
  return ts.tv_sec + ts.tv_nsec / 1000000000.0;
}


x86 assembly (clang, -O0):
<timespec_todouble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xee0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_todouble>:
divsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { double, double }
define double @timespec_todouble(double %0, double %1) {
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %3 to { double, double }*
%5 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+09
%12 = fadd double %8, %11
ret double %12
}

LLVM IR (-O2):
define double @timespec_todouble(double %0, double %1) {
%3 = fdiv double %1, 1.000000e+09
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x5a() {
  Assert_real((isspace(90) == 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_isspace.c",
              455, ("isspace should be 0 for Z"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x5a>:
push   %rax
mov    $0x5a,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1c7,%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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for Z\00"
define void @t_isspace_0x5a() {
%1 = call i64 @isspace(i32 90)
%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 455, 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_isspace.c\00"
@.str.1 = [26 x i8] c"isspace should be 0 for Z\00"
define void @t_isspace_0x5a() {
%1 = tail call i64 @isspace(i32 90)
%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 455, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void help(void) {
  fprintf(stderr,
          "Usage: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\n"
          "  I2CBUS is an integer or an I2C bus name\n"
          "  ADDRESS is an integer (0x03 - 0x77)\n"
          "  MODE is one of:\n"
          "    b (read byte data, default)\n"
          "    w (read word data)\n"
          "    c (write byte/read byte)\n"
          "    Append p for SMBus PEC\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [276 x i8] c"Usage: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\0A I2CBUS is an integer or an I2C bus name\0A ADDRESS is an integer (0x03 - 0x77)\0A MODE is one of:\0A b (read byte data, default)\0A w (read word data)\0A c (write byte/read byte)\0A Append p for SMBus PEC\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [276 x i8] c"Usage: i2cget [-f] [-y] I2CBUS CHIP-ADDRESS [DATA-ADDRESS [MODE]]\0A I2CBUS is an integer or an I2C bus name\0A ADDRESS is an integer (0x03 - 0x77)\0A MODE is one of:\0A b (read byte data, default)\0A w (read word data)\0A c (write byte/read byte)\0A Append p for SMBus PEC\0A\00"
define void @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int starts_with(char *needle, char *haystack, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (needle[i] != haystack[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<starts_with>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1161 <starts_with+0x61>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     114e <starts_with+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1168 <starts_with+0x68>
jmp    1153 <starts_with+0x53>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <starts_with+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<starts_with>:
mov    $0x1,%eax
test   %edx,%edx
jle    1122 <starts_with+0x22>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
movzbl (%rdi,%rdx,1),%ecx
cmp    (%rsi,%rdx,1),%cl
jne    1123 <starts_with+0x23>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <starts_with+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @starts_with(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %1, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
unsigned int ABS(signed int x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <ABS+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <ABS+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ABS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @ABS(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
void *mm_malloc(size_t size) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @mm_malloc(i64 %0) {
ret i8* null
}
unsigned long msec_to_nsec(unsigned long msec) { return msec * 1000000; }


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

x86 assembly (clang, -O2):
<msec_to_nsec>:
imul   $0xf4240,%rdi,%rax
ret

LLVM IR (-O0):
define i64 @msec_to_nsec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000
ret i64 %4
}

LLVM IR (-O2):
define i64 @msec_to_nsec(i64 %0) {
%2 = mul i64 %0, 1000000
ret i64 %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ height;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
int get_XConfigureRequestEvent_height(void *_p) {
  return (int)((XConfigureRequestEvent *)_p)->height;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XConfigureRequestEvent_height(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XConfigureRequestEvent_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ERR(char *, long, long);
void check_size(long n, long nmax) {
  if (n < 0 || n > nmax)
    ERR("wrong size: %ld / %ld", n, nmax);
}


x86 assembly (clang, -O0):
<check_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     1139 <check_size+0x29>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    114d <check_size+0x3d>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <ERR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_size>:
mov    %rsi,%rdx
mov    %rdi,%rsi
test   %rdi,%rdi
js     1121 <check_size+0x11>
cmp    %rdx,%rsi
jg     1121 <check_size+0x11>
ret
lea    0xed8(%rip),%rdi
jmp    1030 <ERR@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"wrong size: %ld / %ld\00"
define void @check_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp slt i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = icmp sgt i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %7, %2
%12 = load i64, i64* %3
%13 = load i64, i64* %4
%14 = call i32 @ERR(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
br label %15
15: ; preds = %11, %7
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"wrong size: %ld / %ld\00"
define void @check_size(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, 0
%4 = icmp sgt i64 %0, %1
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @ERR(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
br label %8
8: ; preds = %2, %6
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mpga_set_mode_ext(uint8_t *p_mpga, uint8_t i_mode_ext) {
  p_mpga[3] &= ~0x30;
  p_mpga[3] |= (i_mode_ext & 0x3) << 4;
}


x86 assembly (clang, -O0):
<mpga_set_mode_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xffffffcf,%ecx
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpga_set_mode_ext>:
mov    0xc(%rdi),%eax
and    $0xffffffcf,%eax
shl    $0x4,%esi
and    $0x30,%esi
or     %eax,%esi
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @mpga_set_mode_ext(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 3
%7 = load i32, i32* %6
%8 = and i32 %7, -49
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 3
%11 = shl i32 %10, 4
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 3
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @mpga_set_mode_ext(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
%4 = load i32, i32* %3
%5 = and i32 %4, -49
%6 = shl i32 %1, 4
%7 = and i32 %6, 48
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
char *f2(char key) {
  switch (key) {
    static char _msg[40];
  case '\014':
    return _msg;
  }
  return 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
sub    $0xc,%al
jne    112a <f2+0x2a>
jmp    111a <f2+0x1a>
lea    0x2f0f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1132 <f2+0x32>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %eax,%eax
cmp    $0xc,%dil
lea    0x2f23(%rip),%rcx
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@f2._msg = internal global [40 x i8] zeroinitializer
define i8* @f2(i8 signext %0) {
%2 = alloca i8*
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 12, label %6
]
6: ; preds = %1
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @f2._msg, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@f2._msg = internal global [40 x i8] zeroinitializer
define i8* @f2(i8 signext %0) {
%2 = icmp eq i8 %0, 12
%3 = select i1 %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @f2._msg, i64 0, i64 0), i8* null
ret i8* %3
}