#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *get_array1(int *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void rd_stacks(int stacks[7 + 1][7 + 1], FILE *fp) {
  int i;
  char *cp;
  for (i = 1; i <= 7; i++) {
    cp = get_array1(stacks[i] + 1, 7, fp);
    if (cp) {
      fprintf(stderr, "convert_epars: \nrd_stacks: %s\n", cp);
      exit(1);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<rd_stacks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x7,-0x14(%rbp)
jg     11b7 <rd_stacks+0x87>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    -0x10(%rbp),%rdx
mov    $0x7,%esi
call   1040 <get_array1@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11a4 <rd_stacks+0x74>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe6b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11a9 <rd_stacks+0x79>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <rd_stacks+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_stacks>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x24,%rdi
mov    $0x7,%esi
mov    %r14,%rdx
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11f3 <rd_stacks+0xc3>
lea    0x44(%rbx),%rdi
mov    $0x7,%esi
mov    %r14,%rdx
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11f3 <rd_stacks+0xc3>
lea    0x64(%rbx),%rdi
mov    $0x7,%esi
mov    %r14,%rdx
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11f3 <rd_stacks+0xc3>
lea    0x84(%rbx),%rdi
mov    $0x7,%esi
mov    %r14,%rdx
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11f3 <rd_stacks+0xc3>
lea    0xa4(%rbx),%rdi
mov    $0x7,%esi
mov    %r14,%rdx
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11f3 <rd_stacks+0xc3>
lea    0xc4(%rbx),%rdi
mov    $0x7,%esi
mov    %r14,%rdx
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11f3 <rd_stacks+0xc3>
add    $0xe4,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r14,%rdx
call   1040 <get_array1@plt>
test   %rax,%rax
jne    11f3 <rd_stacks+0xc3>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2de6(%rip),%rcx
mov    (%rcx),%edi
lea    0xdfd(%rip),%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"convert_epars: \0Ard_stacks: %s\0A\00"
define void @rd_stacks([8 x i32]* %0, i32* %1) {
%3 = alloca [8 x i32]*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store [8 x i32]* %0, [8 x i32]** %3
store i32* %1, i32** %4
store i32 1, i32* %5
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %5
%9 = icmp sle i32 %8, 7
br i1 %9, label %10, label %30
10: ; preds = %7
%11 = load [8 x i32]*, [8 x i32]** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [8 x i32], [8 x i32]* %11, i64 %13
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 0
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32*, i32** %4
%18 = call i8* @get_array1(i32* %16, i32 7, i32* %17)
store i8* %18, i8** %6
%19 = load i8*, i8** %6
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %26
21: ; preds = %10
%22 = load i32, i32* @stderr
%23 = load i8*, i8** %6
%24 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 1)
unreachable
26: ; preds = %10
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %7
30: ; preds = %7
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"convert_epars: \0Ard_stacks: %s\0A\00"
define void @rd_stacks([8 x i32]* %0, i32* %1) {
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 1, i64 1
%4 = tail call i8* @get_array1(i32* %3, i32 7, i32* %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %31
6: ; preds = %2
%7 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 2, i64 1
%8 = tail call i8* @get_array1(i32* %7, i32 7, i32* %1)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 3, i64 1
%12 = tail call i8* @get_array1(i32* %11, i32 7, i32* %1)
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %31
14: ; preds = %10
%15 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 4, i64 1
%16 = tail call i8* @get_array1(i32* %15, i32 7, i32* %1)
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %31
18: ; preds = %14
%19 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 5, i64 1
%20 = tail call i8* @get_array1(i32* %19, i32 7, i32* %1)
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %31
22: ; preds = %18
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 6, i64 1
%24 = tail call i8* @get_array1(i32* %23, i32 7, i32* %1)
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 7, i64 1
%28 = tail call i8* @get_array1(i32* %27, i32 7, i32* %1)
%29 = icmp eq i8* %28, null
br i1 %29, label %30, label %31
30: ; preds = %26
ret void
31: ; preds = %26, %22, %18, %14, %10, %6, %2
%32 = phi i8* [ %4, %2 ], [ %8, %6 ], [ %12, %10 ], [ %16, %14 ], [ %20, %18 ], [ %24, %22 ], [ %28, %26 ]
%33 = load i32, i32* @stderr
%34 = tail call i32 @fprintf(i32 %33, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %32)
%35 = tail call i32 @exit(i32 1)
unreachable
}