#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*/ LC_ALL;
int /*<<< orphan*/ exit(int);
scalar_t__ ferror(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ setprogname(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int nflag;
  setprogname(argv[0]);
  (void)setlocale(LC_ALL, "");
  if (*++argv && !strcmp(*argv, "-n")) {
    ++argv;
    nflag = 1;
  } else
    nflag = 0;
  while (*argv) {
    (void)printf("%s", *argv);
    if (*++argv)
      (void)putchar(' ');
  }
  if (nflag == 0)
    (void)putchar('\n');
  fflush(stdout);
  if (ferror(stdout))
    exit(1);
  exit(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)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <setprogname@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%edi
lea    0xe50(%rip),%rsi
call   1080 <setlocale@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1205 <main+0x85>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe21(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1205 <main+0x85>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
jmp    120c <main+0x8c>
movl   $0x0,-0x14(%rbp)
jmp    1211 <main+0x91>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     125b <main+0xdb>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xdd6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
cmpq   $0x0,0x8(%rax)
je     1256 <main+0xd6>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    1211 <main+0x91>
cmpl   $0x0,-0x14(%rbp)
jne    126f <main+0xef>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2d6a(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    0x2d5c(%rip),%rax
mov    (%rax),%edi
call   1040 <ferror@plt>
cmp    $0x0,%rax
je     129f <main+0x11f>
mov    $0x1,%edi
call   1090 <exit@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    (%rsi),%rdi
call   10a0 <setprogname@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
call   1080 <setlocale@plt>
mov    0x8(%rbx),%rdi
test   %rdi,%rdi
je     121b <main+0x9b>
lea    0x8(%rbx),%rbp
lea    0xe48(%rip),%rsi
call   1060 <strcmp@plt>
mov    %eax,%r14d
lea    0x10(%rbx),%rax
xor    %ecx,%ecx
test   %r14d,%r14d
sete   %cl
cmove  %rax,%rbp
mov    0x8(%rbx,%rcx,8),%rsi
test   %rsi,%rsi
je     1216 <main+0x96>
add    $0x8,%rbp
lea    0xe1e(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1050 <printf@plt>
cmpq   $0x0,0x0(%rbp)
je     1216 <main+0x96>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    0x0(%rbp),%rsi
add    $0x8,%rbp
test   %rsi,%rsi
jne    11f0 <main+0x70>
test   %r14d,%r14d
je     1225 <main+0xa5>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2db4(%rip),%rbx
mov    (%rbx),%edi
call   1070 <fflush@plt>
mov    (%rbx),%edi
call   1040 <ferror@plt>
test   %rax,%rax
jne    1246 <main+0xc6>
xor    %edi,%edi
call   1090 <exit@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [3 x i8] c"%s\00"
@stdout = global i32 0
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
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @setprogname(i8* %9)
%11 = load i32, i32* @LC_ALL
%12 = call i32 @setlocale(i32 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i32 1
store i8** %14, i8*** %5
%15 = load i8*, i8** %14
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %25
17: ; preds = %2
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = call i32 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp ne i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i32 1
store i8** %24, i8*** %5
store i32 1, i32* %6
br label %26
25: ; preds = %17, %2
store i32 0, i32* %6
br label %26
26: ; preds = %25, %22
br label %27
27: ; preds = %41, %26
%28 = load i8**, i8*** %5
%29 = load i8*, i8** %28
%30 = icmp ne i8* %29, null
br i1 %30, label %31, label %42
31: ; preds = %27
%32 = load i8**, i8*** %5
%33 = load i8*, i8** %32
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %33)
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i32 1
store i8** %36, i8*** %5
%37 = load i8*, i8** %36
%38 = icmp ne i8* %37, null
br i1 %38, label %39, label %41
39: ; preds = %31
%40 = call i32 @putchar(i8 signext 32)
br label %41
41: ; preds = %39, %31
br label %27
42: ; preds = %27
%43 = load i32, i32* %6
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @putchar(i8 signext 10)
br label %47
47: ; preds = %45, %42
%48 = load i32, i32* @stdout
%49 = call i32 @fflush(i32 %48)
%50 = load i32, i32* @stdout
%51 = call i64 @ferror(i32 %50)
%52 = icmp ne i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %47
%54 = call i32 @exit(i32 1)
unreachable
55: ; preds = %47
%56 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"-n\00"
@.str.2 = [3 x i8] c"%s\00"
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @setprogname(i8* %3)
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = icmp eq i8* %8, null
br i1 %9, label %30, label %10
10: ; preds = %2
%11 = tail call i32 @strcmp(i8* %8, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = select i1 %12, i8** %13, i8** %7
%15 = load i8*, i8** %14
%16 = icmp eq i8* %15, null
br i1 %16, label %29, label %17
17: ; preds = %10, %25
%18 = phi i8* [ %27, %25 ], [ %15, %10 ]
%19 = phi i8** [ %21, %25 ], [ %14, %10 ]
%20 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %18)
%21 = getelementptr inbounds i8*, i8** %19, i64 1
%22 = load i8*, i8** %21
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %25
24: ; preds = %17
br i1 %12, label %32, label %30
25: ; preds = %17
%26 = tail call i32 @putchar(i8 signext 32)
%27 = load i8*, i8** %21
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %17
29: ; preds = %25, %10
br i1 %12, label %32, label %30
30: ; preds = %2, %24, %29
%31 = tail call i32 @putchar(i8 signext 10)
br label %32
32: ; preds = %24, %30, %29
%33 = load i32, i32* @stdout
%34 = tail call i32 @fflush(i32 %33)
%35 = load i32, i32* @stdout
%36 = tail call i64 @ferror(i32 %35)
%37 = icmp eq i64 %36, 0
br i1 %37, label %40, label %38
38: ; preds = %32
%39 = tail call i32 @exit(i32 1)
unreachable
40: ; preds = %32
%41 = tail call i32 @exit(i32 0)
unreachable
}