#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
char *get_array1(int *, int);
int /*<<< orphan*/ stderr;
void rd_stacks(int stacks[7 + 1][7 + 1]) {
  int i;
  char *cp;
  for (i = 1; i <= 7; i++) {
    cp = get_array1(stacks[i] + 1, 7);
    if (cp) {
      fprintf(stderr, "\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)
movl   $0x1,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jg     11af <rd_stacks+0x7f>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rdi
add    $0x4,%rdi
mov    $0x7,%esi
call   1040 <get_array1@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     119c <rd_stacks+0x6c>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xe73(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
jmp    11a1 <rd_stacks+0x71>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <rd_stacks+0x13>
add    $0x20,%rsp
pop    %rbp
ret

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

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

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