int checkFSType(struct sBootSector *bs) {
  int CountOfClusters;
  CountOfClusters = getCountOfClusters(bs);
  if (CountOfClusters == -1) {
    errormsg(__func__, "Failed to get count of clusters!");
    ;
    return -1;
  }
  if (CountOfClusters <= 65536) {
    errormsg(__func__, "Count of clusters not FAT32!");
    ;
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<checkFSType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <getCountOfClusters@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    1165 <checkFSType+0x45>
lea    0xeb5(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1040 <errormsg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119a <checkFSType+0x7a>
cmpl   $0x10000,-0x14(%rbp)
jg     1193 <checkFSType+0x73>
lea    0xe87(%rip),%rdi
lea    0xead(%rip),%rsi
mov    $0x0,%al
call   1040 <errormsg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    119a <checkFSType+0x7a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkFSType>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getCountOfClusters@plt>
cmp    $0xffffffff,%eax
je     113f <checkFSType+0x1f>
cmp    $0x10000,%eax
jg     1159 <checkFSType+0x39>
lea    0xef0(%rip),%rsi
jmp    1146 <checkFSType+0x26>
lea    0xec6(%rip),%rsi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <errormsg@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.sBootSector = type opaque
@__func__.checkFSType = [12 x i8] c"checkFSType\00"
@.str = [33 x i8] c"Failed to get count of clusters!\00"
@.str.1 = [29 x i8] c"Count of clusters not FAT32!\00"
define i32 @checkFSType(%struct.sBootSector* %0) {
%2 = alloca i32
%3 = alloca %struct.sBootSector*
%4 = alloca i32
store %struct.sBootSector* %0, %struct.sBootSector** %3
%5 = load %struct.sBootSector*, %struct.sBootSector** %3
%6 = call i32 (%struct.sBootSector*, ...) bitcast (i32 (...)* @getCountOfClusters to i32 (%struct.sBootSector*, ...)*)(%struct.sBootSector* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @errormsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.checkFSType, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %17
11: ; preds = %1
%12 = load i32, i32* %4
%13 = icmp sle i32 %12, 65536
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @errormsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.checkFSType, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %17
16: ; preds = %11
store i32 0, i32* %2
br label %17
17: ; preds = %16, %14, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.sBootSector = type opaque
@__func__.checkFSType = [12 x i8] c"checkFSType\00"
@.str = [33 x i8] c"Failed to get count of clusters!\00"
@.str.1 = [29 x i8] c"Count of clusters not FAT32!\00"
define i32 @checkFSType(%struct.sBootSector* %0) {
%2 = tail call i32 (%struct.sBootSector*, ...) bitcast (i32 (...)* @getCountOfClusters to i32 (%struct.sBootSector*, ...)*)(%struct.sBootSector* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = icmp slt i32 %2, 65537
br i1 %5, label %6, label %9
6: ; preds = %4, %1
%7 = phi i8* [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), %4 ]
%8 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @errormsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.checkFSType, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 0, %4 ], [ -1, %6 ]
ret i32 %10
}