#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 EE_bluetooth_receive_no_timeout();
int EE_elm327_check_response_no_timeout(char *response) {
  register unsigned char value = 0;
  register int ret;
  ret = 1;
  for (; *response != '\0'; response++) {
    if (*response != (value = EE_bluetooth_receive_no_timeout())) {
      ret = 0;
      break;
    }
  }
  while (EE_bluetooth_receive_no_timeout() != '>')
    ;
  return ret;
}


x86 assembly (clang, -O0):
<EE_elm327_check_response_no_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     117d <EE_elm327_check_response_no_timeout+0x6d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <EE_bluetooth_receive_no_timeout@plt>
mov    %al,%cl
mov    -0x14(%rbp),%eax
mov    %cl,-0x9(%rbp)
movzbl %cl,%ecx
cmp    %ecx,%eax
je     1167 <EE_elm327_check_response_no_timeout+0x57>
movl   $0x0,-0x10(%rbp)
jmp    117d <EE_elm327_check_response_no_timeout+0x6d>
jmp    116c <EE_elm327_check_response_no_timeout+0x5c>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1127 <EE_elm327_check_response_no_timeout+0x17>
jmp    1182 <EE_elm327_check_response_no_timeout+0x72>
mov    $0x0,%al
call   1030 <EE_bluetooth_receive_no_timeout@plt>
movsbl %al,%eax
cmp    $0x3e,%eax
je     119a <EE_elm327_check_response_no_timeout+0x8a>
jmp    1182 <EE_elm327_check_response_no_timeout+0x72>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EE_elm327_check_response_no_timeout>:
push   %rbp
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <EE_elm327_check_response_no_timeout+0x45>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%r14d
xor    %eax,%eax
call   1030 <EE_bluetooth_receive_no_timeout@plt>
movzbl %al,%eax
cmp    %eax,%r14d
jne    1160 <EE_elm327_check_response_no_timeout+0x50>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <EE_elm327_check_response_no_timeout+0x20>
mov    $0x1,%ebp
jmp    1160 <EE_elm327_check_response_no_timeout+0x50>
mov    $0x1,%ebp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <EE_bluetooth_receive_no_timeout@plt>
cmp    $0x3e,%al
jne    1160 <EE_elm327_check_response_no_timeout+0x50>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @EE_elm327_check_response_no_timeout(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %7
4: ; preds = %7
%5 = load i8, i8* %14
%6 = icmp eq i8 %5, 0
br i1 %6, label %15, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %14, %4 ], [ %0, %1 ]
%10 = sext i8 %8 to i32
%11 = tail call signext i8 (...) @EE_bluetooth_receive_no_timeout()
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %10, %12
%14 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %13, label %4, label %15
15: ; preds = %4, %7, %1
%16 = phi i32 [ 1, %1 ], [ 0, %7 ], [ 1, %4 ]
br label %17
17: ; preds = %17, %15
%18 = tail call signext i8 (...) @EE_bluetooth_receive_no_timeout()
%19 = icmp eq i8 %18, 62
br i1 %19, label %20, label %17
20: ; preds = %17
ret i32 %16
}