#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*/ printf(char *);
int /*<<< orphan*/ xprintf0(int, char *, char *, char *, int,
                            unsigned long long);
void print_json_timestamp(int *tab, int action, char *cur_date, char *cur_time,
                          int utc, unsigned long long itv) {
  if (action & 0x01) {
    xprintf0(*tab,
             "\"timestamp\": {\"date\": \"%s\", \"time\": \"%s\", "
             "\"utc\": %d, \"interval\": %llu}",
             cur_date, cur_time, utc ? 1 : 0, itv);
  }
  if (action & 0x02) {
    printf("\n");
  }
  if (action & 0x04) {
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_json_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117e <print_json_timestamp+0x5e>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%esi
xor    %r8d,%r8d
mov    $0x1,%eax
cmp    $0x0,%esi
cmovne %eax,%r8d
mov    -0x30(%rbp),%r9
lea    0xe87(%rip),%rsi
call   1040 <xprintf0@plt>
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1199 <print_json_timestamp+0x79>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11b4 <print_json_timestamp+0x94>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_json_timestamp>:
push   %rbx
mov    %esi,%ebx
test   $0x1,%bl
jne    1134 <print_json_timestamp+0x14>
test   $0x2,%bl
jne    1152 <print_json_timestamp+0x32>
test   $0x4,%bl
jne    1161 <print_json_timestamp+0x41>
pop    %rbx
ret
mov    (%rdi),%edi
xor    %eax,%eax
test   %r8d,%r8d
setne  %al
lea    0xebb(%rip),%rsi
mov    %eax,%r8d
call   1040 <xprintf0@plt>
test   $0x2,%bl
je     112d <print_json_timestamp+0xd>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   $0x4,%bl
je     1132 <print_json_timestamp+0x12>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"\22timestamp\22: {\22date\22: \22%s\22, \22time\22: \22%s\22, \22utc\22: %d, \22interval\22: %llu}\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_json_timestamp(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, i64 %5) {
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i64
store i32* %0, i32** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i64 %5, i64* %12
%13 = load i32, i32* %8
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %27
16: ; preds = %6
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = load i8*, i8** %9
%20 = load i8*, i8** %10
%21 = load i32, i32* %11
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 1, i32 0
%25 = load i64, i64* %12
%26 = call i32 @xprintf0(i32 %18, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20, i32 %24, i64 %25)
br label %27
27: ; preds = %16, %6
%28 = load i32, i32* %8
%29 = and i32 %28, 2
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31, %27
%34 = load i32, i32* %8
%35 = and i32 %34, 4
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37, %33
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"\22timestamp\22: {\22date\22: \22%s\22, \22time\22: \22%s\22, \22utc\22: %d, \22interval\22: %llu}\00"
define void @print_json_timestamp(i32* nocapture %0, i32 %1, i8* %2, i8* %3, i32 %4, i64 %5) {
%7 = and i32 %1, 1
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = load i32, i32* %0
%11 = icmp ne i32 %4, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 @xprintf0(i32 %10, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i32 %12, i64 %5)
br label %14
14: ; preds = %9, %6
%15 = and i32 %1, 2
%16 = icmp eq i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @putchar(i32 10)
br label %19
19: ; preds = %17, %14
%20 = and i32 %1, 4
%21 = icmp eq i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = tail call i32 @putchar(i32 10)
br label %24
24: ; preds = %22, %19
ret void
}