#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 flag_table_3_3(unsigned char **);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int f_flag_table_3_3(int mode, unsigned char **sec, float *data,
                     unsigned int ndata, char *inv_out, void **local) {
  int res;
  if (mode >= 0) {
    res = flag_table_3_3(sec);
    if (res >= 0) {
      sprintf(inv_out, "flag table 3.3=%d", res);
      inv_out += strlen(inv_out);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<f_flag_table_3_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     119f <f_flag_table_3_3+0x6f>
mov    -0x10(%rbp),%rdi
call   1050 <flag_table_3_3@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     119a <f_flag_table_3_3+0x6a>
mov    -0x28(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xe84(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    119f <f_flag_table_3_3+0x6f>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_flag_table_3_3>:
push   %rbx
test   %edi,%edi
js     115d <f_flag_table_3_3+0x2d>
mov    %r8,%rbx
mov    %rsi,%rdi
call   1050 <flag_table_3_3@plt>
test   %eax,%eax
js     115d <f_flag_table_3_3+0x2d>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"flag table 3.3=%d\00"
define i32 @f_flag_table_3_3(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5) {
%7 = alloca i32
%8 = alloca i8**
%9 = alloca float*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8**
%13 = alloca i32
store i32 %0, i32* %7
store i8** %1, i8*** %8
store float* %2, float** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i8** %5, i8*** %12
%14 = load i32, i32* %7
%15 = icmp sge i32 %14, 0
br i1 %15, label %16, label %31
16: ; preds = %6
%17 = load i8**, i8*** %8
%18 = call i32 @flag_table_3_3(i8** %17)
store i32 %18, i32* %13
%19 = load i32, i32* %13
%20 = icmp sge i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %16
%22 = load i8*, i8** %11
%23 = load i32, i32* %13
%24 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i8*, i8** %11
%26 = call i32 @strlen(i8* %25)
%27 = load i8*, i8** %11
%28 = sext i32 %26 to i64
%29 = getelementptr inbounds i8, i8* %27, i64 %28
store i8* %29, i8** %11
br label %30
30: ; preds = %21, %16
br label %31
31: ; preds = %30, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"flag table 3.3=%d\00"
define i32 @f_flag_table_3_3(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %0, -1
br i1 %7, label %8, label %14
8: ; preds = %6
%9 = tail call i32 @flag_table_3_3(i8** %1)
%10 = icmp sgt i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %9)
%13 = tail call i32 @strlen(i8* %4)
br label %14
14: ; preds = %8, %11, %6
ret i32 0
}