#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*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
scalar_t__ sscanf(char *, char *, char *, char *);
int readTuple(FILE *file, char *Msg, char *name) {
  char buf[60];
  if (fgets(buf, 60, file) == NULL)
    return 0;
  if (sscanf(buf, "%c %s", Msg, name) < 0) {
    printf("read error!\n");
  }
  return 1;
}


x86 assembly (clang, -O0):
<readTuple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x3c,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    116c <readTuple+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    11a1 <readTuple+0x71>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe81(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x0,%rax
jge    119a <readTuple+0x6a>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readTuple>:
push   %r14
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x3c,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     117f <readTuple+0x4f>
lea    0xea7(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1050 <sscanf@plt>
mov    $0x1,%ebx
test   %rax,%rax
jns    1181 <readTuple+0x51>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
jmp    1181 <readTuple+0x51>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%c %s\00"
@.str.1 = [13 x i8] c"read error!\0A\00"
define i32 @readTuple(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [60 x i8]
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = getelementptr inbounds [60 x i8], [60 x i8]* %8, i64 0, i64 0
%10 = load i32*, i32** %5
%11 = call i32* @fgets(i8* %9, i32 60, i32* %10)
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 0, i32* %4
br label %23
14: ; preds = %3
%15 = getelementptr inbounds [60 x i8], [60 x i8]* %8, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = load i8*, i8** %7
%18 = call i64 @sscanf(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = icmp slt i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %14
store i32 1, i32* %4
br label %23
23: ; preds = %22, %13
%24 = load i32, i32* %4
ret i32 %24
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c %s\00"
@str = [12 x i8] c"read error!\00"
define i32 @readTuple(i32* nocapture %0, i8* %1, i8* %2) {
%4 = alloca [60 x i8]
%5 = getelementptr inbounds [60 x i8], [60 x i8]* %4, i64 0, i64 0
%6 = call i32* @fgets(i8* %5, i32 60, i32* %0)
%7 = icmp eq i32* %6, null
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = call i64 @sscanf(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %13
13: ; preds = %8, %11, %3
%14 = phi i32 [ 0, %3 ], [ 1, %11 ], [ 1, %8 ]
ret i32 %14
}