#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fexpect(char *, int, short, short);
void verify_short(short *expected, short *got, int len) {
  for (int i = 0; i < len; i++)
    fexpect(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c",
        12, expected[i], got[i]);
  ;
}


x86 assembly (clang, -O0):
<verify_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1170 <verify_short+0x60>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,2),%dx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
lea    0xeaf(%rip),%rdi
mov    $0xc,%esi
movswl %dx,%edx
movswl (%rax,%rcx,2),%ecx
call   1030 <fexpect@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <verify_short+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_short>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    1150 <verify_short+0x40>
mov    %rsi,%r14
mov    %rdi,%r12
mov    %edx,%r13d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
movswl (%r12,%rbx,2),%edx
movswl (%r14,%rbx,2),%ecx
mov    %r15,%rdi
mov    $0xc,%esi
call   1030 <fexpect@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1130 <verify_short+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c\00"
define void @verify_short(i16* %0, i16* %1, i32 %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i32
%7 = alloca i32
store i16* %0, i16** %4
store i16* %1, i16** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %27
12: ; preds = %8
%13 = load i16*, i16** %4
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i16, i16* %13, i64 %15
%17 = load i16, i16* %16
%18 = load i16*, i16** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i16, i16* %18, i64 %20
%22 = load i16, i16* %21
%23 = call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 12, i16 signext %17, i16 signext %22)
br label %24
24: ; preds = %12
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %8
27: ; preds = %8
ret void
}

LLVM IR (-O2):
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/8cc/refs/heads/master/test/initializer.c\00"
define void @verify_short(i16* nocapture %0, i16* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %8
7: ; preds = %8, %3
ret void
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %15, %8 ]
%10 = getelementptr inbounds i16, i16* %0, i64 %9
%11 = load i16, i16* %10
%12 = getelementptr inbounds i16, i16* %1, i64 %9
%13 = load i16, i16* %12
%14 = tail call i32 @fexpect(i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 12, i16 signext %11, i16 signext %13)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %6
br i1 %16, label %7, label %8
}