#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 GetBurstLen(char *tempstr, unsigned int BurstLen) {
  if (BurstLen < 124) {
    sprintf(tempstr, "%u", BurstLen + 1);
  } else if (BurstLen == 124) {
    sprintf(tempstr, "b0");
  } else if (BurstLen == 125) {
    sprintf(tempstr, "b1");
  } else if (BurstLen == 126) {
    sprintf(tempstr, "b2");
  } else if (BurstLen == 127) {
    sprintf(tempstr, "b3");
  } else {
    sprintf(tempstr, "XX");
  }
}


x86 assembly (clang, -O0):
<GetBurstLen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x7c,-0xc(%rbp)
jae    1146 <GetBurstLen+0x36>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
lea    0xec6(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    11f0 <GetBurstLen+0xe0>
cmpl   $0x7c,-0xc(%rbp)
jne    1167 <GetBurstLen+0x57>
mov    -0x8(%rbp),%rdi
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    11eb <GetBurstLen+0xdb>
cmpl   $0x7d,-0xc(%rbp)
jne    1188 <GetBurstLen+0x78>
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    11e6 <GetBurstLen+0xd6>
cmpl   $0x7e,-0xc(%rbp)
jne    11a9 <GetBurstLen+0x99>
mov    -0x8(%rbp),%rdi
lea    0xe6c(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    11e1 <GetBurstLen+0xd1>
cmpl   $0x7f,-0xc(%rbp)
jne    11ca <GetBurstLen+0xba>
mov    -0x8(%rbp),%rdi
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    11dc <GetBurstLen+0xcc>
mov    -0x8(%rbp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
jmp    11e1 <GetBurstLen+0xd1>
jmp    11e6 <GetBurstLen+0xd6>
jmp    11eb <GetBurstLen+0xdb>
jmp    11f0 <GetBurstLen+0xe0>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetBurstLen>:
mov    %esi,%edx
cmp    $0x7b,%esi
ja     1128 <GetBurstLen+0x18>
add    $0x1,%edx
lea    0xeef(%rip),%rsi
xor    %eax,%eax
jmp    1030 <sprintf@plt>
add    $0xffffff84,%edx
cmp    $0x3,%edx
ja     114a <GetBurstLen+0x3a>
lea    0xec9(%rip),%rax
movslq (%rax,%rdx,4),%rcx
add    %rax,%rcx
jmp    *%rcx
movb   $0x0,0x2(%rdi)
movw   $0x3062,(%rdi)
ret
movb   $0x0,0x2(%rdi)
movw   $0x5858,(%rdi)
ret
movb   $0x0,0x2(%rdi)
movw   $0x3162,(%rdi)
ret
movb   $0x0,0x2(%rdi)
movw   $0x3262,(%rdi)
ret
movb   $0x0,0x2(%rdi)
movw   $0x3362,(%rdi)
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c"b0\00"
@.str.2 = [3 x i8] c"b1\00"
@.str.3 = [3 x i8] c"b2\00"
@.str.4 = [3 x i8] c"b3\00"
@.str.5 = [3 x i8] c"XX\00"
define void @GetBurstLen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ult i32 %5, 124
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = add i32 %9, 1
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %43
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 124
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %42
18: ; preds = %12
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 125
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i8*, i8** %3
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %41
24: ; preds = %18
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 126
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i8*, i8** %3
%29 = call i32 (i8*, i8*, ...) @sprintf(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %40
30: ; preds = %24
%31 = load i32, i32* %4
%32 = icmp eq i32 %31, 127
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load i8*, i8** %3
%35 = call i32 (i8*, i8*, ...) @sprintf(i8* %34, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %39
36: ; preds = %30
%37 = load i8*, i8** %3
%38 = call i32 (i8*, i8*, ...) @sprintf(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %39
39: ; preds = %36, %33
br label %40
40: ; preds = %39, %27
br label %41
41: ; preds = %40, %21
br label %42
42: ; preds = %41, %15
br label %43
43: ; preds = %42, %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [3 x i8] c"b0\00"
@.str.2 = [3 x i8] c"b1\00"
@.str.3 = [3 x i8] c"b2\00"
@.str.4 = [3 x i8] c"b3\00"
@.str.5 = [3 x i8] c"XX\00"
define void @GetBurstLen(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp ult i32 %1, 124
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nuw nsw i32 %1, 1
%6 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %13
7: ; preds = %2
switch i32 %1, label %12 [
i32 124, label %8
i32 125, label %9
i32 126, label %10
i32 127, label %11
]
8: ; preds = %7
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.1, i64 0, i64 0), i64 3, i1 false)
br label %13
9: ; preds = %7
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 %13
10: ; preds = %7
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.3, i64 0, i64 0), i64 3, i1 false)
br label %13
11: ; preds = %7
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 %13
12: ; preds = %7
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.5, i64 0, i64 0), i64 3, i1 false)
br label %13
13: ; preds = %8, %10, %12, %11, %9, %4
ret void
}