#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 */
unsigned int _longcat(unsigned int, unsigned int);
int /*<<< orphan*/ _longsplit(unsigned int, unsigned int *, unsigned int *);
char _longadd(unsigned *s1, unsigned *s2) {
  unsigned s1h, s1l, s2h, s2l;
  _longsplit(*s1, &s1l, &s1h);
  _longsplit(*s2, &s2l, &s2h);
  s1l += s2l;
  _longsplit(s1l, &s1l, &s2l);
  s1h += s2h + s2l;
  _longsplit(s1h, &s1h, s2);
  *s1 = _longcat(s1l, s1h);
  return *s2 == 0;
}


x86 assembly (clang, -O0):
<_longadd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <_longsplit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <_longsplit@plt>
mov    -0x20(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <_longsplit@plt>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
lea    -0x14(%rbp),%rsi
call   1030 <_longsplit@plt>
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1040 <_longcat@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_longadd>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdi),%edi
mov    %rsp,%r12
lea    0x4(%rsp),%r15
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <_longsplit@plt>
mov    (%rbx),%edi
lea    0x8(%rsp),%r13
lea    0xc(%rsp),%rdx
mov    %r13,%rsi
call   1030 <_longsplit@plt>
mov    (%rsp),%edi
add    0x8(%rsp),%edi
mov    %edi,(%rsp)
mov    %r12,%rsi
mov    %r13,%rdx
call   1030 <_longsplit@plt>
mov    0x8(%rsp),%edi
add    0xc(%rsp),%edi
add    0x4(%rsp),%edi
mov    %edi,0x4(%rsp)
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <_longsplit@plt>
mov    (%rsp),%edi
mov    0x4(%rsp),%esi
call   1040 <_longcat@plt>
mov    %eax,(%r14)
cmpl   $0x0,(%rbx)
sete   %al
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define signext i8 @_longadd(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 @_longsplit(i32 %10, i32* %6, i32* %5)
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = call i32 @_longsplit(i32 %13, i32* %8, i32* %7)
%15 = load i32, i32* %8
%16 = load i32, i32* %6
%17 = add i32 %16, %15
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @_longsplit(i32 %18, i32* %6, i32* %8)
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = add i32 %20, %21
%23 = load i32, i32* %5
%24 = add i32 %23, %22
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = load i32*, i32** %4
%27 = call i32 @_longsplit(i32 %25, i32* %5, i32* %26)
%28 = load i32, i32* %6
%29 = load i32, i32* %5
%30 = call i32 @_longcat(i32 %28, i32 %29)
%31 = load i32*, i32** %3
store i32 %30, i32* %31
%32 = load i32*, i32** %4
%33 = load i32, i32* %32
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = trunc i32 %35 to i8
ret i8 %36
}

LLVM IR (-O2):
define signext i8 @_longadd(i32* nocapture %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = load i32, i32* %0
%12 = call i32 @_longsplit(i32 %11, i32* %4, i32* %3)
%13 = load i32, i32* %1
%14 = call i32 @_longsplit(i32 %13, i32* %6, i32* %5)
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = add i32 %16, %15
store i32 %17, i32* %4
%18 = call i32 @_longsplit(i32 %17, i32* %4, i32* %6)
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = add i32 %20, %19
%22 = load i32, i32* %3
%23 = add i32 %21, %22
store i32 %23, i32* %3
%24 = call i32 @_longsplit(i32 %23, i32* %3, i32* %1)
%25 = load i32, i32* %4
%26 = load i32, i32* %3
%27 = call i32 @_longcat(i32 %25, i32 %26)
store i32 %27, i32* %0
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, 0
%30 = zext i1 %29 to i8
ret i8 %30
}