#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*/ binary_add(short *, short *);
void binary_subtract(short int accumulator[], short int input_buffer[]) {
  int i;
  short int sub_buffer[112];
  for (i = 0; i < 112; i++) {
    if (input_buffer[i] == 0) {
      sub_buffer[i] = 1;
    } else {
      sub_buffer[i] = 0;
    }
  }
  binary_add(accumulator, sub_buffer);
  sub_buffer[0] = 1;
  for (i = 1; i < 112; i++) {
    sub_buffer[i] = 0;
  }
  binary_add(accumulator, sub_buffer);
}


x86 assembly (clang, -O0):
<binary_subtract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x70,-0x14(%rbp)
jge    117d <binary_subtract+0x6d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
jne    115c <binary_subtract+0x4c>
movslq -0x14(%rbp),%rax
movw   $0x1,-0x100(%rbp,%rax,2)
jmp    116a <binary_subtract+0x5a>
movslq -0x14(%rbp),%rax
movw   $0x0,-0x100(%rbp,%rax,2)
jmp    116f <binary_subtract+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <binary_subtract+0x1a>
mov    -0x8(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1030 <binary_add@plt>
movw   $0x1,-0x100(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x70,-0x14(%rbp)
jge    11c3 <binary_subtract+0xb3>
movslq -0x14(%rbp),%rax
movw   $0x0,-0x100(%rbp,%rax,2)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <binary_subtract+0x8d>
mov    -0x8(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1030 <binary_add@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_subtract>:
push   %r14
push   %rbx
sub    $0xe8,%rsp
mov    %rdi,%r14
movdqu (%rsi),%xmm0
pxor   %xmm1,%xmm1
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,(%rsp)
movdqu 0x10(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x10(%rsp)
movdqu 0x20(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x20(%rsp)
movdqu 0x30(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x30(%rsp)
movdqu 0x40(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x40(%rsp)
movdqu 0x50(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x50(%rsp)
movdqu 0x60(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x60(%rsp)
movdqu 0x70(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x70(%rsp)
movdqu 0x80(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x80(%rsp)
movdqu 0x90(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0x90(%rsp)
movdqu 0xa0(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0xa0(%rsp)
movdqu 0xb0(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0xb0(%rsp)
movdqu 0xc0(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0xc0(%rsp)
movdqu 0xd0(%rsi),%xmm0
pcmpeqw %xmm1,%xmm0
psrlw  $0xf,%xmm0
movdqa %xmm0,0xd0(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <binary_add@plt>
movw   $0x1,(%rsp)
pxor   %xmm0,%xmm0
movdqu %xmm0,0x2(%rsp)
movdqu %xmm0,0x12(%rsp)
movdqu %xmm0,0x22(%rsp)
movdqu %xmm0,0x32(%rsp)
movdqu %xmm0,0x42(%rsp)
movdqu %xmm0,0x52(%rsp)
movdqu %xmm0,0x62(%rsp)
movdqu %xmm0,0x72(%rsp)
movdqu %xmm0,0x82(%rsp)
movdqu %xmm0,0x92(%rsp)
movdqu %xmm0,0xa2(%rsp)
movdqu %xmm0,0xb2(%rsp)
movdqu %xmm0,0xc2(%rsp)
movdqu %xmm0,0xd0(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <binary_add@plt>
add    $0xe8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @binary_subtract(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca i32
%6 = alloca [112 x i16]
store i16* %0, i16** %3
store i16* %1, i16** %4
store i32 0, i32* %5
br label %7
7: ; preds = %27, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 112
br i1 %9, label %10, label %30
10: ; preds = %7
%11 = load i16*, i16** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i16, i16* %11, i64 %13
%15 = load i16, i16* %14
%16 = sext i16 %15 to i32
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %10
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [112 x i16], [112 x i16]* %6, i64 0, i64 %20
store i16 1, i16* %21
br label %26
22: ; preds = %10
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [112 x i16], [112 x i16]* %6, i64 0, i64 %24
store i16 0, i16* %25
br label %26
26: ; preds = %22, %18
br label %27
27: ; preds = %26
%28 = load i32, i32* %5
%29 = add nsw i32 %28, 1
store i32 %29, i32* %5
br label %7
30: ; preds = %7
%31 = load i16*, i16** %3
%32 = getelementptr inbounds [112 x i16], [112 x i16]* %6, i64 0, i64 0
%33 = call i32 @binary_add(i16* %31, i16* %32)
%34 = getelementptr inbounds [112 x i16], [112 x i16]* %6, i64 0, i64 0
store i16 1, i16* %34
store i32 1, i32* %5
br label %35
35: ; preds = %42, %30
%36 = load i32, i32* %5
%37 = icmp slt i32 %36, 112
br i1 %37, label %38, label %45
38: ; preds = %35
%39 = load i32, i32* %5
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [112 x i16], [112 x i16]* %6, i64 0, i64 %40
store i16 0, i16* %41
br label %42
42: ; preds = %38
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 1
store i32 %44, i32* %5
br label %35
45: ; preds = %35
%46 = load i16*, i16** %3
%47 = getelementptr inbounds [112 x i16], [112 x i16]* %6, i64 0, i64 0
%48 = call i32 @binary_add(i16* %46, i16* %47)
ret void
}

LLVM IR (-O2):
define void @binary_subtract(i16* %0, i16* nocapture %1) {
%3 = alloca [112 x i16]
%4 = bitcast [112 x i16]* %3 to i8*
%5 = bitcast i16* %1 to <8 x i16>*
%6 = load <8 x i16>, <8 x i16>* %5
%7 = icmp eq <8 x i16> %6, zeroinitializer
%8 = zext <8 x i1> %7 to <8 x i16>
%9 = bitcast [112 x i16]* %3 to <8 x i16>*
store <8 x i16> %8, <8 x i16>* %9
%10 = getelementptr inbounds i16, i16* %1, i64 8
%11 = bitcast i16* %10 to <8 x i16>*
%12 = load <8 x i16>, <8 x i16>* %11
%13 = icmp eq <8 x i16> %12, zeroinitializer
%14 = zext <8 x i1> %13 to <8 x i16>
%15 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 8
%16 = bitcast i16* %15 to <8 x i16>*
store <8 x i16> %14, <8 x i16>* %16
%17 = getelementptr inbounds i16, i16* %1, i64 16
%18 = bitcast i16* %17 to <8 x i16>*
%19 = load <8 x i16>, <8 x i16>* %18
%20 = icmp eq <8 x i16> %19, zeroinitializer
%21 = zext <8 x i1> %20 to <8 x i16>
%22 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 16
%23 = bitcast i16* %22 to <8 x i16>*
store <8 x i16> %21, <8 x i16>* %23
%24 = getelementptr inbounds i16, i16* %1, i64 24
%25 = bitcast i16* %24 to <8 x i16>*
%26 = load <8 x i16>, <8 x i16>* %25
%27 = icmp eq <8 x i16> %26, zeroinitializer
%28 = zext <8 x i1> %27 to <8 x i16>
%29 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 24
%30 = bitcast i16* %29 to <8 x i16>*
store <8 x i16> %28, <8 x i16>* %30
%31 = getelementptr inbounds i16, i16* %1, i64 32
%32 = bitcast i16* %31 to <8 x i16>*
%33 = load <8 x i16>, <8 x i16>* %32
%34 = icmp eq <8 x i16> %33, zeroinitializer
%35 = zext <8 x i1> %34 to <8 x i16>
%36 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 32
%37 = bitcast i16* %36 to <8 x i16>*
store <8 x i16> %35, <8 x i16>* %37
%38 = getelementptr inbounds i16, i16* %1, i64 40
%39 = bitcast i16* %38 to <8 x i16>*
%40 = load <8 x i16>, <8 x i16>* %39
%41 = icmp eq <8 x i16> %40, zeroinitializer
%42 = zext <8 x i1> %41 to <8 x i16>
%43 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 40
%44 = bitcast i16* %43 to <8 x i16>*
store <8 x i16> %42, <8 x i16>* %44
%45 = getelementptr inbounds i16, i16* %1, i64 48
%46 = bitcast i16* %45 to <8 x i16>*
%47 = load <8 x i16>, <8 x i16>* %46
%48 = icmp eq <8 x i16> %47, zeroinitializer
%49 = zext <8 x i1> %48 to <8 x i16>
%50 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 48
%51 = bitcast i16* %50 to <8 x i16>*
store <8 x i16> %49, <8 x i16>* %51
%52 = getelementptr inbounds i16, i16* %1, i64 56
%53 = bitcast i16* %52 to <8 x i16>*
%54 = load <8 x i16>, <8 x i16>* %53
%55 = icmp eq <8 x i16> %54, zeroinitializer
%56 = zext <8 x i1> %55 to <8 x i16>
%57 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 56
%58 = bitcast i16* %57 to <8 x i16>*
store <8 x i16> %56, <8 x i16>* %58
%59 = getelementptr inbounds i16, i16* %1, i64 64
%60 = bitcast i16* %59 to <8 x i16>*
%61 = load <8 x i16>, <8 x i16>* %60
%62 = icmp eq <8 x i16> %61, zeroinitializer
%63 = zext <8 x i1> %62 to <8 x i16>
%64 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 64
%65 = bitcast i16* %64 to <8 x i16>*
store <8 x i16> %63, <8 x i16>* %65
%66 = getelementptr inbounds i16, i16* %1, i64 72
%67 = bitcast i16* %66 to <8 x i16>*
%68 = load <8 x i16>, <8 x i16>* %67
%69 = icmp eq <8 x i16> %68, zeroinitializer
%70 = zext <8 x i1> %69 to <8 x i16>
%71 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 72
%72 = bitcast i16* %71 to <8 x i16>*
store <8 x i16> %70, <8 x i16>* %72
%73 = getelementptr inbounds i16, i16* %1, i64 80
%74 = bitcast i16* %73 to <8 x i16>*
%75 = load <8 x i16>, <8 x i16>* %74
%76 = icmp eq <8 x i16> %75, zeroinitializer
%77 = zext <8 x i1> %76 to <8 x i16>
%78 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 80
%79 = bitcast i16* %78 to <8 x i16>*
store <8 x i16> %77, <8 x i16>* %79
%80 = getelementptr inbounds i16, i16* %1, i64 88
%81 = bitcast i16* %80 to <8 x i16>*
%82 = load <8 x i16>, <8 x i16>* %81
%83 = icmp eq <8 x i16> %82, zeroinitializer
%84 = zext <8 x i1> %83 to <8 x i16>
%85 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 88
%86 = bitcast i16* %85 to <8 x i16>*
store <8 x i16> %84, <8 x i16>* %86
%87 = getelementptr inbounds i16, i16* %1, i64 96
%88 = bitcast i16* %87 to <8 x i16>*
%89 = load <8 x i16>, <8 x i16>* %88
%90 = icmp eq <8 x i16> %89, zeroinitializer
%91 = zext <8 x i1> %90 to <8 x i16>
%92 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 96
%93 = bitcast i16* %92 to <8 x i16>*
store <8 x i16> %91, <8 x i16>* %93
%94 = getelementptr inbounds i16, i16* %1, i64 104
%95 = bitcast i16* %94 to <8 x i16>*
%96 = load <8 x i16>, <8 x i16>* %95
%97 = icmp eq <8 x i16> %96, zeroinitializer
%98 = zext <8 x i1> %97 to <8 x i16>
%99 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 104
%100 = bitcast i16* %99 to <8 x i16>*
store <8 x i16> %98, <8 x i16>* %100
%101 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 0
%102 = call i32 @binary_add(i16* %0, i16* %101)
store i16 1, i16* %101
%103 = getelementptr inbounds [112 x i16], [112 x i16]* %3, i64 0, i64 1
%104 = bitcast i16* %103 to i8*
%105 = call i32 @binary_add(i16* %0, i16* %101)
ret void
}