#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fprintf(int /*<<< orphan*/ *, char *, ...);
int saveInteger(FILE *config_fd, char *tag, int num, int tabbing) {
  int failureOccured = 0;
  int i = 0;
  for (i = 0; i < tabbing; i++) {
    if (fprintf(config_fd, "\t") == 0) {
      failureOccured = 1;
      break;
    }
  }
  if (failureOccured == 0 &&
      fprintf(config_fd, "<%s>%d</%s>\n", tag, num, tag) >= 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<saveInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1182 <saveInteger+0x72>
mov    -0x10(%rbp),%rdi
lea    0xeae(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jne    116f <saveInteger+0x5f>
movl   $0x1,-0x24(%rbp)
jmp    1182 <saveInteger+0x72>
jmp    1174 <saveInteger+0x64>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    113b <saveInteger+0x2b>
cmpl   $0x0,-0x24(%rbp)
jne    11bf <saveInteger+0xaf>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xe60(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
cmp    $0x0,%rax
jl     11bf <saveInteger+0xaf>
movl   $0x0,-0x4(%rbp)
jmp    11c6 <saveInteger+0xb6>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<saveInteger>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
test   %ecx,%ecx
jle    1147 <saveInteger+0x37>
mov    %ecx,%ebx
lea    0xed2(%rip),%r12
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rax,%rax
je     1168 <saveInteger+0x58>
add    $0xffffffff,%ebx
jne    1130 <saveInteger+0x20>
lea    0xeb4(%rip),%rsi
xor    %ebx,%ebx
mov    %rbp,%rdi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %r15,%r8
xor    %eax,%eax
call   1030 <fprintf@plt>
test   %rax,%rax
jns    116d <saveInteger+0x5d>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [13 x i8] c"<%s>%d</%s>\0A\00"
define i32 @saveInteger(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %11
br label %12
12: ; preds = %22, %4
%13 = load i32, i32* %11
%14 = load i32, i32* %9
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %25
16: ; preds = %12
%17 = load i32*, i32** %6
%18 = call i64 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %10
br label %25
21: ; preds = %16
br label %22
22: ; preds = %21
%23 = load i32, i32* %11
%24 = add nsw i32 %23, 1
store i32 %24, i32* %11
br label %12
25: ; preds = %20, %12
%26 = load i32, i32* %10
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = load i32*, i32** %6
%30 = load i8*, i8** %7
%31 = load i32, i32* %8
%32 = load i8*, i8** %7
%33 = call i64 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %30, i32 %31, i8* %32)
%34 = icmp sge i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %28
store i32 0, i32* %5
br label %37
36: ; preds = %28, %25
store i32 1, i32* %5
br label %37
37: ; preds = %36, %35
%38 = load i32, i32* %5
ret i32 %38
}

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
@.str.1 = [13 x i8] c"<%s>%d</%s>\0A\00"
define i32 @saveInteger(i32* nocapture %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %8, label %13
6: ; preds = %8
%7 = icmp eq i32 %12, %3
br i1 %7, label %13, label %8
8: ; preds = %4, %6
%9 = phi i32 [ %12, %6 ], [ 0, %4 ]
%10 = tail call i64 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
%12 = add nuw nsw i32 %9, 1
br i1 %11, label %16, label %6
13: ; preds = %6, %4
%14 = tail call i64 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %1, i32 %2, i8* %1)
%15 = icmp sgt i64 %14, -1
br i1 %15, label %17, label %16
16: ; preds = %8, %13
br label %17
17: ; preds = %13, %16
%18 = phi i32 [ 1, %16 ], [ 0, %13 ]
ret i32 %18
}