#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 gOr(int, int);
int /*<<< orphan*/ halfAdder(int const, int const, int *, int *);
void fullAdder(const int a, const int b, const int c, int *sum, int *carry) {
  int sumTmp = 0, carryTmp1 = 0, carryTmp2 = 0;
  halfAdder(a, b, &sumTmp, &carryTmp1);
  halfAdder(sumTmp, c, sum, &carryTmp2);
  *carry = gOr(carryTmp1, carryTmp2);
}


x86 assembly (clang, -O0):
<fullAdder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x24(%rbp),%rdx
lea    -0x28(%rbp),%rcx
call   1030 <halfAdder@plt>
mov    -0x24(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x2c(%rbp),%rcx
call   1030 <halfAdder@plt>
mov    -0x28(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1040 <gOr@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fullAdder>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %r8,%r14
mov    %rcx,%rbx
mov    %edx,%ebp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <halfAdder@plt>
mov    0xc(%rsp),%edi
lea    0x4(%rsp),%rcx
mov    %ebp,%esi
mov    %rbx,%rdx
call   1030 <halfAdder@plt>
mov    0x8(%rsp),%edi
mov    0x4(%rsp),%esi
call   1040 <gOr@plt>
mov    %eax,(%r14)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fullAdder(i32 %0, i32 %1, i32 %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i32* %4, i32** %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @halfAdder(i32 %14, i32 %15, i32* %11, i32* %12)
%17 = load i32, i32* %11
%18 = load i32, i32* %8
%19 = load i32*, i32** %9
%20 = call i32 @halfAdder(i32 %17, i32 %18, i32* %19, i32* %13)
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = call i32 @gOr(i32 %21, i32 %22)
%24 = load i32*, i32** %10
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @fullAdder(i32 %0, i32 %1, i32 %2, i32* %3, i32* nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%10 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%11 = bitcast i32* %8 to i8*
store i32 0, i32* %8
%12 = call i32 @halfAdder(i32 %0, i32 %1, i32* %6, i32* %7)
%13 = load i32, i32* %6
%14 = call i32 @halfAdder(i32 %13, i32 %2, i32* %3, i32* %8)
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i32 @gOr(i32 %15, i32 %16)
store i32 %17, i32* %4
ret void
}