#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  int i, v;
  if (argc < 2) {
    fprintf(stderr, "Usage: %s number, ...\n", argv[0]);
  }
  printf("%-10s %-10s %-10s %-10s\n", "arg", "octal", "decimal", "hexadecimal");
  for (i = 1; i < argc; i++) {
    if (argv[i][0] == '0' && (argv[i][1] == 'x' || argv[i][1] == 'X')) {
      sscanf(&argv[i][2], "%x", &v);
      printf("%-10s 0%-9o %-10u 0x%-8x\n", argv[i], v, v, v);
    } else if (argv[i][0] == '0') {
      sscanf(&argv[i][1], "%o", &v);
      printf("%-10s 0%-9o %-10u 0x%-8x\n", argv[i], v, v, v);
    } else {
      sscanf(argv[i], "%u", &v);
      printf("%-10s 0%-9o %-10u 0x%-8x\n", argv[i], v, v, v);
    }
  }
  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   $0x2,-0x8(%rbp)
jge    116c <main+0x3c>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe99(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xea4(%rip),%rdi
lea    0xeb6(%rip),%rsi
lea    0xeb3(%rip),%rdx
lea    0xeb6(%rip),%rcx
lea    0xeab(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12f5 <main+0x1c5>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    123c <main+0x10c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
je     11f3 <main+0xc3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl 0x1(%rax),%eax
cmp    $0x58,%eax
jne    123c <main+0x10c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x2,%rdi
lea    0xe3c(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e2 <main+0x1b2>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    129d <main+0x16d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
add    $0x1,%rdi
lea    0xdf8(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12dd <main+0x1ad>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdb6(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x18(%rbp),%r8d
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e2 <main+0x1b2>
jmp    12e7 <main+0x1b7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <main+0x6d>
xor    %eax,%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
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1196 <main+0x66>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rdx
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeb5(%rip),%rdi
lea    0xec7(%rip),%rsi
lea    0xec4(%rip),%rdx
lea    0xec7(%rip),%rcx
lea    0xebc(%rip),%r8
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %edi,%ebp
lea    0xe78(%rip),%rdi
lea    0xe8a(%rip),%rsi
lea    0xe87(%rip),%rdx
lea    0xe8a(%rip),%rcx
lea    0xe7f(%rip),%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%r13d
mov    $0x1,%r14d
lea    0x4(%rsp),%r15
lea    0xe72(%rip),%r12
lea    0xe88(%rip),%rbp
jmp    120f <main+0xdf>
mov    %rbp,%rsi
mov    %r15,%rdx
call   1050 <sscanf@plt>
mov    (%rbx,%r14,8),%rsi
mov    0x4(%rsp),%ecx
mov    %r12,%rdi
mov    %ecx,%edx
mov    %ecx,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r13
je     1185 <main+0x55>
mov    (%rbx,%r14,8),%rdi
cmpb   $0x30,(%rdi)
jne    11e0 <main+0xb0>
movzbl 0x1(%rdi),%eax
or     $0x20,%al
cmp    $0x78,%al
jne    122f <main+0xff>
add    $0x2,%rdi
lea    0xe19(%rip),%rsi
jmp    11e3 <main+0xb3>
add    $0x1,%rdi
lea    0xe29(%rip),%rsi
jmp    11e3 <main+0xb3>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s number, ...\0A\00"
@.str.1 = [25 x i8] c"%-10s %-10s %-10s %-10s\0A\00"
@.str.2 = [4 x i8] c"arg\00"
@.str.3 = [6 x i8] c"octal\00"
@.str.4 = [8 x i8] c"decimal\00"
@.str.5 = [12 x i8] c"hexadecimal\00"
@.str.6 = [3 x i8] c"%x\00"
@.str.7 = [26 x i8] c"%-10s 0%-9o %-10u 0x%-8x\0A\00"
@.str.8 = [3 x i8] c"%o\00"
@.str.9 = [3 x i8] c"%u\00"
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
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %10, %2
%17 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %6
br label %18
18: ; preds = %114, %16
%19 = load i32, i32* %6
%20 = load i32, i32* %4
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %117
22: ; preds = %18
%23 = load i8**, i8*** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8*, i8** %23, i64 %25
%27 = load i8*, i8** %26
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 48
br i1 %31, label %32, label %69
32: ; preds = %22
%33 = load i8**, i8*** %5
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8*, i8** %33, i64 %35
%37 = load i8*, i8** %36
%38 = getelementptr inbounds i8, i8* %37, i64 1
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 120
br i1 %41, label %52, label %42
42: ; preds = %32
%43 = load i8**, i8*** %5
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8*, i8** %43, i64 %45
%47 = load i8*, i8** %46
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 88
br i1 %51, label %52, label %69
52: ; preds = %42, %32
%53 = load i8**, i8*** %5
%54 = load i32, i32* %6
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8*, i8** %53, i64 %55
%57 = load i8*, i8** %56
%58 = getelementptr inbounds i8, i8* %57, i64 2
%59 = call i32 @sscanf(i8* %58, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %7)
%60 = load i8**, i8*** %5
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8*, i8** %60, i64 %62
%64 = load i8*, i8** %63
%65 = load i32, i32* %7
%66 = load i32, i32* %7
%67 = load i32, i32* %7
%68 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %64, i32 %65, i32 %66, i32 %67)
br label %113
69: ; preds = %42, %22
%70 = load i8**, i8*** %5
%71 = load i32, i32* %6
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8*, i8** %70, i64 %72
%74 = load i8*, i8** %73
%75 = getelementptr inbounds i8, i8* %74, i64 0
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 48
br i1 %78, label %79, label %96
79: ; preds = %69
%80 = load i8**, i8*** %5
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i8*, i8** %83
%85 = getelementptr inbounds i8, i8* %84, i64 1
%86 = call i32 @sscanf(i8* %85, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %7)
%87 = load i8**, i8*** %5
%88 = load i32, i32* %6
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8*, i8** %87, i64 %89
%91 = load i8*, i8** %90
%92 = load i32, i32* %7
%93 = load i32, i32* %7
%94 = load i32, i32* %7
%95 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %91, i32 %92, i32 %93, i32 %94)
br label %112
96: ; preds = %69
%97 = load i8**, i8*** %5
%98 = load i32, i32* %6
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i8*, i8** %97, i64 %99
%101 = load i8*, i8** %100
%102 = call i32 @sscanf(i8* %101, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %7)
%103 = load i8**, i8*** %5
%104 = load i32, i32* %6
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8*, i8** %103, i64 %105
%107 = load i8*, i8** %106
%108 = load i32, i32* %7
%109 = load i32, i32* %7
%110 = load i32, i32* %7
%111 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %107, i32 %108, i32 %109, i32 %110)
br label %112
112: ; preds = %96, %79
br label %113
113: ; preds = %112, %52
br label %114
114: ; preds = %113
%115 = load i32, i32* %6
%116 = add nsw i32 %115, 1
store i32 %116, i32* %6
br label %18
117: ; preds = %18
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Usage: %s number, ...\0A\00"
@.str.1 = [25 x i8] c"%-10s %-10s %-10s %-10s\0A\00"
@.str.2 = [4 x i8] c"arg\00"
@.str.3 = [6 x i8] c"octal\00"
@.str.4 = [8 x i8] c"decimal\00"
@.str.5 = [12 x i8] c"hexadecimal\00"
@.str.6 = [3 x i8] c"%x\00"
@.str.7 = [26 x i8] c"%-10s 0%-9o %-10u 0x%-8x\0A\00"
@.str.8 = [3 x i8] c"%o\00"
@.str.9 = [3 x i8] c"%u\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %42
11: ; preds = %2
%12 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%13 = zext i32 %0 to i64
br label %14
14: ; preds = %11, %39
%15 = phi i64 [ 1, %11 ], [ %40, %39 ]
%16 = getelementptr inbounds i8*, i8** %1, i64 %15
%17 = load i8*, i8** %16
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 48
br i1 %19, label %20, label %34
20: ; preds = %14
%21 = getelementptr inbounds i8, i8* %17, i64 1
%22 = load i8, i8* %21
switch i8 %22, label %29 [
i8 120, label %23
i8 88, label %23
]
23: ; preds = %20, %20
%24 = getelementptr inbounds i8, i8* %17, i64 2
%25 = call i32 @sscanf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %3)
%26 = load i8*, i8** %16
%27 = load i32, i32* %3
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %26, i32 %27, i32 %27, i32 %27)
br label %39
29: ; preds = %20
%30 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %3)
%31 = load i8*, i8** %16
%32 = load i32, i32* %3
%33 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %31, i32 %32, i32 %32, i32 %32)
br label %39
34: ; preds = %14
%35 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32* %3)
%36 = load i8*, i8** %16
%37 = load i32, i32* %3
%38 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i8* %36, i32 %37, i32 %37, i32 %37)
br label %39
39: ; preds = %23, %34, %29
%40 = add nuw nsw i64 %15, 1
%41 = icmp eq i64 %40, %13
br i1 %41, label %42, label %14
42: ; preds = %39, %6
ret i32 0
}