#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*/ printf(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  int i = 0;
  if (argc > 0) {
    for (i = 0; i < argc; i++) {
      printf("%s\n", argv[i]);
    }
  }
  while (*envp != NULL) {
    printf("%s\n", *envp);
    *envp++;
  }
  return 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    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1179 <main+0x69>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1174 <main+0x64>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <main+0x32>
jmp    1179 <main+0x69>
jmp    117e <main+0x6e>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     11b0 <main+0xa0>
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    117e <main+0x6e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r13
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed1(%rip),%r15
nop
mov    (%r14,%rbx,8),%rsi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
mov    0x0(%r13),%rsi
test   %rsi,%rsi
je     1175 <main+0x65>
add    $0x8,%r13
lea    0xea7(%rip),%r14
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x0(%r13),%rsi
add    $0x8,%r13
test   %rsi,%rsi
jne    1160 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
%15 = load i8*, i8** %2
%16 = icmp eq i8* %15, null
br i1 %16, label %24, label %17
17: ; preds = %14, %17
%18 = phi i8* [ %22, %17 ], [ %15, %14 ]
%19 = phi i8** [ %21, %17 ], [ %2, %14 ]
%20 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, 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 %17
24: ; preds = %17, %14
ret i32 0
}