#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*/ NumberIO_StrToOctInt(char *, unsigned int, int *);
int /*<<< orphan*/ memcpy(char *, char *, unsigned int);
void NumberIO_StrToOct(char *a_, unsigned int _a_high, unsigned int *x) {
  int i;
  char a[_a_high + 1];
  memcpy(a, a_, _a_high + 1);
  NumberIO_StrToOctInt((char *)a, _a_high, &i);
  (*x) = (unsigned int)(i);
}


x86 assembly (clang, -O0):
<NumberIO_StrToOct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x38(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
call   1030 <memcpy@plt>
mov    -0x38(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x1c(%rbp),%rdx
call   1040 <NumberIO_StrToOctInt@plt>
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumberIO_StrToOct>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%rsi
mov    %rsp,%r12
lea    0x1(%r15),%edx
mov    %rsp,%rbx
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1030 <memcpy@plt>
lea    -0x24(%rbp),%rdx
mov    %rbx,%rdi
mov    %r15d,%esi
call   1040 <NumberIO_StrToOctInt@plt>
mov    -0x24(%rbp),%eax
mov    %eax,(%r14)
mov    %r12,%rsp
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @NumberIO_StrToOct(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%10 = load i32, i32* %5
%11 = add i32 %10, 1
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %8
%14 = alloca i8, i64 %12
store i64 %12, i64* %9
%15 = load i8*, i8** %4
%16 = load i32, i32* %5
%17 = add i32 %16, 1
%18 = call i32 @memcpy(i8* %14, i8* %15, i32 %17)
%19 = load i32, i32* %5
%20 = call i32 @NumberIO_StrToOctInt(i8* %14, i32 %19, i32* %7)
%21 = load i32, i32* %7
%22 = load i32*, i32** %6
store i32 %21, i32* %22
%23 = load i8*, i8** %8
ret void
}

LLVM IR (-O2):
define void @NumberIO_StrToOct(i8* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = add i32 %1, 1
%7 = zext i32 %6 to i64
%8 = tail call i8* @llvm.stacksave()
%9 = alloca i8, i64 %7
%10 = call i32 @memcpy(i8* %9, i8* %0, i32 %6)
%11 = call i32 @NumberIO_StrToOctInt(i8* %9, i32 %1, i32* %4)
%12 = load i32, i32* %4
store i32 %12, i32* %2
ret void
}