#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 /*<<< orphan*/ assert(int);
char *decompose(long long);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void testing(long long n, char *sexpr) {
  char *sact = decompose(n);
  if (strcmp(sact, sexpr) != 0)
    printf("Error. Expected %s but got %s\n", sexpr, sact);
  assert(strcmp(sact, sexpr) == 0);
  if (strcmp(sact, "[]") != 0)
    free(sact);
  sact = NULL;
}


x86 assembly (clang, -O0):
<testing>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <decompose@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     1198 <testing+0x48>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x18(%rbp),%rdi
lea    0xe5e(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     11d9 <testing+0x89>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testing>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1070 <decompose@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1181 <testing+0x31>
lea    0xe8a(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    0xe7e(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11bd <testing+0x6d>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Error. Expected %s but got %s\0A\00"
@.str.1 = [3 x i8] c"[]\00"
define void @testing(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i8* @decompose(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %12, %2
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i64 @strcmp(i8* %17, i8* %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i8*, i8** %5
%24 = call i64 @strcmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %16
%27 = load i8*, i8** %5
%28 = call i32 @free(i8* %27)
br label %29
29: ; preds = %26, %16
store i8* null, i8** %5
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error. Expected %s but got %s\0A\00"
@.str.1 = [3 x i8] c"[]\00"
define void @testing(i64 %0, i8* %1) {
%3 = tail call i8* @decompose(i64 %0)
%4 = tail call i64 @strcmp(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
br label %8
8: ; preds = %6, %2
%9 = tail call i64 @strcmp(i8* %3, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %8
%16 = tail call i32 @free(i8* %3)
br label %17
17: ; preds = %15, %8
ret void
}