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


x86 assembly (clang, -O0):
<print_xml_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     1170 <print_xml_timestamp+0x60>
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    0xe97(%rip),%rsi
mov    $0x0,%al
call   1030 <xprintf@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1198 <print_xml_timestamp+0x88>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
add    $0xffffffff,%edi
mov    %edi,(%rax)
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1030 <xprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xml_timestamp>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   $0x1,%bpl
je     1139 <print_xml_timestamp+0x29>
mov    (%rbx),%edi
xor    %eax,%eax
test   %r8d,%r8d
setne  %al
lea    0xed1(%rip),%rsi
mov    %eax,%r8d
xor    %eax,%eax
call   1030 <xprintf@plt>
test   $0x4,%bpl
jne    1146 <print_xml_timestamp+0x36>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    (%rbx),%edi
add    $0xffffffff,%edi
mov    %edi,(%rbx)
lea    0xee5(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <xprintf@plt>

LLVM IR (-O0):
@.str = [57 x i8] c"<timestamp date=\22%s\22 time=\22%s\22 utc=\22%d\22 interval=\22%llu\22>\00"
@.str.1 = [13 x i8] c"</timestamp>\00"
define void @print_xml_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 (i32, i8*, ...) @xprintf(i32 %18, i8* getelementptr inbounds ([57 x i8], [57 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, 4
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %36
31: ; preds = %27
%32 = load i32*, i32** %7
%33 = load i32, i32* %32
%34 = add nsw i32 %33, -1
store i32 %34, i32* %32
%35 = call i32 (i32, i8*, ...) @xprintf(i32 %34, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %36
36: ; preds = %31, %27
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"<timestamp date=\22%s\22 time=\22%s\22 utc=\22%d\22 interval=\22%llu\22>\00"
@.str.1 = [13 x i8] c"</timestamp>\00"
define void @print_xml_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 (i32, i8*, ...) @xprintf(i32 %10, i8* getelementptr inbounds ([57 x i8], [57 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, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = load i32, i32* %0
%19 = add nsw i32 %18, -1
store i32 %19, i32* %0
%20 = tail call i32 (i32, i8*, ...) @xprintf(i32 %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %17, %14
ret void
}