handle_server_response(response, server) int response;
char *server;
{
  switch (response) {
  case 201:
    printf("NOTE: This machine does not have permission to post articles.\n");
    printf("      Please don't waste your time trying.\n\n");
  case 200:
    return (0);
    break;
  case 502:
    printf("This machine does not have permission to use the %s news server.\n",
           server);
    return (-1);
    break;
  default:
    printf("Unexpected response code from %s news server: %d\n", server,
           response);
    return (-1);
    break;
  }
}


x86 assembly (clang, -O0):
<handle_server_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0xc8,%eax
je     1177 <handle_server_response+0x67>
jmp    1135 <handle_server_response+0x25>
mov    -0x14(%rbp),%eax
sub    $0xc9,%eax
je     115b <handle_server_response+0x4b>
jmp    1148 <handle_server_response+0x38>
mov    -0x14(%rbp),%eax
sub    $0x1f6,%eax
je     1183 <handle_server_response+0x73>
jmp    11a1 <handle_server_response+0x91>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11bd <handle_server_response+0xad>
mov    -0x10(%rbp),%rsi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bd <handle_server_response+0xad>
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0xeff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_server_response>:
push   %rbx
xor    %ebx,%ebx
cmp    $0xc8,%edi
je     117a <handle_server_response+0x5a>
mov    %edi,%edx
cmp    $0x1f6,%edi
je     1157 <handle_server_response+0x37>
cmp    $0xc9,%edx
jne    1167 <handle_server_response+0x47>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xf62(%rip),%rdi
call   1030 <puts@plt>
jmp    117a <handle_server_response+0x5a>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1175 <handle_server_response+0x55>
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"NOTE: This machine does not have permission to post articles.\0A\00"
@.str.1 = [45 x i8] c" Please don't waste your time trying.\0A\0A\00"
@.str.2 = [66 x i8] c"This machine does not have permission to use the %s news server.\0A\00"
@.str.3 = [50 x i8] c"Unexpected response code from %s news server: %d\0A\00"
define i32 @handle_server_response(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
switch i32 %6, label %14 [
i32 201, label %7
i32 200, label %10
i32 502, label %11
]
7: ; preds = %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %2, %7
store i32 0, i32* %3
br label %18
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), i8* %12)
store i32 -1, i32* %3
br label %18
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i8* %15, i32 %16)
store i32 -1, i32* %3
br label %18
18: ; preds = %14, %11, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str.2 = [66 x i8] c"This machine does not have permission to use the %s news server.\0A\00"
@.str.3 = [50 x i8] c"Unexpected response code from %s news server: %d\0A\00"
@str = [62 x i8] c"NOTE: This machine does not have permission to post articles.\00"
@str.4 = [44 x i8] c" Please don't waste your time trying.\0A\00"
define i32 @handle_server_response(i32 %0, i8* %1) {
switch i32 %0, label %8 [
i32 201, label %3
i32 200, label %10
i32 502, label %6
]
3: ; preds = %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.4, i64 0, i64 0))
br label %10
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.2, i64 0, i64 0), i8* %1)
br label %10
8: ; preds = %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0), i8* %1, i32 %0)
br label %10
10: ; preds = %3, %2, %8, %6
%11 = phi i32 [ -1, %8 ], [ -1, %6 ], [ 0, %2 ], [ 0, %3 ]
ret i32 %11
}