#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
void process_response_code(unsigned char response_code) {
  switch (response_code) {
  case 0:
    printf("Succesfully updated your IP\n");
    break;
  case 1:
    fprintf(stderr,
            "Could not update your IP because an invalid token was supplied\n");
    break;
  default:
    fprintf(stderr, "Received an unknown response from the server: %d\n",
            response_code);
  }
}


x86 assembly (clang, -O0):
<process_response_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1153 <process_response_code+0x33>
jmp    1142 <process_response_code+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1164 <process_response_code+0x44>
jmp    1180 <process_response_code+0x60>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    119b <process_response_code+0x7b>
mov    0x2e75(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    119b <process_response_code+0x7b>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
movzbl -0x1(%rbp),%edx
lea    0xec9(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_response_code>:
cmp    $0x1,%dil
je     1137 <process_response_code+0x17>
test   %dil,%dil
jne    114e <process_response_code+0x2e>
lea    0xf40(%rip),%rdi
jmp    1030 <puts@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
jmp    1040 <fprintf@plt>
movzbl %dil,%edx
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
xor    %eax,%eax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Succesfully updated your IP\0A\00"
@stderr = global i32 0
@.str.1 = [64 x i8] c"Could not update your IP because an invalid token was supplied\0A\00"
@.str.2 = [50 x i8] c"Received an unknown response from the server: %d\0A\00"
define void @process_response_code(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %10 [
i32 0, label %5
i32 1, label %7
]
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %15
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
br label %15
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %10, %7, %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [64 x i8] c"Could not update your IP because an invalid token was supplied\0A\00"
@.str.2 = [50 x i8] c"Received an unknown response from the server: %d\0A\00"
@str = [28 x i8] c"Succesfully updated your IP\00"
define void @process_response_code(i8 zeroext %0) {
switch i8 %0, label %7 [
i8 0, label %2
i8 1, label %4
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
br label %11
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
br label %11
7: ; preds = %1
%8 = zext i8 %0 to i32
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %11
11: ; preds = %7, %4, %2
ret void
}