#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 */
char *add_two_binary_numbers_represented_as_string(char *, char *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char *num1 = "10010000";
  char *num2 = "10010000";
  char *exp_num1 = "10011001";
  char *actual_num1 = add_two_binary_numbers_represented_as_string(num1, num2);
  printf("expected = %s\n", exp_num1);
  printf("actual = %s\n", actual_num1);
  assert(0 == strcmp(exp_num1, actual_num1));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe9f(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <add_two_binary_numbers_represented_as_string@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%rdi
mov    %rdi,%rsi
call   1060 <add_two_binary_numbers_represented_as_string@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rdi
lea    0xea5(%rip),%r14
mov    %r14,%rsi
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"10010000\00"
@.str.1 = [9 x i8] c"10011001\00"
@.str.2 = [15 x i8] c"expected = %s\0A\00"
@.str.3 = [13 x i8] c"actual = %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i8* @add_two_binary_numbers_represented_as_string(i8* %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %4
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %5
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %11)
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i64 @strcmp(i8* %13, i8* %14)
%16 = icmp eq i64 0, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"10010000\00"
@.str.1 = [9 x i8] c"10011001\00"
@.str.2 = [15 x i8] c"expected = %s\0A\00"
@.str.3 = [13 x i8] c"actual = %s\0A\00"
define i32 @main() {
%1 = tail call i8* @add_two_binary_numbers_represented_as_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%4 = tail call i64 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}