#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*/ read_minds(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(int ac, char **av) {
  int f_it;
  f_it = 0;
  while ((++f_it) < ac) {
    if (!read_minds(av[f_it]))
      write(2, "map error\n", 10);
    if (f_it < ac - 1)
      write(1, "\n", 1);
  }
  if (ac == 1)
    if (!read_minds(0))
      write(2, "map error\n", 10);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmp    -0x8(%rbp),%eax
jge    11a8 <main+0x88>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <read_minds@plt>
cmp    $0x0,%eax
jne    117f <main+0x5f>
mov    $0x2,%edi
lea    0xe8b(%rip),%rsi
mov    $0xa,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11a3 <main+0x83>
mov    $0x1,%edx
lea    0xe6d(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
jmp    113d <main+0x1d>
cmpl   $0x1,-0x8(%rbp)
jne    11df <main+0xbf>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <read_minds@plt>
cmp    $0x0,%eax
jne    11da <main+0xba>
mov    $0x2,%edi
lea    0xe30(%rip),%rsi
mov    $0xa,%edx
call   1040 <write@plt>
jmp    11df <main+0xbf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edi,%r14d
cmp    $0x2,%edi
jl     119f <main+0x7f>
mov    %rsi,%r13
lea    -0x1(%r14),%ebx
mov    %r14d,%ebp
mov    $0x1,%r15d
lea    0xebf(%rip),%r12
jmp    1159 <main+0x39>
nopl   0x0(%rax)
add    $0x1,%r15
cmp    %r15,%rbp
je     119f <main+0x7f>
mov    0x0(%r13,%r15,8),%rdi
call   1030 <read_minds@plt>
test   %eax,%eax
je     1170 <main+0x50>
cmp    %rbx,%r15
jae    1150 <main+0x30>
jmp    118b <main+0x6b>
xchg   %ax,%ax
mov    $0x2,%edi
lea    0xe84(%rip),%rsi
mov    $0xa,%edx
call   1040 <write@plt>
cmp    %rbx,%r15
jae    1150 <main+0x30>
mov    $0x1,%edi
mov    %r12,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
jmp    1150 <main+0x30>
cmp    $0x1,%r14d
jne    11c6 <main+0xa6>
xor    %edi,%edi
call   1030 <read_minds@plt>
test   %eax,%eax
jne    11c6 <main+0xa6>
lea    0xe49(%rip),%rsi
mov    $0x2,%edi
mov    $0xa,%edx
call   1040 <write@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"map error\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %29, %2
%8 = load i32, i32* %6
%9 = add nsw i32 %8, 1
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %30
12: ; preds = %7
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @read_minds(i8* %17)
%19 = icmp ne i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %12
%21 = call i32 @write(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
br label %22
22: ; preds = %20, %12
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 1
%26 = icmp slt i32 %23, %25
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %29
29: ; preds = %27, %22
br label %7
30: ; preds = %7
%31 = load i32, i32* %4
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %39
33: ; preds = %30
%34 = call i32 @read_minds(i8* null)
%35 = icmp ne i32 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = call i32 @write(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
br label %38
38: ; preds = %36, %33
br label %39
39: ; preds = %38, %30
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"map error\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %23
4: ; preds = %2
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i64
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %4, %20
%9 = phi i64 [ 1, %4 ], [ %21, %20 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @read_minds(i8* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
br label %16
16: ; preds = %14, %8
%17 = icmp ult i64 %9, %6
br i1 %17, label %18, label %20
18: ; preds = %16
%19 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %20
20: ; preds = %18, %16
%21 = add nuw nsw i64 %9, 1
%22 = icmp eq i64 %21, %7
br i1 %22, label %23, label %8
23: ; preds = %20, %2
%24 = icmp eq i32 %0, 1
br i1 %24, label %25, label %30
25: ; preds = %23
%26 = tail call i32 @read_minds(i8* null)
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
br label %30
30: ; preds = %25, %28, %23
ret i32 0
}