#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*/ helper(char *, int, int /*<<< orphan*/, int,
                          int /*<<< orphan*/, int /*<<< orphan*/, char *, int,
                          char ***, int *);
scalar_t__ malloc(int);
int strlen(char *);
char **addOperators(char *num, int target, int *returnSize) {
  char **arr = (char **)malloc(sizeof(char *));
  *returnSize = 0;
  int len = strlen(num);
  if (len == 0)
    return arr;
  char *stack = (char *)malloc(sizeof(char) * 2 * len);
  int top = -1;
  helper(num, len, 0, target, 0, 0, stack, top, &arr, returnSize);
  return arr;
}


x86 assembly (clang, -O0):
<addOperators>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x68,%rsp
mov    %rdi,-0x18(%rbp)
mov    %esi,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    117f <addOperators+0x4f>
mov    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    11dc <addOperators+0xac>
movslq -0x34(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0xffffffff,-0x44(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x1c(%rbp),%ecx
mov    -0x40(%rbp),%rbx
mov    -0x44(%rbp),%r11d
mov    -0x28(%rbp),%rax
xor    %r9d,%r9d
lea    -0x30(%rbp),%r10
mov    %r9d,%edx
mov    %r9d,%r8d
mov    %rbx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1050 <helper@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<addOperators>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r15
mov    %esi,%r14d
mov    %rdi,%r12
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,0x8(%rsp)
movl   $0x0,(%r15)
mov    %r12,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
je     119e <addOperators+0x6e>
mov    %eax,%ebp
mov    %eax,%edi
add    %ebp,%edi
call   1040 <malloc@plt>
lea    0x8(%rsp),%rbx
mov    %r12,%rdi
mov    %ebp,%esi
xor    %edx,%edx
mov    %r14d,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %r15
push   %rbx
push   $0xffffffffffffffff
push   %rax
call   1050 <helper@plt>
add    $0x20,%rsp
mov    0x8(%rsp),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8** @addOperators(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
%12 = call i64 @malloc(i32 8)
%13 = inttoptr i64 %12 to i8**
store i8** %13, i8*** %8
%14 = load i32*, i32** %7
store i32 0, i32* %14
%15 = load i8*, i8** %5
%16 = call i32 @strlen(i8* %15)
store i32 %16, i32* %9
%17 = load i32, i32* %9
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %3
%20 = load i8**, i8*** %8
store i8** %20, i8*** %4
br label %36
21: ; preds = %3
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = mul i64 2, %23
%25 = trunc i64 %24 to i32
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %10
store i32 -1, i32* %11
%28 = load i8*, i8** %5
%29 = load i32, i32* %9
%30 = load i32, i32* %6
%31 = load i8*, i8** %10
%32 = load i32, i32* %11
%33 = load i32*, i32** %7
%34 = call i32 @helper(i8* %28, i32 %29, i32 0, i32 %30, i32 0, i32 0, i8* %31, i32 %32, i8*** %8, i32* %33)
%35 = load i8**, i8*** %8
store i8** %35, i8*** %4
br label %36
36: ; preds = %21, %19
%37 = load i8**, i8*** %4
ret i8** %37
}

LLVM IR (-O2):
define i8** @addOperators(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8**
%5 = bitcast i8*** %4 to i8*
%6 = tail call i64 @malloc(i32 8)
%7 = inttoptr i64 %6 to i8**
store i8** %7, i8*** %4
store i32 0, i32* %2
%8 = tail call i32 @strlen(i8* %0)
%9 = icmp eq i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %3
%11 = shl i32 %8, 1
%12 = tail call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
%14 = call i32 @helper(i8* %0, i32 %8, i32 0, i32 %1, i32 0, i32 0, i8* %13, i32 -1, i8*** %4, i32* %2)
%15 = load i8**, i8*** %4
br label %16
16: ; preds = %3, %10
%17 = phi i8** [ %7, %3 ], [ %15, %10 ]
ret i8** %17
}