#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 */
struct file_header {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ xprintf(int, char *, ...);
void print_xml_comment(int *tab, int action, char *cur_date, char *cur_time,
                       int utc, char *comment, struct file_header *file_hdr) {
  if (action & 0x01) {
    xprintf((*tab)++, "<comments>");
  }
  if (action & 0x02) {
    xprintf(*tab, "<comment date=\"%s\" time=\"%s\" utc=\"%d\" com=\"%s\"/>",
            cur_date, cur_time, utc ? 1 : 0, comment);
  }
  if (action & 0x04) {
    xprintf(--(*tab), "</comments>");
  }
}


x86 assembly (clang, -O0):
<print_xml_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
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     115d <print_xml_comment+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
lea    0xeaa(%rip),%rsi
mov    $0x0,%al
call   1030 <xprintf@plt>
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     119e <print_xml_comment+0x8e>
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    0xe74(%rip),%rsi
mov    $0x0,%al
call   1030 <xprintf@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     11c6 <print_xml_comment+0xb6>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
add    $0xffffffff,%edi
mov    %edi,(%rax)
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1030 <xprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xml_comment>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8d,%r13d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%ebp
mov    %rdi,%rbx
test   $0x1,%bpl
jne    114d <print_xml_comment+0x3d>
test   $0x2,%bpl
jne    1168 <print_xml_comment+0x58>
test   $0x4,%bpl
jne    1191 <print_xml_comment+0x81>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%edi
lea    0x1(%rdi),%eax
mov    %eax,(%rbx)
lea    0xea5(%rip),%rsi
xor    %eax,%eax
call   1030 <xprintf@plt>
test   $0x2,%bpl
je     1138 <print_xml_comment+0x28>
mov    (%rbx),%edi
xor    %r8d,%r8d
test   %r13d,%r13d
setne  %r8b
lea    0xe90(%rip),%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r9
xor    %eax,%eax
call   1030 <xprintf@plt>
test   $0x4,%bpl
je     113e <print_xml_comment+0x2e>
mov    (%rbx),%edi
add    $0xffffffff,%edi
mov    %edi,(%rbx)
lea    0xe9d(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <xprintf@plt>

LLVM IR (-O0):
%struct.file_header = type { i32 }
@.str = [11 x i8] c"<comments>\00"
@.str.1 = [49 x i8] c"<comment date=\22%s\22 time=\22%s\22 utc=\22%d\22 com=\22%s\22/>\00"
@.str.2 = [12 x i8] c"</comments>\00"
define void @print_xml_comment(i32* %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, %struct.file_header* %6) {
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca %struct.file_header*
store i32* %0, i32** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i8* %5, i8** %13
store %struct.file_header* %6, %struct.file_header** %14
%15 = load i32, i32* %9
%16 = and i32 %15, 1
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %7
%19 = load i32*, i32** %8
%20 = load i32, i32* %19
%21 = add nsw i32 %20, 1
store i32 %21, i32* %19
%22 = call i32 (i32, i8*, ...) @xprintf(i32 %20, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %18, %7
%24 = load i32, i32* %9
%25 = and i32 %24, 2
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %38
27: ; preds = %23
%28 = load i32*, i32** %8
%29 = load i32, i32* %28
%30 = load i8*, i8** %10
%31 = load i8*, i8** %11
%32 = load i32, i32* %12
%33 = icmp ne i32 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i32 1, i32 0
%36 = load i8*, i8** %13
%37 = call i32 (i32, i8*, ...) @xprintf(i32 %29, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %30, i8* %31, i32 %35, i8* %36)
br label %38
38: ; preds = %27, %23
%39 = load i32, i32* %9
%40 = and i32 %39, 4
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %47
42: ; preds = %38
%43 = load i32*, i32** %8
%44 = load i32, i32* %43
%45 = add nsw i32 %44, -1
store i32 %45, i32* %43
%46 = call i32 (i32, i8*, ...) @xprintf(i32 %45, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %42, %38
ret void
}

LLVM IR (-O2):
%struct.file_header = type { i32 }
@.str = [11 x i8] c"<comments>\00"
@.str.1 = [49 x i8] c"<comment date=\22%s\22 time=\22%s\22 utc=\22%d\22 com=\22%s\22/>\00"
@.str.2 = [12 x i8] c"</comments>\00"
define void @print_xml_comment(i32* nocapture %0, i32 %1, i8* %2, i8* %3, i32 %4, i8* %5, %struct.file_header* nocapture readnone %6) {
%8 = and i32 %1, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = load i32, i32* %0
%12 = add nsw i32 %11, 1
store i32 %12, i32* %0
%13 = tail call i32 (i32, i8*, ...) @xprintf(i32 %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %10, %7
%15 = and i32 %1, 2
%16 = icmp eq i32 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %14
%18 = load i32, i32* %0
%19 = icmp ne i32 %4, 0
%20 = zext i1 %19 to i32
%21 = tail call i32 (i32, i8*, ...) @xprintf(i32 %18, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3, i32 %20, i8* %5)
br label %22
22: ; preds = %17, %14
%23 = and i32 %1, 4
%24 = icmp eq i32 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %22
%26 = load i32, i32* %0
%27 = add nsw i32 %26, -1
store i32 %27, i32* %0
%28 = tail call i32 (i32, i8*, ...) @xprintf(i32 %27, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %25, %22
ret void
}