#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 */
char *strchr(char *, char);
scalar_t__ strstr(char const *, char *);
char check_compressed(const char *reply) {
  if (reply != NULL) {
    char *encoding = strstr(reply, "\nContent-Encoding:");
    if (encoding) {
      char *dummy = strchr(encoding + 1, '\r');
      if (dummy)
        *dummy = 0x00;
      dummy = strchr(encoding + 1, '\n');
      if (dummy)
        *dummy = 0x00;
      if (strstr(encoding, "gzip") == 0 || strstr(encoding, "deflate") == 0)
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_compressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11ed <check_compressed+0xcd>
mov    -0x10(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11e8 <check_compressed+0xc8>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     117e <check_compressed+0x5e>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     11a6 <check_compressed+0x86>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    0xe62(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
je     11da <check_compressed+0xba>
mov    -0x18(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1040 <strstr@plt>
cmp    $0x0,%rax
jne    11e3 <check_compressed+0xc3>
movb   $0x1,-0x1(%rbp)
jmp    11f1 <check_compressed+0xd1>
jmp    11e8 <check_compressed+0xc8>
jmp    11ed <check_compressed+0xcd>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_compressed>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1195 <check_compressed+0x75>
lea    0xed1(%rip),%rsi
call   1040 <strstr@plt>
test   %rax,%rax
je     1195 <check_compressed+0x75>
mov    %rax,%rbx
lea    0x1(%rax),%rbp
mov    %rbp,%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1155 <check_compressed+0x35>
movb   $0x0,(%rax)
mov    %rbp,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     116a <check_compressed+0x4a>
movb   $0x0,(%rax)
lea    0xea2(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strstr@plt>
mov    $0x1,%bpl
test   %rax,%rax
je     1197 <check_compressed+0x77>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strstr@plt>
test   %rax,%rax
je     1197 <check_compressed+0x77>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0AContent-Encoding:\00"
@.str.1 = [5 x i8] c"gzip\00"
@.str.2 = [8 x i8] c"deflate\00"
define signext i8 @check_compressed(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %41
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strstr(i8* %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %4
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %40
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i8* @strchr(i8* %16, i8 signext 13)
store i8* %17, i8** %5
%18 = load i8*, i8** %5
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %22
20: ; preds = %14
%21 = load i8*, i8** %5
store i8 0, i8* %21
br label %22
22: ; preds = %20, %14
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = call i8* @strchr(i8* %24, i8 signext 10)
store i8* %25, i8** %5
%26 = load i8*, i8** %5
%27 = icmp ne i8* %26, null
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = load i8*, i8** %5
store i8 0, i8* %29
br label %30
30: ; preds = %28, %22
%31 = load i8*, i8** %4
%32 = call i64 @strstr(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %38, label %34
34: ; preds = %30
%35 = load i8*, i8** %4
%36 = call i64 @strstr(i8* %35, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %34, %30
store i8 1, i8* %2
br label %42
39: ; preds = %34
br label %40
40: ; preds = %39, %8
br label %41
41: ; preds = %40, %1
store i8 0, i8* %2
br label %42
42: ; preds = %41, %38
%43 = load i8, i8* %2
ret i8 %43
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AContent-Encoding:\00"
@.str.1 = [5 x i8] c"gzip\00"
@.str.2 = [8 x i8] c"deflate\00"
define signext i8 @check_compressed(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %22, label %3
3: ; preds = %1
%4 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %22, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = tail call i8* @strchr(i8* %8, i8 signext 13)
%10 = icmp eq i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %7
store i8 0, i8* %9
br label %12
12: ; preds = %11, %7
%13 = tail call i8* @strchr(i8* %8, i8 signext 10)
%14 = icmp eq i8* %13, null
br i1 %14, label %16, label %15
15: ; preds = %12
store i8 0, i8* %13
br label %16
16: ; preds = %15, %12
%17 = tail call i64 @strstr(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %23, label %19
19: ; preds = %16
%20 = tail call i64 @strstr(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %3, %19, %1
br label %23
23: ; preds = %16, %19, %22
%24 = phi i8 [ 1, %19 ], [ 0, %22 ], [ 1, %16 ]
ret i8 %24
}