#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*/ *fopen(char *, char *);
scalar_t__ is_valid_lzw_file(int /*<<< orphan*/ *);
int /*<<< orphan*/ lzw_decompress(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
void two_arguments(char *source_file_name, char *destination_file_name) {
  FILE *source;
  FILE *destination;
  if (strcmp(source_file_name, destination_file_name) == 0) {
    printf("Source and destination must not be identical.\n");
  } else {
    if (!(source = fopen(source_file_name, "rb")) ||
        !(destination = fopen(destination_file_name, "wb"))) {
      printf("Couldn't open '%s' or '%s' or both.\n.", source_file_name,
             destination_file_name);
    } else {
      if (is_valid_lzw_file(source)) {
        lzw_decompress(source, destination);
      } else {
        printf("The input file is not a valid LZW-compressed file.\n");
      }
    }
  }
}


x86 assembly (clang, -O0):
<two_arguments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    118a <two_arguments+0x3a>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121e <two_arguments+0xce>
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     11c6 <two_arguments+0x76>
mov    -0x10(%rbp),%rdi
lea    0xe7f(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    11e1 <two_arguments+0x91>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1219 <two_arguments+0xc9>
mov    -0x18(%rbp),%rdi
call   1070 <is_valid_lzw_file@plt>
cmp    $0x0,%rax
je     1206 <two_arguments+0xb6>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <lzw_decompress@plt>
jmp    1214 <two_arguments+0xc4>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1219 <two_arguments+0xc9>
jmp    121e <two_arguments+0xce>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_arguments>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <strcmp@plt>
test   %rax,%rax
je     11e8 <two_arguments+0x88>
lea    0xe81(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     11c9 <two_arguments+0x69>
mov    %rax,%r15
lea    0xe6d(%rip),%rsi
mov    %r14,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     11c9 <two_arguments+0x69>
mov    %rax,%r12
mov    %r15,%rdi
call   1080 <is_valid_lzw_file@plt>
test   %rax,%rax
je     11f1 <two_arguments+0x91>
mov    %r15,%rdi
mov    %r12,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1060 <lzw_decompress@plt>
lea    0xe36(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <printf@plt>
lea    0xe70(%rip),%rdi
jmp    11f8 <two_arguments+0x98>
lea    0xe34(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Source and destination must not be identical.\0A\00"
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [38 x i8] c"Couldn't open '%s' or '%s' or both.\0A.\00"
@.str.4 = [52 x i8] c"The input file is not a valid LZW-compressed file.\0A\00"
define void @two_arguments(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i64 @strcmp(i8* %7, i8* %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
br label %37
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %15, i32** %5
%16 = icmp ne i32* %15, null
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i8*, i8** %4
%19 = call i32* @fopen(i8* %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i32* %19, i32** %6
%20 = icmp ne i32* %19, null
br i1 %20, label %25, label %21
21: ; preds = %17, %13
%22 = load i8*, i8** %3
%23 = load i8*, i8** %4
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %22, i8* %23)
br label %36
25: ; preds = %17
%26 = load i32*, i32** %5
%27 = call i64 @is_valid_lzw_file(i32* %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i32*, i32** %5
%31 = load i32*, i32** %6
%32 = call i32 @lzw_decompress(i32* %30, i32* %31)
br label %35
33: ; preds = %25
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.4, i64 0, i64 0))
br label %35
35: ; preds = %33, %29
br label %36
36: ; preds = %35, %21
br label %37
37: ; preds = %36, %11
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"rb\00"
@.str.2 = [3 x i8] c"wb\00"
@.str.3 = [38 x i8] c"Couldn't open '%s' or '%s' or both.\0A.\00"
@str = [51 x i8] c"The input file is not a valid LZW-compressed file.\00"
@str.5 = [46 x i8] c"Source and destination must not be identical.\00"
define void @two_arguments(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
br label %22
7: ; preds = %2
%8 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %15
13: ; preds = %10, %7
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %1)
br label %22
15: ; preds = %10
%16 = tail call i64 @is_valid_lzw_file(i32* %8)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %15
%19 = tail call i32 @lzw_decompress(i32* %8, i32* %11)
br label %22
20: ; preds = %15
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
br label %22
22: ; preds = %13, %20, %18, %5
ret void
}