#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*/ sprintf(char *, char *);
void panel_utils_gate_time_to_str(char *tempstr, int time) {
  int tm = time / (96 / 24);
  if (tm >= 192) {
    sprintf(tempstr, "w+");
    return;
  } else if (tm >= 96) {
    sprintf(tempstr, "w");
    return;
  } else if (tm >= 72) {
    sprintf(tempstr, "h.");
    return;
  } else if (tm >= 48) {
    sprintf(tempstr, "h");
    return;
  } else if (tm >= 32) {
    sprintf(tempstr, "q.");
    return;
  } else if (tm >= 24) {
    sprintf(tempstr, "q");
    return;
  } else if (tm >= 18) {
    sprintf(tempstr, "8.");
    return;
  } else if (tm >= 12) {
    sprintf(tempstr, "8");
    return;
  } else if (tm >= 9) {
    sprintf(tempstr, "16.");
    return;
  } else if (tm >= 6) {
    sprintf(tempstr, "16");
    return;
  } else if (tm >= 4) {
    sprintf(tempstr, "32.");
    return;
  } else if (tm >= 3) {
    sprintf(tempstr, "32");
    return;
  } else if (tm >= 2) {
    sprintf(tempstr, "64.");
    return;
  }
  sprintf(tempstr, "64");
}


x86 assembly (clang, -O0):
<panel_utils_gate_time_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0xc0,-0x10(%rbp)
jl     114f <panel_utils_gate_time_to_str+0x3f>
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x60,-0x10(%rbp)
jl     116e <panel_utils_gate_time_to_str+0x5e>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x48,-0x10(%rbp)
jl     118d <panel_utils_gate_time_to_str+0x7d>
mov    -0x8(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x30,-0x10(%rbp)
jl     11ac <panel_utils_gate_time_to_str+0x9c>
mov    -0x8(%rbp),%rdi
lea    0xe66(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x20,-0x10(%rbp)
jl     11cb <panel_utils_gate_time_to_str+0xbb>
mov    -0x8(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x18,-0x10(%rbp)
jl     11ea <panel_utils_gate_time_to_str+0xda>
mov    -0x8(%rbp),%rdi
lea    0xe2d(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x12,-0x10(%rbp)
jl     1209 <panel_utils_gate_time_to_str+0xf9>
mov    -0x8(%rbp),%rdi
lea    0xe10(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0xc,-0x10(%rbp)
jl     1228 <panel_utils_gate_time_to_str+0x118>
mov    -0x8(%rbp),%rdi
lea    0xdf4(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x9,-0x10(%rbp)
jl     1247 <panel_utils_gate_time_to_str+0x137>
mov    -0x8(%rbp),%rdi
lea    0xdd7(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x6,-0x10(%rbp)
jl     1266 <panel_utils_gate_time_to_str+0x156>
mov    -0x8(%rbp),%rdi
lea    0xdbc(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x4,-0x10(%rbp)
jl     1285 <panel_utils_gate_time_to_str+0x175>
mov    -0x8(%rbp),%rdi
lea    0xda0(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x3,-0x10(%rbp)
jl     12a4 <panel_utils_gate_time_to_str+0x194>
mov    -0x8(%rbp),%rdi
lea    0xd85(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
cmpl   $0x2,-0x10(%rbp)
jl     12c3 <panel_utils_gate_time_to_str+0x1b3>
mov    -0x8(%rbp),%rdi
lea    0xd69(%rip),%rsi
call   1030 <sprintf@plt>
jmp    130f <panel_utils_gate_time_to_str+0x1ff>
jmp    12c8 <panel_utils_gate_time_to_str+0x1b8>
jmp    12cd <panel_utils_gate_time_to_str+0x1bd>
jmp    12d2 <panel_utils_gate_time_to_str+0x1c2>
jmp    12d7 <panel_utils_gate_time_to_str+0x1c7>
jmp    12dc <panel_utils_gate_time_to_str+0x1cc>
jmp    12e1 <panel_utils_gate_time_to_str+0x1d1>
jmp    12e6 <panel_utils_gate_time_to_str+0x1d6>
jmp    12eb <panel_utils_gate_time_to_str+0x1db>
jmp    12f0 <panel_utils_gate_time_to_str+0x1e0>
jmp    12f5 <panel_utils_gate_time_to_str+0x1e5>
jmp    12fa <panel_utils_gate_time_to_str+0x1ea>
jmp    12ff <panel_utils_gate_time_to_str+0x1ef>
mov    -0x8(%rbp),%rdi
lea    0xd1c(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panel_utils_gate_time_to_str>:
cmp    $0x300,%esi
jl     1112 <panel_utils_gate_time_to_str+0x12>
movb   $0x0,0x2(%rdi)
movw   $0x2b77,(%rdi)
ret
cmp    $0x180,%esi
jl     1120 <panel_utils_gate_time_to_str+0x20>
movw   $0x77,(%rdi)
ret
cmp    $0x120,%esi
jl     1132 <panel_utils_gate_time_to_str+0x32>
movb   $0x0,0x2(%rdi)
movw   $0x2e68,(%rdi)
ret
cmp    $0xc0,%esi
jl     1140 <panel_utils_gate_time_to_str+0x40>
movw   $0x68,(%rdi)
ret
cmp    $0x80,%esi
jl     1152 <panel_utils_gate_time_to_str+0x52>
movb   $0x0,0x2(%rdi)
movw   $0x2e71,(%rdi)
ret
cmp    $0x60,%esi
jl     115d <panel_utils_gate_time_to_str+0x5d>
movw   $0x71,(%rdi)
ret
cmp    $0x48,%esi
jl     116c <panel_utils_gate_time_to_str+0x6c>
movb   $0x0,0x2(%rdi)
movw   $0x2e38,(%rdi)
ret
cmp    $0x30,%esi
jl     1177 <panel_utils_gate_time_to_str+0x77>
movw   $0x38,(%rdi)
ret
cmp    $0x24,%esi
jl     1183 <panel_utils_gate_time_to_str+0x83>
movl   $0x2e3631,(%rdi)
ret
cmp    $0x18,%esi
jl     1192 <panel_utils_gate_time_to_str+0x92>
movb   $0x0,0x2(%rdi)
movw   $0x3631,(%rdi)
ret
cmp    $0x10,%esi
jl     119e <panel_utils_gate_time_to_str+0x9e>
movl   $0x2e3233,(%rdi)
ret
cmp    $0xc,%esi
jl     11ad <panel_utils_gate_time_to_str+0xad>
movb   $0x0,0x2(%rdi)
movw   $0x3233,(%rdi)
ret
cmp    $0x8,%esi
jl     11b9 <panel_utils_gate_time_to_str+0xb9>
movl   $0x2e3436,(%rdi)
ret
movb   $0x0,0x2(%rdi)
movw   $0x3436,(%rdi)
ret

LLVM IR (-O0):
@.str = [3 x i8] c"w+\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"h.\00"
@.str.3 = [2 x i8] c"h\00"
@.str.4 = [3 x i8] c"q.\00"
@.str.5 = [2 x i8] c"q\00"
@.str.6 = [3 x i8] c"8.\00"
@.str.7 = [2 x i8] c"8\00"
@.str.8 = [4 x i8] c"16.\00"
@.str.9 = [3 x i8] c"16\00"
@.str.10 = [4 x i8] c"32.\00"
@.str.11 = [3 x i8] c"32\00"
@.str.12 = [4 x i8] c"64.\00"
@.str.13 = [3 x i8] c"64\00"
define void @panel_utils_gate_time_to_str(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 4
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 192
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %100
13: ; preds = %2
%14 = load i32, i32* %5
%15 = icmp sge i32 %14, 96
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = load i8*, i8** %3
%18 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %100
19: ; preds = %13
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 72
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i8*, i8** %3
%24 = call i32 @sprintf(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %100
25: ; preds = %19
%26 = load i32, i32* %5
%27 = icmp sge i32 %26, 48
br i1 %27, label %28, label %31
28: ; preds = %25
%29 = load i8*, i8** %3
%30 = call i32 @sprintf(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %100
31: ; preds = %25
%32 = load i32, i32* %5
%33 = icmp sge i32 %32, 32
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load i8*, i8** %3
%36 = call i32 @sprintf(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %100
37: ; preds = %31
%38 = load i32, i32* %5
%39 = icmp sge i32 %38, 24
br i1 %39, label %40, label %43
40: ; preds = %37
%41 = load i8*, i8** %3
%42 = call i32 @sprintf(i8* %41, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %100
43: ; preds = %37
%44 = load i32, i32* %5
%45 = icmp sge i32 %44, 18
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i8*, i8** %3
%48 = call i32 @sprintf(i8* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
br label %100
49: ; preds = %43
%50 = load i32, i32* %5
%51 = icmp sge i32 %50, 12
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = load i8*, i8** %3
%54 = call i32 @sprintf(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
br label %100
55: ; preds = %49
%56 = load i32, i32* %5
%57 = icmp sge i32 %56, 9
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i8*, i8** %3
%60 = call i32 @sprintf(i8* %59, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
br label %100
61: ; preds = %55
%62 = load i32, i32* %5
%63 = icmp sge i32 %62, 6
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i8*, i8** %3
%66 = call i32 @sprintf(i8* %65, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %100
67: ; preds = %61
%68 = load i32, i32* %5
%69 = icmp sge i32 %68, 4
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i8*, i8** %3
%72 = call i32 @sprintf(i8* %71, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
br label %100
73: ; preds = %67
%74 = load i32, i32* %5
%75 = icmp sge i32 %74, 3
br i1 %75, label %76, label %79
76: ; preds = %73
%77 = load i8*, i8** %3
%78 = call i32 @sprintf(i8* %77, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %100
79: ; preds = %73
%80 = load i32, i32* %5
%81 = icmp sge i32 %80, 2
br i1 %81, label %82, label %85
82: ; preds = %79
%83 = load i8*, i8** %3
%84 = call i32 @sprintf(i8* %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0))
br label %100
85: ; preds = %79
br label %86
86: ; preds = %85
br label %87
87: ; preds = %86
br label %88
88: ; preds = %87
br label %89
89: ; preds = %88
br label %90
90: ; preds = %89
br label %91
91: ; preds = %90
br label %92
92: ; preds = %91
br label %93
93: ; preds = %92
br label %94
94: ; preds = %93
br label %95
95: ; preds = %94
br label %96
96: ; preds = %95
br label %97
97: ; preds = %96
%98 = load i8*, i8** %3
%99 = call i32 @sprintf(i8* %98, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0))
br label %100
100: ; preds = %97, %82, %76, %70, %64, %58, %52, %46, %40, %34, %28, %22, %16, %10
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"w+\00"
@.str.2 = [3 x i8] c"h.\00"
@.str.4 = [3 x i8] c"q.\00"
@.str.6 = [3 x i8] c"8.\00"
@.str.9 = [3 x i8] c"16\00"
@.str.11 = [3 x i8] c"32\00"
@.str.13 = [3 x i8] c"64\00"
define void @panel_utils_gate_time_to_str(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 767
br i1 %3, label %4, label %5
4: ; preds = %2
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i64 3, i1 false)
br label %49
5: ; preds = %2
%6 = icmp sgt i32 %1, 383
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = bitcast i8* %0 to i16*
store i16 119, i16* %8
br label %49
9: ; preds = %5
%10 = icmp sgt i32 %1, 287
br i1 %10, label %11, label %12
11: ; preds = %9
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i64 3, i1 false)
br label %49
12: ; preds = %9
%13 = icmp sgt i32 %1, 191
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = bitcast i8* %0 to i16*
store i16 104, i16* %15
br label %49
16: ; preds = %12
%17 = icmp sgt i32 %1, 127
br i1 %17, label %18, label %19
18: ; preds = %16
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i64 3, i1 false)
br label %49
19: ; preds = %16
%20 = icmp sgt i32 %1, 95
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = bitcast i8* %0 to i16*
store i16 113, i16* %22
br label %49
23: ; preds = %19
%24 = icmp sgt i32 %1, 71
br i1 %24, label %25, label %26
25: ; preds = %23
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i64 3, i1 false)
br label %49
26: ; preds = %23
%27 = icmp sgt i32 %1, 47
br i1 %27, label %28, label %30
28: ; preds = %26
%29 = bitcast i8* %0 to i16*
store i16 56, i16* %29
br label %49
30: ; preds = %26
%31 = icmp sgt i32 %1, 35
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = bitcast i8* %0 to i32*
store i32 3028529, i32* %33
br label %49
34: ; preds = %30
%35 = icmp sgt i32 %1, 23
br i1 %35, label %36, label %37
36: ; preds = %34
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i64 3, i1 false)
br label %49
37: ; preds = %34
%38 = icmp sgt i32 %1, 15
br i1 %38, label %39, label %41
39: ; preds = %37
%40 = bitcast i8* %0 to i32*
store i32 3027507, i32* %40
br label %49
41: ; preds = %37
%42 = icmp sgt i32 %1, 11
br i1 %42, label %43, label %44
43: ; preds = %41
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i64 3, i1 false)
br label %49
44: ; preds = %41
%45 = icmp sgt i32 %1, 7
br i1 %45, label %46, label %48
46: ; preds = %44
%47 = bitcast i8* %0 to i32*
store i32 3028022, i32* %47
br label %49
48: ; preds = %44
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %0, i8* align 1 dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i64 0, i64 0), i64 3, i1 false)
br label %49
49: ; preds = %48, %46, %43, %39, %36, %32, %28, %25, %21, %18, %14, %11, %7, %4
ret void
}