#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 */
scalar_t__ get_line(char *, int /*<<< orphan*/);
char *mnemonic2words(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ stdin;
main(int argc, char **argv) {
  char buffer[1024 + 1];
  if (argc == 1) {
    while (get_line(buffer, stdin))
      printf("%s\n", mnemonic2words(buffer));
  } else {
    while (--argc)
      printf("%s\n", mnemonic2words(*++argv));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    119c <main+0x6c>
jmp    1158 <main+0x28>
lea    -0x420(%rbp),%rdi
mov    0x2e82(%rip),%rax
mov    (%rax),%esi
call   1030 <get_line@plt>
cmp    $0x0,%rax
je     1197 <main+0x67>
lea    -0x420(%rbp),%rdi
call   1050 <mnemonic2words@plt>
mov    %rax,%rsi
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
jmp    1158 <main+0x28>
jmp    11e4 <main+0xb4>
jmp    11a1 <main+0x71>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     11df <main+0xaf>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1050 <mnemonic2words@plt>
mov    %rax,%rsi
lea    0xe2b(%rip),%rdi
call   1040 <printf@plt>
jmp    11a1 <main+0x71>
jmp    11e4 <main+0xb4>
mov    -0x4(%rbp),%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x408,%rsp
cmp    $0x1,%edi
jne    1195 <main+0x65>
mov    0x2e9e(%rip),%r15
mov    (%r15),%esi
mov    %rsp,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
je     11cd <main+0x9d>
mov    %rsp,%rbx
lea    0xe9c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1050 <mnemonic2words@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1030 <get_line@plt>
test   %rax,%rax
jne    1170 <main+0x40>
jmp    11cd <main+0x9d>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xe59(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
call   1050 <mnemonic2words@plt>
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %ebx,%r12d
jne    11b0 <main+0x80>
xor    %eax,%eax
add    $0x408,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1025 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %20
9: ; preds = %2
br label %10
10: ; preds = %15, %9
%11 = getelementptr inbounds [1025 x i8], [1025 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* @stdin
%13 = call i64 @get_line(i8* %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = getelementptr inbounds [1025 x i8], [1025 x i8]* %6, i64 0, i64 0
%17 = call i8* @mnemonic2words(i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %10
19: ; preds = %10
br label %32
20: ; preds = %2
br label %21
21: ; preds = %25, %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, -1
store i32 %23, i32* %4
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i32 1
store i8** %27, i8*** %5
%28 = load i8*, i8** %27
%29 = call i8* @mnemonic2words(i8* %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %29)
br label %21
31: ; preds = %21
br label %32
32: ; preds = %31, %19
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1025 x i8]
%4 = getelementptr inbounds [1025 x i8], [1025 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, 1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = add nsw i32 %0, -1
br label %18
8: ; preds = %2
%9 = load i32, i32* @stdin
%10 = call i64 @get_line(i8* %4, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %27, label %12
12: ; preds = %8, %12
%13 = call i8* @mnemonic2words(i8* %4)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = load i32, i32* @stdin
%16 = call i64 @get_line(i8* %4, i32 %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %27, label %12
18: ; preds = %6, %18
%19 = phi i32 [ %25, %18 ], [ %7, %6 ]
%20 = phi i8** [ %21, %18 ], [ %1, %6 ]
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = tail call i8* @mnemonic2words(i8* %22)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = add nsw i32 %19, -1
%26 = icmp eq i32 %25, 0
br i1 %26, label %27, label %18
27: ; preds = %18, %12, %8
ret i32 0
}