#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*/ isdigit(char);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int isScoreValid(char tempScore[], int *score) {
  int i;
  for (i = 0; tempScore[i] != '\0'; i++) {
    if (!isdigit(tempScore[i])) {
      return 0;
    }
  }
  sscanf(tempScore, "%d", score);
  if (*score >= 0 && *score <= 100) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isScoreValid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1185 <isScoreValid+0x65>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1172 <isScoreValid+0x52>
movl   $0x0,-0x4(%rbp)
jmp    11c6 <isScoreValid+0xa6>
jmp    1177 <isScoreValid+0x57>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1137 <isScoreValid+0x17>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe6c(%rip),%rsi
call   1040 <sscanf@plt>
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jl     11bf <isScoreValid+0x9f>
mov    -0x18(%rbp),%rax
cmpl   $0x64,(%rax)
jg     11bf <isScoreValid+0x9f>
movl   $0x1,-0x4(%rbp)
jmp    11c6 <isScoreValid+0xa6>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isScoreValid>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    (%rdi),%al
test   %al,%al
je     1157 <isScoreValid+0x37>
lea    0x1(%r15),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1174 <isScoreValid+0x54>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <isScoreValid+0x20>
lea    0xea2(%rip),%rsi
mov    %r15,%rdi
mov    %r14,%rdx
call   1040 <sscanf@plt>
xor    %eax,%eax
cmpl   $0x65,(%r14)
setb   %al
jmp    1176 <isScoreValid+0x56>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @isScoreValid(i8* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 0, i32* %6
br label %7
7: ; preds = %25, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = call i32 @isdigit(i8 signext %20)
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %15
store i32 0, i32* %3
br label %41
24: ; preds = %15
br label %25
25: ; preds = %24
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %7
28: ; preds = %7
%29 = load i8*, i8** %4
%30 = load i32*, i32** %5
%31 = call i32 @sscanf(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %30)
%32 = load i32*, i32** %5
%33 = load i32, i32* %32
%34 = icmp sge i32 %33, 0
br i1 %34, label %35, label %40
35: ; preds = %28
%36 = load i32*, i32** %5
%37 = load i32, i32* %36
%38 = icmp sle i32 %37, 100
br i1 %38, label %39, label %40
39: ; preds = %35
store i32 1, i32* %3
br label %41
40: ; preds = %35, %28
store i32 0, i32* %3
br label %41
41: ; preds = %40, %39, %23
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @isScoreValid(i8* nocapture %0, i32* %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %14
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %14, %5 ], [ 0, %2 ]
%11 = phi i8 [ %7, %5 ], [ %3, %2 ]
%12 = tail call i32 @isdigit(i8 signext %11)
%13 = icmp eq i32 %12, 0
%14 = add nuw i64 %10, 1
br i1 %13, label %20, label %5
15: ; preds = %5, %2
%16 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%17 = load i32, i32* %1
%18 = icmp ult i32 %17, 101
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %9, %15
%21 = phi i32 [ %19, %15 ], [ 0, %9 ]
ret i32 %21
}