#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ asm_printf(char *, int, char *, int /*<<< orphan*/, int, int,
                              int);
int /*<<< orphan*/ asm_strlen(char *);
int atoi(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int val;
  for (int i = 1; i < argc; i++) {
    val = atoi(argv[i]);
    asm_printf("%3d: '%s', len = %d, val = %d(d) 0x%04x(h)  0%o(o)\n", i,
               argv[i], asm_strlen(argv[i]), val, val, val);
  }
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d5 <main+0x95>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <asm_strlen@plt>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
mov    -0x14(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x14(%rbp),%eax
lea    0xe41(%rip),%rdi
mov    %eax,(%rsp)
call   1060 <asm_printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <main+0x1d>
mov    0x2e04(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     11a7 <main+0x67>
mov    %rsi,%r14
mov    %edi,%r13d
mov    $0x1,%ebx
lea    0xe9e(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%r12
mov    %r12,%rdi
call   1040 <atoi@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1030 <asm_strlen@plt>
mov    %ebp,(%rsp)
mov    %r15,%rdi
mov    %ebx,%esi
mov    %r12,%rdx
mov    %eax,%ecx
mov    %ebp,%r8d
mov    %ebp,%r9d
call   1060 <asm_printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1170 <main+0x30>
mov    0x2e32(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"%3d: '%s', len = %d, val = %d(d) 0x%04x(h) 0%o(o)\0A\00"
@EXIT_SUCCESS = global i32 0
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 1, i32* %7
br label %8
8: ; preds = %35, %2
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %38
12: ; preds = %8
%13 = load i8**, i8*** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %6
%19 = load i32, i32* %7
%20 = load i8**, i8*** %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @asm_strlen(i8* %29)
%31 = load i32, i32* %6
%32 = load i32, i32* %6
%33 = load i32, i32* %6
%34 = call i32 @asm_printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %19, i8* %24, i32 %30, i32 %31, i32 %32, i32 %33)
br label %35
35: ; preds = %12
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %8
38: ; preds = %8
%39 = load i32, i32* @EXIT_SUCCESS
%40 = call i32 @exit(i32 %39)
unreachable
}

LLVM IR (-O2):
@.str = [52 x i8] c"%3d: '%s', len = %d, val = %d(d) 0x%04x(h) 0%o(o)\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %9
6: ; preds = %9, %2
%7 = load i32, i32* @EXIT_SUCCESS
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %4, %9
%10 = phi i64 [ 1, %4 ], [ %17, %9 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i32 @asm_strlen(i8* %12)
%15 = trunc i64 %10 to i32
%16 = tail call i32 @asm_printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %12, i32 %14, i32 %13, i32 %13, i32 %13)
%17 = add nuw nsw i64 %10, 1
%18 = icmp eq i64 %17, %5
br i1 %18, label %6, label %9
}