#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, char *, ...);
int main(int argc, char *argv[]) {
  int i = 0;
  for (i = 1; i < argc; i++) {
    printf("arg %d: %s\n", i, argv[i]);
  }
  char *states[] = {"California", "Oregon", "Washington", "Texas", NULL, NULL};
  int num_states = 6;
  for (i = 0; i < num_states; i++) {
    printf("state %d: %s, %p\n", i, states[i], &(states[i]));
  };
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117b <main+0x5b>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1144 <main+0x24>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    0xe7a(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe7a(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x6,-0x54(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    1208 <main+0xe8>
mov    -0x14(%rbp),%esi
movslq -0x14(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdx
movslq -0x14(%rbp),%rax
lea    -0x50(%rbp),%rcx
shl    $0x3,%rax
add    %rax,%rcx
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c5 <main+0xa5>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x30,%rsp
cmp    $0x2,%edi
jl     1159 <main+0x49>
mov    %rsi,%r14
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xecc(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x30>
lea    0x20(%rsp),%r14
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xe9f(%rip),%rdx
mov    %rdx,(%rsp)
lea    0x8(%rsp),%r13
lea    0xe9a(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%r12
lea    0xe90(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0x18(%rsp),%r15
lea    0xe8a(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe84(%rip),%rbx
mov    %rsp,%rcx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r13,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x10(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %r12,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r15,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x20(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %r14,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x28(%rsp),%rcx
mov    0x28(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"arg %d: %s\0A\00"
@.str.1 = [11 x i8] c"California\00"
@.str.2 = [7 x i8] c"Oregon\00"
@.str.3 = [11 x i8] c"Washington\00"
@.str.4 = [6 x i8] c"Texas\00"
@.str.5 = [18 x i8] c"state %d: %s, %p\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [6 x i8*]
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 1, %5 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %15, label %7
15: ; preds = %7, %2
%16 = bitcast [6 x i8*]* %3 to i8*
%17 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
%18 = bitcast i8** %17 to i8*
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %19
%20 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %20
%21 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %21
%22 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i8** %22
%23 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %19)
%24 = load i8*, i8** %20
%25 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 1, i8* %24, i8** %20)
%26 = load i8*, i8** %21
%27 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 2, i8* %26, i8** %21)
%28 = load i8*, i8** %22
%29 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 3, i8* %28, i8** %22)
%30 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
%31 = load i8*, i8** %30
%32 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 4, i8* %31, i8** %30)
%33 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 5
%34 = load i8*, i8** %33
%35 = call i32 (i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 5, i8* %34, i8** %33)
ret i32 0
}