#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 strlen(char *);
int final_combo(char *signs) {
  int length = strlen(signs);
  for (int i = 0; i < length; i++) {
    if (signs[i] != '+') {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<final_combo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116f <final_combo+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2b,%eax
je     115c <final_combo+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1176 <final_combo+0x66>
jmp    1161 <final_combo+0x51>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112f <final_combo+0x1f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<final_combo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    114c <final_combo+0x3c>
mov    %eax,%ecx
xor    %eax,%eax
cmpb   $0x2b,(%rbx)
jne    114a <final_combo+0x3a>
mov    %ecx,%ecx
mov    $0x1,%eax
nopl   (%rax)
mov    %rax,%rdx
cmp    %rax,%rcx
je     1142 <final_combo+0x32>
lea    0x1(%rdx),%rax
cmpb   $0x2b,(%rbx,%rdx,1)
je     1130 <final_combo+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setae  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @final_combo(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %4
store i32 0, i32* %5
br label %8
8: ; preds = %22, %1
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %25
12: ; preds = %8
%13 = load i8*, i8** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 43
br i1 %19, label %20, label %21
20: ; preds = %12
store i32 0, i32* %2
br label %26
21: ; preds = %12
br label %22
22: ; preds = %21
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %8
25: ; preds = %8
store i32 1, i32* %2
br label %26
26: ; preds = %25, %20
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @final_combo(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %20
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = zext i32 %2 to i64
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 43
br i1 %8, label %9, label %20
9: ; preds = %4, %12
%10 = phi i64 [ %16, %12 ], [ 1, %4 ]
%11 = icmp eq i64 %10, %6
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 43
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %9, label %17
17: ; preds = %9, %12
%18 = icmp uge i64 %10, %5
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %17, %4, %1
%21 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %19, %17 ]
ret i32 %21
}