#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 *, ...);
int main(int argc, char *argv[]) {
  int i;
  int j;
  for (i = 0; i < argc; i++)
    printf("%s\n", argv[i]);
  for (j = 0; j < argc; j++) {
    printf("%s\n", argv[j]);
    printf("%d\n", j);
  }
}


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)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1161 <main+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ad <main+0x9d>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <main+0x58>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    117e <main+0x5e>
mov    %rsi,%r15
mov    %edi,%r14d
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbp,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1140 <main+0x20>
test   %r14d,%r14d
jle    117e <main+0x5e>
lea    0xea2(%rip),%r14
xor    %ebp,%ebp
mov    (%r15,%rbp,8),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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