#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*/ cardline;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printcard(char *);
int /*<<< orphan*/ stdin;
int main(int argc, char **argv) {
  char cardline[80];
  if (argc > 1) {
    while (--argc)
      printcard(*++argv);
  } else
    while (fgets(cardline, sizeof(cardline), stdin))
      printcard(cardline);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1189 <main+0x59>
jmp    1155 <main+0x25>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1184 <main+0x54>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <printcard@plt>
jmp    1155 <main+0x25>
jmp    11c2 <main+0x92>
jmp    118e <main+0x5e>
lea    -0x60(%rbp),%rdi
mov    0x2e4f(%rip),%rax
mov    (%rax),%edx
mov    $0x50,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
je     11bd <main+0x8d>
lea    -0x60(%rbp),%rdi
call   1030 <printcard@plt>
jmp    118e <main+0x5e>
jmp    11c2 <main+0x92>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
cmp    $0x1,%edi
jle    1164 <main+0x34>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <printcard@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1150 <main+0x20>
jmp    11ad <main+0x7d>
mov    0x2e7d(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     11ad <main+0x7d>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
call   1030 <printcard@plt>
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1040 <fgets@plt>
test   %rax,%rax
jne    1190 <main+0x60>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %20
9: ; preds = %2
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i32 1
store i8** %16, i8*** %5
%17 = load i8*, i8** %16
%18 = call i32 @printcard(i8* %17)
br label %10
19: ; preds = %10
br label %30
20: ; preds = %2
br label %21
21: ; preds = %26, %20
%22 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i64 @fgets(i8* %22, i32 80, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%28 = call i32 @printcard(i8* %27)
br label %21
29: ; preds = %21
br label %30
30: ; preds = %29, %19
%31 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [80 x i8]
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = icmp sgt i32 %0, 1
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stdin
%8 = call i64 @fgets(i8* %4, i32 80, i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %25, label %20
10: ; preds = %2
%11 = add nsw i32 %0, -1
br label %12
12: ; preds = %10, %12
%13 = phi i32 [ %18, %12 ], [ %11, %10 ]
%14 = phi i8** [ %15, %12 ], [ %1, %10 ]
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = tail call i32 @printcard(i8* %16)
%18 = add nsw i32 %13, -1
%19 = icmp eq i32 %18, 0
br i1 %19, label %25, label %12
20: ; preds = %6, %20
%21 = call i32 @printcard(i8* %4)
%22 = load i32, i32* @stdin
%23 = call i64 @fgets(i8* %4, i32 80, i32 %22)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %20
25: ; preds = %20, %12, %6
%26 = call i32 @exit(i32 0)
unreachable
}