#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 */
struct trace_seq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ trace_seq_printf(struct trace_seq *, char *);
void print_graph_overhead(struct trace_seq *s, unsigned long long duration) {
  if (duration == ~0ULL)
    return (void)trace_seq_printf(s, "  ");
  if (duration > 100000ULL)
    return (void)trace_seq_printf(s, "! ");
  if (duration > 10000ULL)
    return (void)trace_seq_printf(s, "+ ");
  trace_seq_printf(s, "  ");
}


x86 assembly (clang, -O0):
<print_graph_overhead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1140 <print_graph_overhead+0x30>
mov    -0x8(%rbp),%rdi
lea    0xeca(%rip),%rsi
call   1030 <trace_seq_printf@plt>
jmp    1196 <print_graph_overhead+0x86>
cmpq   $0x186a0,-0x10(%rbp)
jbe    1163 <print_graph_overhead+0x53>
mov    -0x8(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <trace_seq_printf@plt>
jmp    1196 <print_graph_overhead+0x86>
cmpq   $0x2710,-0x10(%rbp)
jbe    1186 <print_graph_overhead+0x76>
mov    -0x8(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1030 <trace_seq_printf@plt>
jmp    1196 <print_graph_overhead+0x86>
mov    -0x8(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1030 <trace_seq_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_graph_overhead>:
cmp    $0xffffffffffffffff,%rsi
je     112b <print_graph_overhead+0x1b>
cmp    $0x186a0,%rsi
jbe    1137 <print_graph_overhead+0x27>
lea    0xedd(%rip),%rsi
jmp    1030 <trace_seq_printf@plt>
lea    0xece(%rip),%rsi
jmp    1030 <trace_seq_printf@plt>
cmp    $0x2711,%rsi
lea    0xec1(%rip),%rax
lea    0xeb4(%rip),%rsi
cmovae %rax,%rsi
jmp    1030 <trace_seq_printf@plt>

LLVM IR (-O0):
%struct.trace_seq = type { i32 }
@.str = [3 x i8] c" \00"
@.str.1 = [3 x i8] c"! \00"
@.str.2 = [3 x i8] c"+ \00"
define void @print_graph_overhead(%struct.trace_seq* %0, i64 %1) {
%3 = alloca %struct.trace_seq*
%4 = alloca i64
store %struct.trace_seq* %0, %struct.trace_seq** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load %struct.trace_seq*, %struct.trace_seq** %3
%9 = call i32 @trace_seq_printf(%struct.trace_seq* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %25
10: ; preds = %2
%11 = load i64, i64* %4
%12 = icmp ugt i64 %11, 100000
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load %struct.trace_seq*, %struct.trace_seq** %3
%15 = call i32 @trace_seq_printf(%struct.trace_seq* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %25
16: ; preds = %10
%17 = load i64, i64* %4
%18 = icmp ugt i64 %17, 10000
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load %struct.trace_seq*, %struct.trace_seq** %3
%21 = call i32 @trace_seq_printf(%struct.trace_seq* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %25
22: ; preds = %16
%23 = load %struct.trace_seq*, %struct.trace_seq** %3
%24 = call i32 @trace_seq_printf(%struct.trace_seq* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %22, %19, %13, %7
ret void
}

LLVM IR (-O2):
%struct.trace_seq = type { i32 }
@.str = [3 x i8] c" \00"
@.str.1 = [3 x i8] c"! \00"
@.str.2 = [3 x i8] c"+ \00"
define void @print_graph_overhead(%struct.trace_seq* %0, i64 %1) {
%3 = icmp eq i64 %1, -1
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = icmp ugt i64 %1, 100000
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = icmp ugt i64 %1, 10000
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
br label %9
9: ; preds = %6, %4, %2
%10 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %4 ], [ %8, %6 ]
%11 = tail call i32 @trace_seq_printf(%struct.trace_seq* %0, i8* %10)
ret void
}