#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*/ free(char *);
char *long_add(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main(void) {
  char op1[1001], op2[1001];
  printf("Input the operands a and b: ");
  scanf(" %s %s", op1, op2);
  char *buf = long_add(op1, op2);
  printf("a + b = %s", buf);
  free(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x3f0(%rbp),%rsi
lea    -0x7e0(%rbp),%rdx
lea    0xea8(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x7e0(%rbp),%rsi
call   1040 <long_add@plt>
mov    %rax,-0x7e8(%rbp)
mov    -0x7e8(%rbp),%rsi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x7e8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x7f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x7e8,%rsp
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0x3f0(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <long_add@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x7e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Input the operands a and b: \00"
@.str.1 = [7 x i8] c" %s %s\00"
@.str.2 = [11 x i8] c"a + b = %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1001 x i8]
%3 = alloca [1001 x i8]
%4 = alloca i8*
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [1001 x i8], [1001 x i8]* %3, i64 0, i64 0
%11 = call i8* @long_add(i8* %9, i8* %10)
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Input the operands a and b: \00"
@.str.1 = [7 x i8] c" %s %s\00"
@.str.2 = [11 x i8] c"a + b = %s\00"
define i32 @main() {
%1 = alloca [1001 x i8]
%2 = alloca [1001 x i8]
%3 = getelementptr inbounds [1001 x i8], [1001 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1001 x i8], [1001 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
%7 = call i8* @long_add(i8* %3, i8* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = call i32 @free(i8* %7)
ret i32 0
}