#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 errno;
unsigned long long strtoull(char const *, char **, int /*<<< orphan*/);
int conf_parse_unsigned_internal(const char *lvalue, const char *rvalue,
                                 unsigned long long int *result) {
  int err = 0, save_errno;
  char *endptr;
  (void)lvalue;
  save_errno = errno;
  errno = 0;
  *result = strtoull(rvalue, &endptr, 0);
  if (errno != 0) {
    err = -errno;
  }
  errno = save_errno;
  return err;
}


x86 assembly (clang, -O0):
<conf_parse_unsigned_internal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2ea2(%rip),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoull@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2e7c(%rip),%rax
cmpl   $0x0,(%rax)
je     117b <conf_parse_unsigned_internal+0x6b>
xor    %eax,%eax
mov    0x2e6a(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%ecx
mov    0x2e5b(%rip),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conf_parse_unsigned_internal>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rdi
mov    0x2ebc(%rip),%rbx
mov    (%rbx),%r15d
movl   $0x0,(%rbx)
mov    %rsp,%rsi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <strtoull@plt>
mov    %rax,(%r14)
sub    (%rbx),%ebp
mov    %r15d,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @conf_parse_unsigned_internal(i8* %0, i8* %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64* %2, i64** %6
store i32 0, i32* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* @errno
store i32 %11, i32* %8
store i32 0, i32* @errno
%12 = load i8*, i8** %5
%13 = call i64 @strtoull(i8* %12, i8** %9, i32 0)
%14 = load i64*, i64** %6
store i64 %13, i64* %14
%15 = load i32, i32* @errno
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %3
%18 = load i32, i32* @errno
%19 = sub nsw i32 0, %18
store i32 %19, i32* %7
br label %20
20: ; preds = %17, %3
%21 = load i32, i32* %8
store i32 %21, i32* @errno
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @conf_parse_unsigned_internal(i8* nocapture readnone %0, i8* %1, i64* nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = load i32, i32* @errno
store i32 0, i32* @errno
%7 = call i64 @strtoull(i8* %1, i8** %4, i32 0)
store i64 %7, i64* %2
%8 = load i32, i32* @errno
%9 = sub nsw i32 0, %8
store i32 %6, i32* @errno
ret i32 %9
}