#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 atoi(char *);
int get_tabstops(int argc, char *argv[], int tabstops[]) {
  for (int i = 1; i < argc; ++i) {
    tabstops[i - 1] = atoi(argv[i]);
  }
  return argc - 1;
}


x86 assembly (clang, -O0):
<get_tabstops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1167 <get_tabstops+0x57>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <atoi@plt>
mov    %eax,%edx
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <get_tabstops+0x1a>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tabstops>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edi,%r14d
cmp    $0x2,%edi
jl     1147 <get_tabstops+0x37>
mov    %rdx,%r15
mov    %rsi,%r12
mov    %r14d,%ebx
add    $0xffffffffffffffff,%rbx
xor    %ebp,%ebp
nop
mov    0x8(%r12,%rbp,8),%rdi
call   1030 <atoi@plt>
mov    %eax,(%r15,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1130 <get_tabstops+0x20>
add    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_tabstops(i32 %0, i8** %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
store i32 1, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %27
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)
%19 = load i32*, i32** %6
%20 = load i32, i32* %7
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
store i32 %18, i32* %23
br label %24
24: ; preds = %12
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %8
27: ; preds = %8
%28 = load i32, i32* %4
%29 = sub nsw i32 %28, 1
ret i32 %29
}

LLVM IR (-O2):
define i32 @get_tabstops(i32 %0, i8** nocapture %1, i32* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %0 to i64
br label %9
7: ; preds = %9, %3
%8 = add nsw i32 %0, -1
ret i32 %8
9: ; preds = %5, %9
%10 = phi i64 [ 1, %5 ], [ %16, %9 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = add nsw i64 %10, -1
%15 = getelementptr inbounds i32, i32* %2, i64 %14
store i32 %13, i32* %15
%16 = add nuw nsw i64 %10, 1
%17 = icmp eq i64 %16, %6
br i1 %17, label %7, label %9
}