#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*/ printf(char *, char *, ...);
int /*<<< orphan*/ send_mail(char *, char *, char *);
scalar_t__ strstr(char *, char *);
void check_response(char *response, char *host_id, char *mailresp,
                    char *mailreq) {
  if (strstr(response, "good"))
    printf("Update of %s succeeded\n", host_id);
  else if (strstr(response, "nochg"))
    printf("Host %s not changed\n", host_id);
  else if (strstr(response, "notfqdn"))
    printf("Host %s is not a Fully-Qualified Domain Name\n", host_id);
  else if (strstr(response, "nohost"))
    printf("Host %s does not exist\n", host_id);
  else if (strstr(response, "!yours"))
    printf("Host %s does not belong to you\n", host_id);
  else if (strstr(response, "abuse"))
    printf("Host %s blocked due to abuse\n", host_id);
  else if (strstr(response, "numhost"))
    printf("Too many or too few hosts found\n", host_id);
  else if (strstr(response, "dnserr"))
    printf("DNS error encountered\n", host_id);
  else if (strstr(response, "Authorization Required"))
    printf("Invalid user credentials supplied\n", host_id);
  else {
    printf("Unknown error: Got response %s on host %s\n", response, host_id);
    send_mail(response, host_id, mailreq);
  }
}


x86 assembly (clang, -O0):
<check_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1179 <check_response+0x49>
mov    -0x10(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1350 <check_response+0x220>
mov    -0x8(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     11aa <check_response+0x7a>
mov    -0x10(%rbp),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    134b <check_response+0x21b>
mov    -0x8(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     11db <check_response+0xab>
mov    -0x10(%rbp),%rsi
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1346 <check_response+0x216>
mov    -0x8(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     120c <check_response+0xdc>
mov    -0x10(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1341 <check_response+0x211>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     123d <check_response+0x10d>
mov    -0x10(%rbp),%rsi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    133c <check_response+0x20c>
mov    -0x8(%rbp),%rdi
lea    0xe6c(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     126e <check_response+0x13e>
mov    -0x10(%rbp),%rsi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1337 <check_response+0x207>
mov    -0x8(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     129f <check_response+0x16f>
mov    -0x10(%rbp),%rsi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1332 <check_response+0x202>
mov    -0x8(%rbp),%rdi
lea    0xe57(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     12d0 <check_response+0x1a0>
mov    -0x10(%rbp),%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    132d <check_response+0x1fd>
mov    -0x8(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1301 <check_response+0x1d1>
mov    -0x10(%rbp),%rsi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1328 <check_response+0x1f8>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <send_mail@plt>
jmp    132d <check_response+0x1fd>
jmp    1332 <check_response+0x202>
jmp    1337 <check_response+0x207>
jmp    133c <check_response+0x20c>
jmp    1341 <check_response+0x211>
jmp    1346 <check_response+0x216>
jmp    134b <check_response+0x21b>
jmp    1350 <check_response+0x220>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_response>:
push   %r15
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xebb(%rip),%rsi
call   1050 <strstr@plt>
test   %rax,%rax
je     115b <check_response+0x2b>
lea    0xeaf(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xebb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     117b <check_response+0x4b>
lea    0xead(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     119b <check_response+0x6b>
lea    0xeaa(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xecc(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11bb <check_response+0x8b>
lea    0xebf(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xecb(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11d8 <check_response+0xa8>
lea    0xebe(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     11f5 <check_response+0xc5>
lea    0xec7(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     1212 <check_response+0xe2>
lea    0xed0(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xee8(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     122f <check_response+0xff>
lea    0xedb(%rip),%rdi
jmp    124a <check_response+0x11a>
lea    0xee9(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strstr@plt>
test   %rax,%rax
je     1259 <check_response+0x129>
lea    0xeec(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>
lea    0xef9(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <send_mail@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"good\00"
@.str.1 = [24 x i8] c"Update of %s succeeded\0A\00"
@.str.2 = [6 x i8] c"nochg\00"
@.str.3 = [21 x i8] c"Host %s not changed\0A\00"
@.str.4 = [8 x i8] c"notfqdn\00"
@.str.5 = [46 x i8] c"Host %s is not a Fully-Qualified Domain Name\0A\00"
@.str.6 = [7 x i8] c"nohost\00"
@.str.7 = [24 x i8] c"Host %s does not exist\0A\00"
@.str.8 = [7 x i8] c"!yours\00"
@.str.9 = [32 x i8] c"Host %s does not belong to you\0A\00"
@.str.10 = [6 x i8] c"abuse\00"
@.str.11 = [30 x i8] c"Host %s blocked due to abuse\0A\00"
@.str.12 = [8 x i8] c"numhost\00"
@.str.13 = [33 x i8] c"Too many or too few hosts found\0A\00"
@.str.14 = [7 x i8] c"dnserr\00"
@.str.15 = [23 x i8] c"DNS error encountered\0A\00"
@.str.16 = [23 x i8] c"Authorization Required\00"
@.str.17 = [35 x i8] c"Invalid user credentials supplied\0A\00"
@.str.18 = [43 x i8] c"Unknown error: Got response %s on host %s\0A\00"
define void @check_response(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = call i64 @strstr(i8* %9, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %6
%14 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %87
15: ; preds = %4
%16 = load i8*, i8** %5
%17 = call i64 @strstr(i8* %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i8*, i8** %6
%21 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %20)
br label %86
22: ; preds = %15
%23 = load i8*, i8** %5
%24 = call i64 @strstr(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = load i8*, i8** %6
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %27)
br label %85
29: ; preds = %22
%30 = load i8*, i8** %5
%31 = call i64 @strstr(i8* %30, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = load i8*, i8** %6
%35 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %34)
br label %84
36: ; preds = %29
%37 = load i8*, i8** %5
%38 = call i64 @strstr(i8* %37, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = load i8*, i8** %6
%42 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %41)
br label %83
43: ; preds = %36
%44 = load i8*, i8** %5
%45 = call i64 @strstr(i8* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%46 = icmp ne i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = load i8*, i8** %6
%49 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8* %48)
br label %82
50: ; preds = %43
%51 = load i8*, i8** %5
%52 = call i64 @strstr(i8* %51, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
%53 = icmp ne i64 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = load i8*, i8** %6
%56 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* %55)
br label %81
57: ; preds = %50
%58 = load i8*, i8** %5
%59 = call i64 @strstr(i8* %58, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %57
%62 = load i8*, i8** %6
%63 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i8* %62)
br label %80
64: ; preds = %57
%65 = load i8*, i8** %5
%66 = call i64 @strstr(i8* %65, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0))
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %64
%69 = load i8*, i8** %6
%70 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0), i8* %69)
br label %79
71: ; preds = %64
%72 = load i8*, i8** %5
%73 = load i8*, i8** %6
%74 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0), i8* %72, i8* %73)
%75 = load i8*, i8** %5
%76 = load i8*, i8** %6
%77 = load i8*, i8** %8
%78 = call i32 @send_mail(i8* %75, i8* %76, i8* %77)
br label %79
79: ; preds = %71, %68
br label %80
80: ; preds = %79, %61
br label %81
81: ; preds = %80, %54
br label %82
82: ; preds = %81, %47
br label %83
83: ; preds = %82, %40
br label %84
84: ; preds = %83, %33
br label %85
85: ; preds = %84, %26
br label %86
86: ; preds = %85, %19
br label %87
87: ; preds = %86, %12
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"good\00"
@.str.1 = [24 x i8] c"Update of %s succeeded\0A\00"
@.str.2 = [6 x i8] c"nochg\00"
@.str.3 = [21 x i8] c"Host %s not changed\0A\00"
@.str.4 = [8 x i8] c"notfqdn\00"
@.str.5 = [46 x i8] c"Host %s is not a Fully-Qualified Domain Name\0A\00"
@.str.6 = [7 x i8] c"nohost\00"
@.str.7 = [24 x i8] c"Host %s does not exist\0A\00"
@.str.8 = [7 x i8] c"!yours\00"
@.str.9 = [32 x i8] c"Host %s does not belong to you\0A\00"
@.str.10 = [6 x i8] c"abuse\00"
@.str.11 = [30 x i8] c"Host %s blocked due to abuse\0A\00"
@.str.12 = [8 x i8] c"numhost\00"
@.str.13 = [33 x i8] c"Too many or too few hosts found\0A\00"
@.str.14 = [7 x i8] c"dnserr\00"
@.str.15 = [23 x i8] c"DNS error encountered\0A\00"
@.str.16 = [23 x i8] c"Authorization Required\00"
@.str.17 = [35 x i8] c"Invalid user credentials supplied\0A\00"
@.str.18 = [43 x i8] c"Unknown error: Got response %s on host %s\0A\00"
define void @check_response(i8* %0, i8* %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %52
9: ; preds = %4
%10 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %1)
br label %52
14: ; preds = %9
%15 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.5, i64 0, i64 0), i8* %1)
br label %52
19: ; preds = %14
%20 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0), i8* %1)
br label %52
24: ; preds = %19
%25 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %24
%28 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i8* %1)
br label %52
29: ; preds = %24
%30 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.11, i64 0, i64 0), i8* %1)
br label %52
34: ; preds = %29
%35 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %39, label %37
37: ; preds = %34
%38 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0), i8* %1)
br label %52
39: ; preds = %34
%40 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %44, label %42
42: ; preds = %39
%43 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.15, i64 0, i64 0), i8* %1)
br label %52
44: ; preds = %39
%45 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.16, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %44
%48 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0), i8* %1)
br label %52
49: ; preds = %44
%50 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.18, i64 0, i64 0), i8* %0, i8* %1)
%51 = tail call i32 @send_mail(i8* %0, i8* %1, i8* %3)
br label %52
52: ; preds = %12, %22, %32, %42, %49, %47, %37, %27, %17, %7
ret void
}