#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 hash(char *);
int parse_opt(int, char **);
int /*<<< orphan*/ printf(char *, int, char *);
void main(int argc, char *argv[]) {
  int i, opt;
  opt = parse_opt(argc, argv);
  for (i = 2; i < argc; i++)
    if (opt)
      printf("{%d, (code_ptr)%s},\n", hash(argv[i]), argv[i]);
    else
      printf("%d, // %s\n", hash(argv[i]), argv[i]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <parse_opt@plt>
mov    %eax,-0x18(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11d9 <main+0xa9>
cmpl   $0x0,-0x18(%rbp)
je     119b <main+0x6b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe6f(%rip),%rdi
call   1040 <printf@plt>
jmp    11c6 <main+0x96>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <hash@plt>
mov    %eax,%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
jmp    11cb <main+0x9b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1155 <main+0x25>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1050 <parse_opt@plt>
cmp    $0x3,%ebp
jl     1190 <main+0x60>
test   %eax,%eax
mov    %ebp,%r15d
lea    0xec3(%rip),%rax
lea    0xea7(%rip),%r14
cmove  %rax,%r14
mov    $0x2,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%rbp,8),%rdi
call   1030 <hash@plt>
mov    (%rbx,%rbp,8),%rdx
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1170 <main+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"{%d, (code_ptr)%s},\0A\00"
@.str.1 = [11 x i8] c"%d, // %s\0A\00"
define void @main(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
%7 = load i32, i32* %3
%8 = load i8**, i8*** %4
%9 = call i32 @parse_opt(i32 %7, i8** %8)
store i32 %9, i32* %6
store i32 2, i32* %5
br label %10
10: ; preds = %44, %2
%11 = load i32, i32* %5
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %47
14: ; preds = %10
%15 = load i32, i32* %6
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i8**, i8*** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @hash(i8* %22)
%24 = load i8**, i8*** %4
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %23, i8* %28)
br label %43
30: ; preds = %14
%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 = call i32 @hash(i8* %35)
%37 = load i8**, i8*** %4
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %36, i8* %41)
br label %43
43: ; preds = %30, %17
br label %44
44: ; preds = %43
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %10
47: ; preds = %10
ret void
}

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