#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[]) {
  char *santi[] = {"Mico", "Padre Pio", "Il Master", "San Sebastiano"};
  int i = argc - 1;
  while (i > -1) {
    printf("arg %d: %s\n", i + 1, argv[i]);
    i--;
  }
  int num_states = 4;
  i = num_states - 1;
  while (i > -1) {
    printf("Santo n°%d: %s\n", i + 1, santi[i]);
    i--;
  }
  i = 0;
  while (i < argc && i < num_states) {
    santi[i] = argv[i];
    printf("Nuovo Santo n°%d: %s\n", i + 1, santi[i]);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2cd3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0x2cd0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ccd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jle    1191 <main+0x81>
mov    -0x34(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    115b <main+0x4b>
movl   $0x4,-0x38(%rbp)
mov    -0x38(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
cmpl   $0xffffffff,-0x34(%rbp)
jle    11d4 <main+0xc4>
mov    -0x34(%rbp),%esi
add    $0x1,%esi
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdx
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    11a1 <main+0x91>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0x39(%rbp)
jge    11f8 <main+0xe8>
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
setl   %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    1208 <main+0xf8>
jmp    1246 <main+0x136>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
movslq -0x34(%rbp),%rax
mov    %rcx,-0x30(%rbp,%rax,8)
mov    -0x34(%rbp),%esi
add    $0x1,%esi
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdx
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11db <main+0xcb>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    11e9 <main+0xd9>
mov    %rsi,%r12
mov    %edi,%r14d
mov    %edi,%ebp
lea    0xef9(%rip),%r15
nop
lea    -0x1(%rbp),%rbx
mov    %ebx,%eax
mov    (%r12,%rax,8),%rdx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    $0x1,%rbp
mov    %rbx,%rbp
ja     1130 <main+0x20>
lea    0xee6(%rip),%rbp
lea    0xebe(%rip),%rdx
mov    %rbp,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xea0(%rip),%rdx
mov    $0x3,%r15d
mov    %rbp,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xe7c(%rip),%rdx
mov    %rbp,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xe63(%rip),%rdx
mov    %rbp,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
test   %r14d,%r14d
jle    1240 <main+0x130>
add    $0xffffffff,%r14d
cmp    $0x3,%r14d
cmovb  %r14d,%r15d
add    $0x1,%r15d
xor    %ebp,%ebp
lea    0xe68(%rip),%r14
nopl   0x0(%rax)
mov    (%r12,%rbp,8),%rdx
add    $0x1,%rbp
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
cmp    %rbp,%r15
jne    11d0 <main+0xc0>
jmp    1240 <main+0x130>
lea    0xe4a(%rip),%rbx
lea    0xe22(%rip),%rdx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xe04(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xde6(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xdcd(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Mico\00"
@.str.1 = [10 x i8] c"Padre Pio\00"
@.str.2 = [10 x i8] c"Il Master\00"
@.str.3 = [15 x i8] c"San Sebastiano\00"
@__const.main.santi = [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [12 x i8] c"arg %d: %s\0A\00"
@.str.5 = [17 x i8] c"Santo n\C2\B0%d: %s\0A\00"
@.str.6 = [23 x i8] c"Nuovo Santo n\C2\B0%d: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8*]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [4 x i8*]* %6 to i8*
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %7
br label %12
12: ; preds = %15, %2
%13 = load i32, i32* %7
%14 = icmp sgt i32 %13, -1
br i1 %14, label %15, label %26
15: ; preds = %12
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
%18 = load i8**, i8*** %5
%19 = load i32, i32* %7
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %17, i8* %22)
%24 = load i32, i32* %7
%25 = add nsw i32 %24, -1
store i32 %25, i32* %7
br label %12
26: ; preds = %12
store i32 4, i32* %8
%27 = load i32, i32* %8
%28 = sub nsw i32 %27, 1
store i32 %28, i32* %7
br label %29
29: ; preds = %32, %26
%30 = load i32, i32* %7
%31 = icmp sgt i32 %30, -1
br i1 %31, label %32, label %42
32: ; preds = %29
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
%35 = load i32, i32* %7
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %34, i8* %38)
%40 = load i32, i32* %7
%41 = add nsw i32 %40, -1
store i32 %41, i32* %7
br label %29
42: ; preds = %29
store i32 0, i32* %7
br label %43
43: ; preds = %53, %42
%44 = load i32, i32* %7
%45 = load i32, i32* %4
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %51
47: ; preds = %43
%48 = load i32, i32* %7
%49 = load i32, i32* %8
%50 = icmp slt i32 %48, %49
br label %51
51: ; preds = %47, %43
%52 = phi i1 [ false, %43 ], [ %50, %47 ]
br i1 %52, label %53, label %71
53: ; preds = %51
%54 = load i8**, i8*** %5
%55 = load i32, i32* %7
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8*, i8** %54, i64 %56
%58 = load i8*, i8** %57
%59 = load i32, i32* %7
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %60
store i8* %58, i8** %61
%62 = load i32, i32* %7
%63 = add nsw i32 %62, 1
%64 = load i32, i32* %7
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [4 x i8*], [4 x i8*]* %6, i64 0, i64 %65
%67 = load i8*, i8** %66
%68 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %63, i8* %67)
%69 = load i32, i32* %7
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %43
71: ; preds = %51
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Mico\00"
@.str.1 = [10 x i8] c"Padre Pio\00"
@.str.2 = [10 x i8] c"Il Master\00"
@.str.3 = [15 x i8] c"San Sebastiano\00"
@.str.4 = [12 x i8] c"arg %d: %s\0A\00"
@.str.5 = [17 x i8] c"Santo n\C2\B0%d: %s\0A\00"
@.str.6 = [23 x i8] c"Nuovo Santo n\C2\B0%d: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %33
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %11
6: ; preds = %11
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br i1 %3, label %20, label %38
11: ; preds = %4, %11
%12 = phi i64 [ %5, %4 ], [ %13, %11 ]
%13 = add nsw i64 %12, -1
%14 = and i64 %13, 4294967295
%15 = getelementptr inbounds i8*, i8** %1, i64 %14
%16 = load i8*, i8** %15
%17 = trunc i64 %12 to i32
%18 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %17, i8* %16)
%19 = icmp ugt i64 %12, 1
br i1 %19, label %11, label %6
20: ; preds = %6
%21 = add nsw i32 %0, -1
%22 = call i32 @llvm.umin.i32(i32 %21, i32 3)
%23 = add nuw nsw i32 %22, 1
%24 = zext i32 %23 to i64
br label %25
25: ; preds = %20, %25
%26 = phi i64 [ 0, %20 ], [ %29, %25 ]
%27 = getelementptr inbounds i8*, i8** %1, i64 %26
%28 = load i8*, i8** %27
%29 = add nuw nsw i64 %26, 1
%30 = trunc i64 %29 to i32
%31 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0), i32 %30, i8* %28)
%32 = icmp eq i64 %29, %24
br i1 %32, label %38, label %25
33: ; preds = %2
%34 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%35 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%36 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%37 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %38
38: ; preds = %25, %33, %6
ret i32 0
}