#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 cio_read(int);
void jpip_read_mhix(int len) {
  int i, v, marker_type, marker_start_pos, marker_len, marker_remains;
  v = (len - 8) / 14;
  for (i = 0; i < v; i++) {
    marker_type = cio_read(2);
    marker_remains = cio_read(2);
    marker_start_pos = cio_read(2);
    marker_len = cio_read(2);
  }
}


x86 assembly (clang, -O0):
<jpip_read_mhix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1181 <jpip_read_mhix+0x71>
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x14(%rbp)
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <jpip_read_mhix+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jpip_read_mhix>:
push   %rbx
cmp    $0x16,%edi
jl     115d <jpip_read_mhix+0x4d>
add    $0xfffffff8,%edi
shr    %edi
mov    $0x92492493,%ebx
imul   %rdi,%rbx
shr    $0x22,%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    $0x2,%edi
call   1030 <cio_read@plt>
mov    $0x2,%edi
call   1030 <cio_read@plt>
add    $0xffffffff,%ebx
jne    1130 <jpip_read_mhix+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @jpip_read_mhix(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %2
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 8
%11 = sdiv i32 %10, 14
store i32 %11, i32* %4
store i32 0, i32* %3
br label %12
12: ; preds = %21, %1
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %24
16: ; preds = %12
%17 = call i32 @cio_read(i32 2)
store i32 %17, i32* %5
%18 = call i32 @cio_read(i32 2)
store i32 %18, i32* %8
%19 = call i32 @cio_read(i32 2)
store i32 %19, i32* %6
%20 = call i32 @cio_read(i32 2)
store i32 %20, i32* %7
br label %21
21: ; preds = %16
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
store i32 %23, i32* %3
br label %12
24: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @jpip_read_mhix(i32 %0) {
%2 = icmp sgt i32 %0, 21
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -8
%5 = udiv i32 %4, 14
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ 0, %3 ]
%8 = tail call i32 @cio_read(i32 2)
%9 = tail call i32 @cio_read(i32 2)
%10 = tail call i32 @cio_read(i32 2)
%11 = tail call i32 @cio_read(i32 2)
%12 = add nuw nsw i32 %7, 1
%13 = icmp eq i32 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %1
ret void
}