#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__ error(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printwords(char *);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (error(argc))
    return 1;
  *argv++;
  if (strcmp(*argv, "-v") == 0) {
    printf("dozword v3.0\n");
    printf("Copyright (C) 2010, 2011  Donald P. Goodman III\n");
    printf("License GPLv3+:  GNU GPL version 3 or "
           "later <http://gnu.org/licenses/gpl.html>\n");
    printf("This is free software:  you are free "
           "to change and redistribute it.  There is NO "
           "WARRANTY, to the extent permitted by law.\n");
    return 0;
  }
  printwords(*argv);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <error@plt>
cmp    $0x0,%rax
je     1174 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    11f8 <main+0xb8>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
lea    0xe72(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11d9 <main+0x99>
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11f8 <main+0xb8>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1060 <printwords@plt>
lea    0xf20(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
call   1060 <error@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1168 <main+0x18>
pop    %rbx
ret
mov    0x8(%rbx),%rdi
lea    0xe8d(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1192 <main+0x42>
mov    0x8(%rbx),%rdi
call   1070 <printwords@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11c2 <main+0x72>
lea    0xe6a(%rip),%rdi
call   1040 <puts@plt>
lea    0xe6b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe8f(%rip),%rdi
call   1040 <puts@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"-v\00"
@.str.1 = [14 x i8] c"dozword v3.0\0A\00"
@.str.2 = [49 x i8] c"Copyright (C) 2010, 2011 Donald P. Goodman III\0A\00"
@.str.3 = [80 x i8] c"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\0A\00"
@.str.4 = [124 x i8] c"This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = call i64 @error(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %28
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i32 1
store i8** %12, i8*** %5
%13 = load i8*, i8** %11
%14 = load i8**, i8*** %5
%15 = load i8*, i8** %14
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %10
%19 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([124 x i8], [124 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %28
23: ; preds = %10
%24 = load i8**, i8*** %5
%25 = load i8*, i8** %24
%26 = call i32 @printwords(i8* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %3
br label %28
28: ; preds = %23, %18, %9
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@.str = [3 x i8] c"-v\00"
@str = [13 x i8] c"dozword v3.0\00"
@str.6 = [48 x i8] c"Copyright (C) 2010, 2011 Donald P. Goodman III\00"
@str.7 = [79 x i8] c"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\00"
@str.8 = [123 x i8] c"This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i64 @error(i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %19
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.6, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @str.7, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([123 x i8], [123 x i8]* @str.8, i64 0, i64 0))
br label %19
15: ; preds = %5
%16 = load i8*, i8** %6
%17 = tail call i32 @printwords(i8* %16)
%18 = tail call i32 @putchar(i32 10)
br label %19
19: ; preds = %2, %15, %10
%20 = phi i32 [ 0, %10 ], [ 0, %15 ], [ 1, %2 ]
ret i32 %20
}