#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 */
scalar_t__ strcmp(char *, char *);
char *string_trim_character_array(char *, char *);
char *string_trim_number_characters(char *number, char *attribute_datatype) {
  if (!attribute_datatype || !*attribute_datatype || !number || !*number) {
    return number;
  }
  if (strcmp(attribute_datatype, "float") != 0 &&
      strcmp(attribute_datatype, "integer") != 0) {
    return number;
  }
  return string_trim_character_array(number, ",$");
}


x86 assembly (clang, -O0):
<string_trim_number_characters>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <string_trim_number_characters+0x40>
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <string_trim_number_characters+0x40>
cmpq   $0x0,-0x10(%rbp)
je     1160 <string_trim_number_characters+0x40>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    116d <string_trim_number_characters+0x4d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11c2 <string_trim_number_characters+0xa2>
mov    -0x18(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11ae <string_trim_number_characters+0x8e>
mov    -0x18(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11ae <string_trim_number_characters+0x8e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11c2 <string_trim_number_characters+0xa2>
mov    -0x10(%rbp),%rdi
lea    0xe55(%rip),%rsi
call   1030 <string_trim_character_array@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_trim_number_characters>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rsi,%rsi
je     1167 <string_trim_number_characters+0x47>
test   %r14,%r14
je     1167 <string_trim_number_characters+0x47>
mov    %rsi,%rbx
cmpb   $0x0,(%rsi)
je     1167 <string_trim_number_characters+0x47>
cmpb   $0x0,(%r14)
je     1167 <string_trim_number_characters+0x47>
lea    0xeba(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1172 <string_trim_number_characters+0x52>
lea    0xeac(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1172 <string_trim_number_characters+0x52>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe95(%rip),%rsi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <string_trim_character_array@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"float\00"
@.str.1 = [8 x i8] c"integer\00"
@.str.2 = [3 x i8] c",$\00"
define i8* @string_trim_number_characters(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = icmp ne i8 %17, 0
br i1 %18, label %21, label %19
19: ; preds = %15, %12, %8, %2
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %34
21: ; preds = %15
%22 = load i8*, i8** %5
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %31
25: ; preds = %21
%26 = load i8*, i8** %5
%27 = call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = load i8*, i8** %4
store i8* %30, i8** %3
br label %34
31: ; preds = %25, %21
%32 = load i8*, i8** %4
%33 = call i8* @string_trim_character_array(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
store i8* %33, i8** %3
br label %34
34: ; preds = %31, %29, %19
%35 = load i8*, i8** %3
ret i8* %35
}

LLVM IR (-O2):
@.str = [6 x i8] c"float\00"
@.str.1 = [8 x i8] c"integer\00"
@.str.2 = [3 x i8] c",$\00"
define i8* @string_trim_number_characters(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %20, label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = icmp ne i8 %5, 0
%7 = icmp ne i8* %0, null
%8 = and i1 %7, %6
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i8, i8* %0
%11 = icmp eq i8 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %9
%13 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15, %12
%19 = tail call i8* @string_trim_character_array(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %15, %2, %4, %9, %18
%21 = phi i8* [ %19, %18 ], [ %0, %9 ], [ %0, %4 ], [ %0, %2 ], [ %0, %15 ]
ret i8* %21
}