#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*/ print_str_encoded(char const *);
int /*<<< orphan*/ printf(char *);
void print_json(const char *folder, const char *path, const char *from,
                const char *subject) {
  printf("{\"folder\": \"");
  print_str_encoded(folder);
  printf("\", \"path\": \"");
  print_str_encoded(path);
  printf("\", \"from\": \"");
  print_str_encoded(from);
  printf("\", \"subject\": \"");
  print_str_encoded(subject);
  printf("\"}\n");
}


x86 assembly (clang, -O0):
<print_json>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <print_str_encoded@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <print_str_encoded@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <print_str_encoded@plt>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <print_str_encoded@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_json>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <print_str_encoded@plt>
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    %r12,%rdi
call   1050 <print_str_encoded@plt>
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
call   1050 <print_str_encoded@plt>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1050 <print_str_encoded@plt>
lea    0xe9c(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"{\22folder\22: \22\00"
@.str.1 = [13 x i8] c"\22, \22path\22: \22\00"
@.str.2 = [13 x i8] c"\22, \22from\22: \22\00"
@.str.3 = [16 x i8] c"\22, \22subject\22: \22\00"
@.str.4 = [4 x i8] c"\22}\0A\00"
define void @print_json(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 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = load i8*, i8** %5
%11 = call i32 @print_str_encoded(i8* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%13 = load i8*, i8** %6
%14 = call i32 @print_str_encoded(i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%16 = load i8*, i8** %7
%17 = call i32 @print_str_encoded(i8* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%19 = load i8*, i8** %8
%20 = call i32 @print_str_encoded(i8* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"{\22folder\22: \22\00"
@.str.1 = [13 x i8] c"\22, \22path\22: \22\00"
@.str.2 = [13 x i8] c"\22, \22from\22: \22\00"
@.str.3 = [16 x i8] c"\22, \22subject\22: \22\00"
@str = [3 x i8] c"\22}\00"
define void @print_json(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @print_str_encoded(i8* %0)
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @print_str_encoded(i8* %1)
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @print_str_encoded(i8* %2)
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%12 = tail call i32 @print_str_encoded(i8* %3)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}