#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*/ gui_set_label_highlight(int, int, int, int);
int /*<<< orphan*/ log_error(char *, int, ...);
void gui_set_status_highlight_part(int line, int startch, int lench, int mode) {
  if (line < 0 || line >= 4) {
    log_error("gsshp - line invalid: %d", line);
    return;
  }
  if (startch < 0 || lench < 1 || (startch + lench) >= 64) {
    log_error("gsshp - range invalid - s: %d - l: %d", startch, lench);
    return;
  }
  gui_set_label_highlight(7 + line, startch, lench, mode);
}


x86 assembly (clang, -O0):
<gui_set_status_highlight_part>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1148 <gui_set_status_highlight_part+0x28>
cmpl   $0x4,-0x4(%rbp)
jl     115e <gui_set_status_highlight_part+0x3e>
mov    -0x4(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <log_error@plt>
jmp    11ae <gui_set_status_highlight_part+0x8e>
cmpl   $0x0,-0x8(%rbp)
jl     1181 <gui_set_status_highlight_part+0x61>
cmpl   $0x1,-0xc(%rbp)
jl     1181 <gui_set_status_highlight_part+0x61>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x40,%eax
jl     119a <gui_set_status_highlight_part+0x7a>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <log_error@plt>
jmp    11ae <gui_set_status_highlight_part+0x8e>
mov    -0x4(%rbp),%edi
add    $0x7,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <gui_set_label_highlight@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_set_status_highlight_part>:
mov    %edi,%eax
cmp    $0x4,%edi
jb     1137 <gui_set_status_highlight_part+0x17>
lea    0xed2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <log_error@plt>
test   %esi,%esi
js     1151 <gui_set_status_highlight_part+0x31>
test   %edx,%edx
jle    1151 <gui_set_status_highlight_part+0x31>
lea    (%rdx,%rsi,1),%edi
cmp    $0x40,%edi
jge    1151 <gui_set_status_highlight_part+0x31>
add    $0x7,%eax
mov    %eax,%edi
jmp    1040 <gui_set_label_highlight@plt>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
jmp    1030 <log_error@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"gsshp - line invalid: %d\00"
@.str.1 = [38 x i8] c"gsshp - range invalid - s: %d - l: %d\00"
define void @gui_set_status_highlight_part(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = load i32, i32* %5
%13 = icmp sge i32 %12, 4
br i1 %13, label %14, label %17
14: ; preds = %11, %4
%15 = load i32, i32* %5
%16 = call i32 (i8*, i32, ...) @log_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %39
17: ; preds = %11
%18 = load i32, i32* %6
%19 = icmp slt i32 %18, 0
br i1 %19, label %28, label %20
20: ; preds = %17
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 1
br i1 %22, label %28, label %23
23: ; preds = %20
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = add nsw i32 %24, %25
%27 = icmp sge i32 %26, 64
br i1 %27, label %28, label %32
28: ; preds = %23, %20, %17
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = call i32 (i8*, i32, ...) @log_error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %29, i32 %30)
br label %39
32: ; preds = %23
%33 = load i32, i32* %5
%34 = add nsw i32 7, %33
%35 = load i32, i32* %6
%36 = load i32, i32* %7
%37 = load i32, i32* %8
%38 = call i32 @gui_set_label_highlight(i32 %34, i32 %35, i32 %36, i32 %37)
br label %39
39: ; preds = %32, %28, %14
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"gsshp - line invalid: %d\00"
@.str.1 = [38 x i8] c"gsshp - range invalid - s: %d - l: %d\00"
define void @gui_set_status_highlight_part(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp ugt i32 %0, 3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i8*, i32, ...) @log_error(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %20
8: ; preds = %4
%9 = icmp slt i32 %1, 0
%10 = icmp slt i32 %2, 1
%11 = or i1 %9, %10
%12 = add nsw i32 %2, %1
%13 = icmp sgt i32 %12, 63
%14 = select i1 %11, i1 true, i1 %13
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = tail call i32 (i8*, i32, ...) @log_error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2)
br label %20
17: ; preds = %8
%18 = add nuw nsw i32 %0, 7
%19 = tail call i32 @gui_set_label_highlight(i32 %18, i32 %1, i32 %2, i32 %3)
br label %20
20: ; preds = %17, %15, %6
ret void
}