#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*/ scanf(char *, ...);
unsigned int strlen(char *);
int /*<<< orphan*/ takeDigits(char *, int *);
int main() {
  char a[10];
  int result, check = 0;
  scanf("%s", a);
  scanf("%d", &result);
  unsigned int len = strlen(a);
  int nums[len];
  takeDigits(a, nums);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x14(%rbp)
lea    0xeba(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x31(%rbp)
lea    -0xa(%rbp),%rsi
mov    %rsi,-0x30(%rbp)
call   1050 <scanf@plt>
mov    -0x31(%rbp),%al
lea    0xea1(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x30(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0x28(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <takeDigits@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xebe(%rip),%rdi
lea    -0x1e(%rbp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xeac(%rip),%rdi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rsp,%rbx
mov    %eax,%eax
mov    %rsp,%rsi
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
mov    %r14,%rdi
call   1030 <takeDigits@plt>
mov    %rbx,%rsp
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 0, i32* %3
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %5
%15 = alloca i32, i64 %13
store i64 %13, i64* %6
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%17 = call i32 @takeDigits(i8* %16, i32* %15)
%18 = load i8*, i8** %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 @strlen(i8* %3)
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
%10 = alloca i32, i64 %8
%11 = call i32 @takeDigits(i8* %3, i32* %10)
ret i32 0
}