#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 activity {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ xprintf(int, char *);
void print_xml_statistics(int *tab, int action, struct activity *act[],
                          unsigned int id_seq[]) {
  if (action & 0x01) {
    xprintf((*tab)++, "<statistics>");
  }
  if (action & 0x04) {
    xprintf(--(*tab), "</statistics>");
  }
}


x86 assembly (clang, -O0):
<print_xml_statistics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     114f <print_xml_statistics+0x3f>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    %edi,%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
lea    0xeb6(%rip),%rsi
call   1030 <xprintf@plt>
mov    -0xc(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1175 <print_xml_statistics+0x65>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
add    $0xffffffff,%edi
mov    %edi,(%rax)
lea    0xe9d(%rip),%rsi
call   1030 <xprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_xml_statistics>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
test   $0x1,%bpl
je     1131 <print_xml_statistics+0x21>
mov    (%rbx),%edi
lea    0x1(%rdi),%eax
mov    %eax,(%rbx)
lea    0xed4(%rip),%rsi
call   1030 <xprintf@plt>
test   $0x4,%bpl
jne    113e <print_xml_statistics+0x2e>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    (%rbx),%edi
add    $0xffffffff,%edi
mov    %edi,(%rbx)
lea    0xec1(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <xprintf@plt>

LLVM IR (-O0):
%struct.activity = type { i32 }
@.str = [13 x i8] c"<statistics>\00"
@.str.1 = [14 x i8] c"</statistics>\00"
define void @print_xml_statistics(i32* %0, i32 %1, %struct.activity** %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca %struct.activity**
%8 = alloca i32*
store i32* %0, i32** %5
store i32 %1, i32* %6
store %struct.activity** %2, %struct.activity*** %7
store i32* %3, i32** %8
%9 = load i32, i32* %6
%10 = and i32 %9, 1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %13
%16 = call i32 @xprintf(i32 %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %12, %4
%18 = load i32, i32* %6
%19 = and i32 %18, 4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = add nsw i32 %23, -1
store i32 %24, i32* %22
%25 = call i32 @xprintf(i32 %24, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %26
26: ; preds = %21, %17
ret void
}

LLVM IR (-O2):
%struct.activity = type { i32 }
@.str = [13 x i8] c"<statistics>\00"
@.str.1 = [14 x i8] c"</statistics>\00"
define void @print_xml_statistics(i32* nocapture %0, i32 %1, %struct.activity** nocapture readnone %2, i32* nocapture readnone %3) {
%5 = and i32 %1, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i32, i32* %0
%9 = add nsw i32 %8, 1
store i32 %9, i32* %0
%10 = tail call i32 @xprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %7, %4
%12 = and i32 %1, 4
%13 = icmp eq i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %11
%15 = load i32, i32* %0
%16 = add nsw i32 %15, -1
store i32 %16, i32* %0
%17 = tail call i32 @xprintf(i32 %16, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %14, %11
ret void
}