#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 */
scalar_t__ pomf_upload_file(char const *, char *);
int /*<<< orphan*/ printf(char *, char const *, ...);
void upload_file(const char *file) {
  char url[1024] = {0};
  if (pomf_upload_file(file, url) == 0) {
    printf("%s\t%s\n", file, url);
  } else {
    printf("%s\tFAILED\n\n", file);
  }
}


x86 assembly (clang, -O0):
<upload_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1030 <pomf_upload_file@plt>
cmp    $0x0,%rax
jne    118a <upload_file+0x5a>
mov    -0x8(%rbp),%rsi
lea    -0x410(%rbp),%rdx
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    119c <upload_file+0x6c>
mov    -0x8(%rbp),%rsi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<upload_file>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x400,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <pomf_upload_file@plt>
test   %rax,%rax
je     1172 <upload_file+0x42>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1186 <upload_file+0x56>
lea    0xe87(%rip),%rdi
mov    %rsp,%rdx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s\09%s\0A\00"
@.str.1 = [12 x i8] c"%s\09FAILED\0A\0A\00"
define void @upload_file(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = bitcast [1024 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%7 = call i64 @pomf_upload_file(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
br label %16
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s\09%s\0A\00"
@.str.1 = [12 x i8] c"%s\09FAILED\0A\0A\00"
define void @upload_file(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i64 @pomf_upload_file(i8* %0, i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %3)
br label %10
8: ; preds = %1
%9 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %10
10: ; preds = %8, %6
ret void
}