#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 EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
int test_fixed_field_functions();
int test_packed_string_functions();
int test_repack_str();
int main(void) {
  do {
    int __my_ret__ = test_fixed_field_functions();
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 131,
              "test_fixed_field_functions()");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = test_packed_string_functions();
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 132,
              "test_packed_string_functions()");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = test_repack_str();
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 133, "test_repack_str()");
      return __my_ret__;
    }
  } while (0);
  ;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <test_fixed_field_functions@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     118f <main+0x4f>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
mov    $0x83,%edx
lea    0xe98(%rip),%rcx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1234 <main+0xf4>
jmp    1194 <main+0x54>
jmp    1199 <main+0x59>
mov    $0x0,%al
call   1060 <test_packed_string_functions@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11d9 <main+0x99>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
lea    0xe43(%rip),%rsi
mov    $0x84,%edx
lea    0xe6b(%rip),%rcx
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1234 <main+0xf4>
jmp    11de <main+0x9e>
jmp    11e3 <main+0xa3>
mov    $0x0,%al
call   1040 <test_repack_str@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1223 <main+0xe3>
mov    0x2de2(%rip),%rax
mov    (%rax),%edi
lea    0xdf9(%rip),%rsi
mov    $0x85,%edx
lea    0xe40(%rip),%rcx
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1234 <main+0xf4>
jmp    1228 <main+0xe8>
mov    0x2da9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <test_fixed_field_functions@plt>
test   %eax,%eax
je     1171 <main+0x31>
mov    %eax,%ebx
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
lea    0xeb2(%rip),%rcx
mov    $0x83,%edx
call   1030 <fprintf@plt>
jmp    11dc <main+0x9c>
xor    %eax,%eax
call   1060 <test_packed_string_functions@plt>
test   %eax,%eax
je     11a1 <main+0x61>
mov    %eax,%ebx
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
lea    0xe72(%rip),%rsi
lea    0xe9f(%rip),%rcx
mov    $0x84,%edx
call   1030 <fprintf@plt>
jmp    11dc <main+0x9c>
xor    %eax,%eax
call   1040 <test_repack_str@plt>
mov    %eax,%ebx
test   %eax,%eax
je     11cf <main+0x8f>
mov    0x2e2b(%rip),%rax
mov    (%rax),%edi
lea    0xe42(%rip),%rsi
lea    0xe8e(%rip),%rcx
mov    $0x85,%edx
call   1030 <fprintf@plt>
test   %ebx,%ebx
jne    11dc <main+0x9c>
mov    0x2dfe(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [29 x i8] c"test_fixed_field_functions()\00"
@.str.2 = [31 x i8] c"test_packed_string_functions()\00"
@.str.3 = [18 x i8] c"test_repack_str()\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %0
%6 = call i32 (...) @test_fixed_field_functions()
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* %2
store i32 %12, i32* %1
br label %36
13: ; preds = %5
br label %14
14: ; preds = %13
br label %15
15: ; preds = %14
%16 = call i32 (...) @test_packed_string_functions()
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = load i32, i32* @stderr
%21 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 132, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%22 = load i32, i32* %3
store i32 %22, i32* %1
br label %36
23: ; preds = %15
br label %24
24: ; preds = %23
br label %25
25: ; preds = %24
%26 = call i32 (...) @test_repack_str()
store i32 %26, i32* %4
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 133, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%32 = load i32, i32* %4
store i32 %32, i32* %1
br label %36
33: ; preds = %25
br label %34
34: ; preds = %33
%35 = load i32, i32* @EXIT_SUCCESS
store i32 %35, i32* %1
br label %36
36: ; preds = %34, %29, %19, %9
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.1 = [29 x i8] c"test_fixed_field_functions()\00"
@.str.2 = [31 x i8] c"test_packed_string_functions()\00"
@.str.3 = [18 x i8] c"test_repack_str()\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @test_fixed_field_functions()
%2 = icmp eq i32 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 131, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %21
6: ; preds = %0
%7 = tail call i32 (...) @test_packed_string_functions()
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 132, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %21
12: ; preds = %6
%13 = tail call i32 (...) @test_repack_str()
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* @stderr
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 133, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %18
18: ; preds = %12, %15
%19 = load i32, i32* @EXIT_SUCCESS
%20 = select i1 %14, i32 %19, i32 %13
br label %21
21: ; preds = %9, %3, %18
%22 = phi i32 [ %1, %3 ], [ %7, %9 ], [ %20, %18 ]
ret i32 %22
}