#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ cslob_read(int /*<<< orphan*/ *, ...);
int cslob_read_stringc(FILE *file, char *string) {
  unsigned char string_len;
  ;
  if (!cslob_read(file, &string_len, 1))
    return 1;
  ;
  if (string_len > 0) {
    ;
    if (!cslob_read(file, (char *)string, string_len))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<cslob_read_stringc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <cslob_read@plt>
cmp    $0x0,%eax
jne    1149 <cslob_read_stringc+0x39>
movl   $0x1,-0x4(%rbp)
jmp    118a <cslob_read_stringc+0x7a>
movzbl -0x19(%rbp),%eax
cmp    $0x0,%eax
jle    1183 <cslob_read_stringc+0x73>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movzbl -0x19(%rbp),%edx
mov    $0x0,%al
call   1030 <cslob_read@plt>
cmp    $0x0,%eax
jne    117e <cslob_read_stringc+0x6e>
movl   $0x0,-0x4(%rbp)
jmp    118a <cslob_read_stringc+0x7a>
jmp    1183 <cslob_read_stringc+0x73>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cslob_read_stringc>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <cslob_read@plt>
test   %eax,%eax
je     115a <cslob_read_stringc+0x4a>
movzbl 0xf(%rsp),%edx
test   %edx,%edx
je     1155 <cslob_read_stringc+0x45>
xor    %ebx,%ebx
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <cslob_read@plt>
test   %eax,%eax
je     115a <cslob_read_stringc+0x4a>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @cslob_read_stringc(i32* %0, i8* %1) {
%3 = alloca i8
%4 = call i32 (i32*, ...) @cslob_read(i32* %0, i8* %3, i32 1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = load i8, i8* %3
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = zext i8 %7 to i32
%11 = call i32 (i32*, ...) @cslob_read(i32* %0, i8* %1, i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %9, %6
br label %14
14: ; preds = %9, %2, %13
%15 = phi i32 [ 1, %13 ], [ 1, %2 ], [ 0, %9 ]
ret i32 %15
}