#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__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
void umain(int argc, char **argv) {
  int i, nflag;
  nflag = 0;
  if (argc > 1 && strcmp(argv[1], "-n") == 0) {
    nflag = 1;
    argc--;
    argv++;
  }
  for (i = 1; i < argc; i++) {
    if (i > 1)
      write(1, " ", 1);
    write(1, argv[i], strlen(argv[i]));
  }
  if (!nflag)
    write(1, "\n", 1);
}


x86 assembly (clang, -O0):
<umain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    118a <umain+0x5a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea1(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    118a <umain+0x5a>
movl   $0x1,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11f9 <umain+0xc9>
cmpl   $0x1,-0x14(%rbp)
jle    11ba <umain+0x8a>
mov    $0x1,%edx
lea    0xe50(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1191 <umain+0x61>
cmpl   $0x0,-0x18(%rbp)
jne    1216 <umain+0xe6>
mov    $0x1,%edx
lea    0xdf6(%rip),%rsi
mov    %edx,%edi
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umain>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11eb <umain+0xbb>
mov    %rsi,%r12
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
lea    0xeac(%rip),%rsi
call   1050 <strcmp@plt>
mov    %rax,%r14
test   %rax,%rax
jne    1171 <umain+0x41>
add    $0xffffffff,%ebp
cmp    $0x2,%ebp
jb     120f <umain+0xdf>
add    $0x8,%r12
mov    0x8(%r12),%r15
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %r15,%rsi
mov    %eax,%edx
call   1030 <write@plt>
cmp    $0x2,%ebp
je     11e6 <umain+0xb6>
mov    %ebp,%r13d
mov    $0x2,%ebx
lea    0xe62(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    (%r12,%rbx,8),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    $0x1,%edi
mov    %rbp,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    11b0 <umain+0x80>
test   %r14,%r14
je     120f <umain+0xdf>
lea    0xe13(%rip),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <write@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-n\00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @umain(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %6
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %20
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %9
store i32 1, i32* %6
%16 = load i32, i32* %3
%17 = add nsw i32 %16, -1
store i32 %17, i32* %3
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %4
br label %20
20: ; preds = %15, %9, %2
store i32 1, i32* %5
br label %21
21: ; preds = %43, %20
%22 = load i32, i32* %5
%23 = load i32, i32* %3
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %46
25: ; preds = %21
%26 = load i32, i32* %5
%27 = icmp sgt i32 %26, 1
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %30
30: ; preds = %28, %25
%31 = load i8**, i8*** %4
%32 = load i32, i32* %5
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = load i8**, i8*** %4
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
%40 = load i8*, i8** %39
%41 = call i32 @strlen(i8* %40)
%42 = call i32 @write(i32 1, i8* %35, i32 %41)
br label %43
43: ; preds = %30
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %21
46: ; preds = %21
%47 = load i32, i32* %6
%48 = icmp ne i32 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %51
51: ; preds = %49, %46
ret void
}

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