#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
long get_uncompressed_size(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
void one_argument(char *file_name) {
  FILE *compressed_file;
  long uncompressed_size;
  compressed_file = fopen(file_name, "rb");
  if (compressed_file == NULL) {
    printf("Couldn't open the file.\n");
  } else {
    uncompressed_size = get_uncompressed_size(compressed_file);
    if (uncompressed_size == (-1)) {
      printf("The input file is not a valid LZW-compressed file.\n");
    } else {
      printf("The uncompressed file '%s' would be %ld bytes long.\n", file_name,
             get_uncompressed_size(compressed_file));
      fclose(compressed_file);
    }
  }
}


x86 assembly (clang, -O0):
<one_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117e <one_argument+0x3e>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11dd <one_argument+0x9d>
mov    -0x10(%rbp),%rdi
call   1050 <get_uncompressed_size@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
jne    11a9 <one_argument+0x69>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11d8 <one_argument+0x98>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <get_uncompressed_size@plt>
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
jmp    11dd <one_argument+0x9d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<one_argument>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xea2(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     11a4 <one_argument+0x54>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <get_uncompressed_size@plt>
cmp    $0xffffffffffffffff,%rax
je     11ad <one_argument+0x5d>
mov    %rbx,%rdi
call   1060 <get_uncompressed_size@plt>
lea    0xe7b(%rip),%rdi
mov    %r14,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fclose@plt>
lea    0xec0(%rip),%rdi
jmp    11b4 <one_argument+0x64>
lea    0xe84(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [25 x i8] c"Couldn't open the file.\0A\00"
@.str.2 = [52 x i8] c"The input file is not a valid LZW-compressed file.\0A\00"
@.str.3 = [53 x i8] c"The uncompressed file '%s' would be %ld bytes long.\0A\00"
define void @one_argument(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %26
11: ; preds = %1
%12 = load i32*, i32** %3
%13 = call i64 @get_uncompressed_size(i32* %12)
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
br label %25
18: ; preds = %11
%19 = load i8*, i8** %2
%20 = load i32*, i32** %3
%21 = call i64 @get_uncompressed_size(i32* %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %19, i64 %21)
%23 = load i32*, i32** %3
%24 = call i32 @fclose(i32* %23)
br label %25
25: ; preds = %18, %16
br label %26
26: ; preds = %25, %9
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.3 = [53 x i8] c"The uncompressed file '%s' would be %ld bytes long.\0A\00"
@str = [51 x i8] c"The input file is not a valid LZW-compressed file.\00"
@str.4 = [24 x i8] c"Couldn't open the file.\00"
define void @one_argument(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.4, i64 0, i64 0))
br label %15
6: ; preds = %1
%7 = tail call i64 @get_uncompressed_size(i32* %2)
%8 = icmp eq i64 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
br label %15
11: ; preds = %6
%12 = tail call i64 @get_uncompressed_size(i32* %2)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %0, i64 %12)
%14 = tail call i32 @fclose(i32* %2)
br label %15
15: ; preds = %9, %11, %4
ret void
}