#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 */
typedef int /*<<< orphan*/ request;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ write(int, int *, int);
void set_debug_level(int sockfd) {
  int input;
  int request_type = 20;
  int request = 26;
  printf(" Enter the level of debug to enable.\n\t None --- 0\n\t Warnings --- "
         "1\n\t Basic --- 2\n\t Verbose --- 3 ");
  scanf("%d", &input);
  write(sockfd, &request_type, sizeof(int));
  write(sockfd, &request, sizeof(request));
}


x86 assembly (clang, -O0):
<set_debug_level>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0x1a,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xf06(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_debug_level>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movl   $0x14,0x8(%rsp)
movl   $0x1a,0x4(%rsp)
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
lea    0xf08(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1030 <write@plt>
lea    0x4(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [98 x i8] c" Enter the level of debug to enable.\0A\09 None --- 0\0A\09 Warnings --- 1\0A\09 Basic --- 2\0A\09 Verbose --- 3 \00"
@.str.1 = [3 x i8] c"%d\00"
define void @set_debug_level(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 20, i32* %4
store i32 26, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %2
%9 = call i32 @write(i32 %8, i32* %4, i32 4)
%10 = load i32, i32* %2
%11 = call i32 @write(i32 %10, i32* %5, i32 4)
ret void
}

LLVM IR (-O2):
@.str = [98 x i8] c" Enter the level of debug to enable.\0A\09 None --- 0\0A\09 Warnings --- 1\0A\09 Basic --- 2\0A\09 Verbose --- 3 \00"
@.str.1 = [3 x i8] c"%d\00"
define void @set_debug_level(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
store i32 20, i32* %3
%7 = bitcast i32* %4 to i8*
store i32 26, i32* %4
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 @write(i32 %0, i32* %3, i32 4)
%11 = call i32 @write(i32 %0, i32* %4, i32 4)
ret void
}