#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 */
#define LOG_DEBUG 133
#define LOG_EMERG 132
#define LOG_ERR 131
#define LOG_INFO 130
#define LOG_NOTICE 129
#define LOG_WARNING 128
int /*<<< orphan*/ _debug(char *, int, int const, char *, int);
int do_log(int level, int debuglevel) {
  switch (level) {
  case LOG_EMERG:
  case LOG_ERR:
    return (debuglevel >= 0);
  case LOG_WARNING:
  case LOG_NOTICE:
    return (debuglevel >= 1);
  case LOG_INFO:
    return (debuglevel >= 2);
  case LOG_DEBUG:
    return (debuglevel >= 3);
  default:
    _debug("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/lynxis/nodogsplash/refs/heads/master/src/"
           "debug.c",
           56, LOG_ERR, "Unhandled debug level: %d", level);
    return 1;
  }
}


x86 assembly (clang, -O0):
<do_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffff80,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x5,%eax
ja     1197 <do_log+0x87>
mov    -0x18(%rbp),%rax
lea    0xec2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11bf <do_log+0xaf>
cmpl   $0x1,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11bf <do_log+0xaf>
cmpl   $0x2,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11bf <do_log+0xaf>
cmpl   $0x3,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    11bf <do_log+0xaf>
mov    -0x8(%rbp),%r8d
lea    0xe76(%rip),%rdi
mov    $0x38,%esi
mov    $0x83,%edx
lea    0xef0(%rip),%rcx
call   1030 <_debug@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_log>:
push   %rax
mov    %edi,%r8d
lea    -0x80(%r8),%eax
cmp    $0x5,%eax
ja     113b <do_log+0x2b>
lea    0xedc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
test   %esi,%esi
setg   %al
jmp    1167 <do_log+0x57>
test   %esi,%esi
setns  %al
jmp    1167 <do_log+0x57>
lea    0xed6(%rip),%rdi
lea    0xf5a(%rip),%rcx
mov    $0x38,%esi
mov    $0x83,%edx
call   1030 <_debug@plt>
mov    $0x1,%al
jmp    1167 <do_log+0x57>
cmp    $0x2,%esi
jmp    1164 <do_log+0x54>
cmp    $0x3,%esi
setge  %al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lynxis/nodogsplash/refs/heads/master/src/debug.c\00"
@.str.1 = [26 x i8] c"Unhandled debug level: %d\00"
define i32 @do_log(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
switch i32 %6, label %23 [
i32 132, label %7
i32 131, label %7
i32 128, label %11
i32 129, label %11
i32 130, label %15
i32 133, label %19
]
7: ; preds = %2, %2
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 0
%10 = zext i1 %9 to i32
store i32 %10, i32* %3
br label %26
11: ; preds = %2, %2
%12 = load i32, i32* %5
%13 = icmp sge i32 %12, 1
%14 = zext i1 %13 to i32
store i32 %14, i32* %3
br label %26
15: ; preds = %2
%16 = load i32, i32* %5
%17 = icmp sge i32 %16, 2
%18 = zext i1 %17 to i32
store i32 %18, i32* %3
br label %26
19: ; preds = %2
%20 = load i32, i32* %5
%21 = icmp sge i32 %20, 3
%22 = zext i1 %21 to i32
store i32 %22, i32* %3
br label %26
23: ; preds = %2
%24 = load i32, i32* %4
%25 = call i32 @_debug(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 56, i32 131, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %24)
store i32 1, i32* %3
br label %26
26: ; preds = %23, %19, %15, %11, %7
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@.str = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/lynxis/nodogsplash/refs/heads/master/src/debug.c\00"
@.str.1 = [26 x i8] c"Unhandled debug level: %d\00"
define i32 @do_log(i32 %0, i32 %1) {
switch i32 %0, label %11 [
i32 132, label %3
i32 131, label %3
i32 128, label %5
i32 129, label %5
i32 130, label %7
i32 133, label %9
]
3: ; preds = %2, %2
%4 = icmp sgt i32 %1, -1
br label %13
5: ; preds = %2, %2
%6 = icmp sgt i32 %1, 0
br label %13
7: ; preds = %2
%8 = icmp sgt i32 %1, 1
br label %13
9: ; preds = %2
%10 = icmp sgt i32 %1, 2
br label %13
11: ; preds = %2
%12 = tail call i32 @_debug(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0), i32 56, i32 131, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %13
13: ; preds = %11, %9, %7, %5, %3
%14 = phi i1 [ true, %11 ], [ %10, %9 ], [ %8, %7 ], [ %6, %5 ], [ %4, %3 ]
%15 = zext i1 %14 to i32
ret i32 %15
}