#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 */
scalar_t__ get_num_val(char *, unsigned int *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ show_int(unsigned int);
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  int i;
  unsigned uf;
  if (argc < 2)
    usage(argv[0]);
  for (i = 1; i < argc; i++) {
    char *sval = argv[i];
    if (get_num_val(sval, &uf)) {
      show_int(uf);
    } else {
      printf("Cannot convert '%s' to 32-bit number\n", sval);
    }
  }
  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+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d6 <main+0x96>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <get_num_val@plt>
cmp    $0x0,%rax
je     11b3 <main+0x73>
mov    -0x18(%rbp),%edi
call   1060 <show_int@plt>
jmp    11c3 <main+0x83>
mov    -0x20(%rbp),%rsi
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
jmp    11c8 <main+0x88>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1173 <main+0x33>
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,%r12
cmp    $0x1,%edi
jg     116d <main+0x2d>
mov    (%r12),%rdi
call   1050 <usage@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %edi,%r13d
mov    $0x1,%ebp
lea    0x4(%rsp),%r14
lea    0xe7f(%rip),%r15
jmp    11a4 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r13
je     115c <main+0x1c>
mov    (%r12,%rbp,8),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <get_num_val@plt>
test   %rax,%rax
je     1190 <main+0x50>
mov    0x4(%rsp),%edi
call   1060 <show_int@plt>
jmp    119b <main+0x5b>

LLVM IR (-O0):
@.str = [38 x i8] c"Cannot convert '%s' to 32-bit number\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 @usage(i8* %14)
br label %16
16: ; preds = %11, %2
store i32 1, i32* %6
br label %17
17: ; preds = %37, %16
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %40
21: ; preds = %17
%22 = load i8**, i8*** %5
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
store i8* %26, i8** %8
%27 = load i8*, i8** %8
%28 = call i64 @get_num_val(i8* %27, i32* %7)
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %21
%31 = load i32, i32* %7
%32 = call i32 @show_int(i32 %31)
br label %36
33: ; preds = %21
%34 = load i8*, i8** %8
%35 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %34)
br label %36
36: ; preds = %33, %30
br label %37
37: ; preds = %36
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
store i32 %39, i32* %6
br label %17
40: ; preds = %17
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Cannot convert '%s' to 32-bit number\0A\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 %9
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 @usage(i8* %7)
br label %25
9: ; preds = %2
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %22
%12 = phi i64 [ 1, %9 ], [ %23, %22 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = call i64 @get_num_val(i8* %14, i32* %3)
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = load i32, i32* %3
%19 = call i32 @show_int(i32 %18)
br label %22
20: ; preds = %11
%21 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %22
22: ; preds = %20, %17
%23 = add nuw nsw i64 %12, 1
%24 = icmp eq i64 %23, %10
br i1 %24, label %25, label %11
25: ; preds = %22, %6
ret i32 0
}