#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 */
long atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    printf("Try running with some numbers as an argument.\n");
    return 1;
  }
  int i = 1;
  while (i < argc) {
    long lex = atoi(argv[i]);
    printf("Num = %ld\tOctal = %#o\tHex = %#x\n", lex, lex, lex);
    ++i;
  }
  printf("Done.\n");
  return 0;
}


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)
cmpl   $0x1,-0x8(%rbp)
jne    115a <main+0x3a>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    11bf <main+0x9f>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11aa <main+0x8a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <atoi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1161 <main+0x41>
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    114e <main+0x1e>
mov    $0x1,%ebp
lea    0xedb(%rip),%r14
jmp    1195 <main+0x65>
xor    %ebp,%ebp
lea    0xeca(%rip),%r14
cmp    $0x2,%edi
jl     1195 <main+0x65>
mov    %rsi,%r12
mov    %edi,%r13d
mov    $0x1,%ebx
lea    0xe92(%rip),%r15
xor    %ebp,%ebp
mov    (%r12,%rbx,8),%rdi
call   1050 <atoi@plt>
mov    %r15,%rdi
mov    %rax,%rsi
mov    %rax,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1170 <main+0x40>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Try running with some numbers as an argument.\0A\00"
@.str.1 = [33 x i8] c"Num = %ld\09Octal = %#o\09Hex = %#x\0A\00"
@.str.2 = [7 x i8] c"Done.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %32
12: ; preds = %2
store i32 1, i32* %6
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = load i8**, i8*** %5
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i64 @atoi(i8* %22)
store i64 %23, i64* %7
%24 = load i64, i64* %7
%25 = load i64, i64* %7
%26 = load i64, i64* %7
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 %24, i64 %25, i64 %26)
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %13
30: ; preds = %13
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %32
32: ; preds = %30, %10
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"Num = %ld\09Octal = %#o\09Hex = %#x\0A\00"
@str = [6 x i8] c"Done.\00"
@str.3 = [46 x i8] c"Try running with some numbers as an argument.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %16, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 1
br i1 %5, label %6, label %16
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 1, %6 ], [ %14, %8 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i64 @atoi(i8* %11)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 %12, i64 %12, i64 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %16, label %8
16: ; preds = %8, %4, %2
%17 = phi i8* [ getelementptr inbounds ([46 x i8], [46 x i8]* @str.3, i64 0, i64 0), %2 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0), %8 ]
%18 = phi i32 [ 1, %2 ], [ 0, %4 ], [ 0, %8 ]
%19 = tail call i32 @puts(i8* dereferenceable(1) %17)
ret i32 %18
}