#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 */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ strtoul(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ usage();
void parse_int_args(int argc, char *argv[], uint64_t ints[], int len) {
  if (argc > len)
    usage();
  int i;
  for (i = 0; i < len; ++i)
    ints[i] = (i < argc) ? strtoul(argv[i], NULL, 0) : 0;
}


x86 assembly (clang, -O0):
<parse_int_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1149 <parse_int_args+0x29>
mov    $0x0,%al
call   1030 <usage@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11ad <parse_int_args+0x8d>
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1187 <parse_int_args+0x67>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
mov    %eax,-0x24(%rbp)
jmp    1191 <parse_int_args+0x71>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    1191 <parse_int_args+0x71>
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1150 <parse_int_args+0x30>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int_args>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r12d
mov    %rdx,%r13
mov    %rsi,%r14
mov    %edi,%r15d
cmp    %ecx,%edi
jle    1142 <parse_int_args+0x22>
xor    %eax,%eax
call   1030 <usage@plt>
test   %r12d,%r12d
jle    1187 <parse_int_args+0x67>
movslq %r15d,%r15
mov    %r12d,%ebx
xor    %ebp,%ebp
jmp    116e <parse_int_args+0x4e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,0x0(%r13,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
je     1187 <parse_int_args+0x67>
mov    $0x0,%eax
cmp    %r15,%rbp
jge    1160 <parse_int_args+0x40>
mov    (%r14,%rbp,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtoul@plt>
jmp    1160 <parse_int_args+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @parse_int_args(i32 %0, i8** %1, i32* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %8
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = call i32 (...) @usage()
br label %15
15: ; preds = %13, %4
store i32 0, i32* %9
br label %16
16: ; preds = %38, %15
%17 = load i32, i32* %9
%18 = load i32, i32* %8
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %41
20: ; preds = %16
%21 = load i32, i32* %9
%22 = load i32, i32* %5
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %31
24: ; preds = %20
%25 = load i8**, i8*** %6
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8*, i8** %25, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @strtoul(i8* %29, i32* null, i32 0)
br label %32
31: ; preds = %20
br label %32
32: ; preds = %31, %24
%33 = phi i32 [ %30, %24 ], [ 0, %31 ]
%34 = load i32*, i32** %7
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %34, i64 %36
store i32 %33, i32* %37
br label %38
38: ; preds = %32
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %16
41: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @parse_int_args(i32 %0, i8** nocapture %1, i32* nocapture writeonly %2, i32 %3) {
%5 = icmp sgt i32 %0, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (...) @usage()
br label %8
8: ; preds = %6, %4
%9 = icmp sgt i32 %3, 0
br i1 %9, label %10, label %25
10: ; preds = %8
%11 = sext i32 %0 to i64
%12 = zext i32 %3 to i64
br label %13
13: ; preds = %10, %20
%14 = phi i64 [ 0, %10 ], [ %23, %20 ]
%15 = icmp slt i64 %14, %11
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = getelementptr inbounds i8*, i8** %1, i64 %14
%18 = load i8*, i8** %17
%19 = tail call i32 @strtoul(i8* nocapture %18, i32* null, i32 0)
br label %20
20: ; preds = %13, %16
%21 = phi i32 [ %19, %16 ], [ 0, %13 ]
%22 = getelementptr inbounds i32, i32* %2, i64 %14
store i32 %21, i32* %22
%23 = add nuw nsw i64 %14, 1
%24 = icmp eq i64 %23, %12
br i1 %24, label %25, label %13
25: ; preds = %20, %8
ret void
}