#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 FALSE;
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int IsCompressed(char *s) {
  register char *t;
  t = s + strlen(s) - 3;
  if (t < s)
    return (FALSE);
  return (!strcmp(t, ".gz"));
}


x86 assembly (clang, -O0):
<IsCompressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xfffffffffffffffd,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1170 <IsCompressed+0x50>
mov    0x2e7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1190 <IsCompressed+0x70>
mov    -0x18(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsCompressed>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
lea    (%rbx,%rax,1),%rdi
add    $0xfffffffffffffffd,%rdi
cmp    %rbx,%rdi
jae    1143 <IsCompressed+0x23>
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret
lea    0xeb6(%rip),%rsi
call   1040 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@FALSE = global i32 0
@.str = [4 x i8] c".gz\00"
define i32 @IsCompressed(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -3
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %3
%13 = icmp ult i8* %11, %12
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = load i32, i32* @FALSE
store i32 %15, i32* %2
br label %22
16: ; preds = %1
%17 = load i8*, i8** %4
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
store i32 %21, i32* %2
br label %22
22: ; preds = %16, %14
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@FALSE = global i32 0
@.str = [4 x i8] c".gz\00"
define i32 @IsCompressed(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -3
%6 = icmp ult i8* %5, %0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* @FALSE
br label %13
9: ; preds = %1
%10 = tail call i32 @strcmp(i8* %5, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %7
%14 = phi i32 [ %8, %7 ], [ %12, %9 ]
ret i32 %14
}