#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*/ str;
typedef int /*<<< orphan*/ money;
typedef int int64_t;

/* Variables and functions */
int INT_MAX;
int INT_MIN;
int /*<<< orphan*/ abs(int /*<<< orphan*/);
scalar_t__ isdigit(char const);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, ...);
int /*<<< orphan*/ *strchr(char const *, char);
const char *form_field_getstr_discount(const char *raw, void *arg) {
  static char str[(11 + 2) + 1];
  int neg = 1;
  int64_t val = 0;
  int money, discount = 0;
  if (strchr(raw, '-') != NULL)
    neg = -1;
  while (*raw) {
    if (!isdigit(*raw) && *raw != '$' && *raw != '.' && *raw != '-' &&
        *raw != '%')
      break;
    if (isdigit(*raw)) {
      val *= 10;
      val += (*raw - '0');
    } else if (*raw == '%')
      discount = 1;
    *raw++;
  }
  money = (((val * neg) < INT_MIN)
               ? INT_MIN
               : (((val * neg) > INT_MAX) ? INT_MAX : (val * neg)));
  if (money == 0)
    str[0] = '\0';
  else if (money >= INT_MAX || money <= INT_MIN)
    snprintf(str, sizeof(str), "$%s########.##", money < 0 ? "-" : "");
  else if (discount)
    snprintf(str, sizeof(str), "%s%d%%",
             (((money) < 0 && (money) > -100) ? "-" : ""), money);
  else
    snprintf(str, sizeof(str), "$%s%0d.%02d",
             (((money) < 0 && (money) > -100) ? "-" : ""), ((money) / 100),
             (abs((money) - (((money) / 100) * 100))));
  return str;
}


x86 assembly (clang, -O0):
<form_field_getstr_discount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
cmp    $0x0,%rax
je     1184 <form_field_getstr_discount+0x44>
movl   $0xffffffff,-0x14(%rbp)
jmp    1189 <form_field_getstr_discount+0x49>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1250 <form_field_getstr_discount+0x110>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
jne    11f1 <form_field_getstr_discount+0xb1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x24,%eax
je     11f1 <form_field_getstr_discount+0xb1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     11f1 <form_field_getstr_discount+0xb1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     11f1 <form_field_getstr_discount+0xb1>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
je     11f1 <form_field_getstr_discount+0xb1>
jmp    1250 <form_field_getstr_discount+0x110>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1223 <form_field_getstr_discount+0xe3>
imul   $0xa,-0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    123f <form_field_getstr_discount+0xff>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
jne    123a <form_field_getstr_discount+0xfa>
movl   $0x1,-0x20(%rbp)
jmp    123f <form_field_getstr_discount+0xff>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1189 <form_field_getstr_discount+0x49>
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    0x2d82(%rip),%rcx
cmp    (%rcx),%eax
jge    1277 <form_field_getstr_discount+0x137>
mov    0x2d73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
jmp    12ae <form_field_getstr_discount+0x16e>
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    0x2d63(%rip),%rcx
cmp    (%rcx),%eax
jle    129e <form_field_getstr_discount+0x15e>
mov    0x2d54(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
jmp    12a8 <form_field_getstr_discount+0x168>
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    12ca <form_field_getstr_discount+0x18a>
movb   $0x0,0x2d7f(%rip)
jmp    140d <form_field_getstr_discount+0x2cd>
mov    -0x1c(%rbp),%eax
mov    0x2d14(%rip),%rcx
cmp    (%rcx),%eax
jge    12ee <form_field_getstr_discount+0x1ae>
mov    -0x1c(%rbp),%eax
mov    0x2cfa(%rip),%rcx
cmp    (%rcx),%eax
jg     1325 <form_field_getstr_discount+0x1e5>
mov    -0x1c(%rbp),%edx
lea    0xd16(%rip),%rcx
lea    0xd10(%rip),%rax
cmp    $0x0,%edx
cmovl  %rax,%rcx
lea    0x2d37(%rip),%rdi
mov    $0xe,%esi
lea    0xce7(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    1408 <form_field_getstr_discount+0x2c8>
cmpl   $0x0,-0x20(%rbp)
je     1383 <form_field_getstr_discount+0x243>
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x29(%rbp)
jge    1348 <form_field_getstr_discount+0x208>
cmpl   $0xffffff9c,-0x1c(%rbp)
setg   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%dl
lea    0xcbc(%rip),%rcx
lea    0xcb6(%rip),%rax
test   $0x1,%dl
cmovne %rax,%rcx
mov    -0x1c(%rbp),%r8d
lea    0x2cd9(%rip),%rdi
mov    $0xe,%esi
lea    0xc9a(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    1403 <form_field_getstr_discount+0x2c3>
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x2a(%rbp)
jge    139c <form_field_getstr_discount+0x25c>
cmpl   $0xffffff9c,-0x1c(%rbp)
setg   %al
mov    %al,-0x2a(%rbp)
mov    -0x2a(%rbp),%dl
lea    0xc68(%rip),%rax
lea    0xc62(%rip),%rcx
test   $0x1,%dl
cmovne %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x64,%eax,%eax
sub    %eax,%edi
call   1040 <abs@plt>
mov    -0x38(%rbp),%rcx
mov    -0x30(%rbp),%r8d
mov    %eax,%r9d
lea    0x2c54(%rip),%rdi
mov    $0xe,%esi
lea    0xc1c(%rip),%rdx
mov    $0x0,%al
call   1060 <snprintf@plt>
jmp    1408 <form_field_getstr_discount+0x2c8>
jmp    140d <form_field_getstr_discount+0x2cd>
lea    0x2c30(%rip),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_field_getstr_discount>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2d,%esi
call   1040 <strchr@plt>
mov    %rax,%r14
mov    (%rbx),%al
test   %al,%al
je     11bd <form_field_getstr_discount+0x8d>
xor    %r15d,%r15d
movabs $0x603000000000,%r12
mov    $0x1,%r13d
xor    %ebp,%ebp
jmp    1183 <form_field_getstr_discount+0x53>
nopl   0x0(%rax,%rax,1)
cmpb   $0x25,(%rbx)
cmove  %r13d,%r15d
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11c2 <form_field_getstr_discount+0x92>
movsbl %al,%edi
call   1030 <isdigit@plt>
movzbl (%rbx),%ecx
test   %rax,%rax
jne    11a1 <form_field_getstr_discount+0x71>
cmp    $0x2e,%cl
ja     11c2 <form_field_getstr_discount+0x92>
movzbl %cl,%eax
bt     %rax,%r12
jae    11c2 <form_field_getstr_discount+0x92>
movsbl %cl,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1170 <form_field_getstr_discount+0x40>
lea    0x0(%rbp,%rbp,4),%eax
movsbl (%rbx),%ecx
lea    (%rcx,%rax,2),%ebp
add    $0xffffffd0,%ebp
jmp    1177 <form_field_getstr_discount+0x47>
xor    %ebp,%ebp
xor    %r15d,%r15d
mov    %ebp,%edx
neg    %edx
test   %r14,%r14
cmove  %ebp,%edx
mov    0x2e0d(%rip),%rax
mov    (%rax),%eax
mov    0x2e0c(%rip),%rcx
mov    (%rcx),%ecx
cmp    %ecx,%edx
mov    %edx,%r8d
cmovg  %ecx,%r8d
cmp    %eax,%edx
cmovl  %eax,%r8d
test   %r8d,%r8d
je     1233 <form_field_getstr_discount+0x103>
cmp    %ecx,%r8d
jge    123c <form_field_getstr_discount+0x10c>
cmp    %eax,%r8d
jle    123c <form_field_getstr_discount+0x10c>
cmp    $0xffffff9d,%r8d
lea    0xe08(%rip),%rax
lea    0xe00(%rip),%rcx
cmovae %rax,%rcx
test   %r15d,%r15d
je     126d <form_field_getstr_discount+0x13d>
lea    0x2e1e(%rip),%rdi
lea    0xdec(%rip),%rdx
mov    $0xe,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
jmp    12b1 <form_field_getstr_discount+0x181>
movb   $0x0,0x2e02(%rip)
jmp    12b1 <form_field_getstr_discount+0x181>
test   %r8d,%r8d
lea    0xdc9(%rip),%rax
lea    0xdc1(%rip),%rcx
cmovs  %rax,%rcx
lea    0x2de4(%rip),%rdi
lea    0xda1(%rip),%rdx
mov    $0xe,%esi
xor    %eax,%eax
call   1050 <snprintf@plt>
jmp    12b1 <form_field_getstr_discount+0x181>
movslq %r8d,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rax
add    %edx,%eax
imul   $0xffffff9c,%eax,%edx
add    %r8d,%edx
mov    %edx,%r9d
neg    %r9d
cmovs  %edx,%r9d
lea    0x2da1(%rip),%rdi
lea    0xd76(%rip),%rdx
mov    $0xe,%esi
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <snprintf@plt>
lea    0x2d84(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@form_field_getstr_discount.str = internal global [14 x i8] zeroinitializer
@INT_MIN = global i32 0
@INT_MAX = global i32 0
@.str = [15 x i8] c"$%s########.##\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"%s%d%%\00"
@.str.4 = [12 x i8] c"$%s%0d.%02d\00"
define i8* @form_field_getstr_discount(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 1, i32* %5
store i32 0, i32* %6
store i32 0, i32* %8
%9 = load i8*, i8** %3
%10 = call i32* @strchr(i8* %9, i8 signext 45)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %5
br label %13
13: ; preds = %12, %2
br label %14
14: ; preds = %65, %13
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %18, label %69
18: ; preds = %14
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = call i64 @isdigit(i8 signext %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %44, label %23
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 36
br i1 %27, label %28, label %44
28: ; preds = %23
%29 = load i8*, i8** %3
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 46
br i1 %32, label %33, label %44
33: ; preds = %28
%34 = load i8*, i8** %3
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 45
br i1 %37, label %38, label %44
38: ; preds = %33
%39 = load i8*, i8** %3
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp ne i32 %41, 37
br i1 %42, label %43, label %44
43: ; preds = %38
br label %69
44: ; preds = %38, %33, %28, %23, %18
%45 = load i8*, i8** %3
%46 = load i8, i8* %45
%47 = call i64 @isdigit(i8 signext %46)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %58
49: ; preds = %44
%50 = load i32, i32* %6
%51 = mul nsw i32 %50, 10
store i32 %51, i32* %6
%52 = load i8*, i8** %3
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = sub nsw i32 %54, 48
%56 = load i32, i32* %6
%57 = add nsw i32 %56, %55
store i32 %57, i32* %6
br label %65
58: ; preds = %44
%59 = load i8*, i8** %3
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = icmp eq i32 %61, 37
br i1 %62, label %63, label %64
63: ; preds = %58
store i32 1, i32* %8
br label %64
64: ; preds = %63, %58
br label %65
65: ; preds = %64, %49
%66 = load i8*, i8** %3
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %3
%68 = load i8, i8* %66
br label %14
69: ; preds = %43, %14
%70 = load i32, i32* %6
%71 = load i32, i32* %5
%72 = mul nsw i32 %70, %71
%73 = load i32, i32* @INT_MIN
%74 = icmp slt i32 %72, %73
br i1 %74, label %75, label %77
75: ; preds = %69
%76 = load i32, i32* @INT_MIN
br label %91
77: ; preds = %69
%78 = load i32, i32* %6
%79 = load i32, i32* %5
%80 = mul nsw i32 %78, %79
%81 = load i32, i32* @INT_MAX
%82 = icmp sgt i32 %80, %81
br i1 %82, label %83, label %85
83: ; preds = %77
%84 = load i32, i32* @INT_MAX
br label %89
85: ; preds = %77
%86 = load i32, i32* %6
%87 = load i32, i32* %5
%88 = mul nsw i32 %86, %87
br label %89
89: ; preds = %85, %83
%90 = phi i32 [ %84, %83 ], [ %88, %85 ]
br label %91
91: ; preds = %89, %75
%92 = phi i32 [ %76, %75 ], [ %90, %89 ]
store i32 %92, i32* %7
%93 = load i32, i32* %7
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %96
95: ; preds = %91
store i8 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0)
br label %146
96: ; preds = %91
%97 = load i32, i32* %7
%98 = load i32, i32* @INT_MAX
%99 = icmp sge i32 %97, %98
br i1 %99, label %104, label %100
100: ; preds = %96
%101 = load i32, i32* %7
%102 = load i32, i32* @INT_MIN
%103 = icmp sle i32 %101, %102
br i1 %103, label %104, label %110
104: ; preds = %100, %96
%105 = load i32, i32* %7
%106 = icmp slt i32 %105, 0
%107 = zext i1 %106 to i64
%108 = select i1 %106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%109 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %108)
br label %145
110: ; preds = %100
%111 = load i32, i32* %8
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %125
113: ; preds = %110
%114 = load i32, i32* %7
%115 = icmp slt i32 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %113
%117 = load i32, i32* %7
%118 = icmp sgt i32 %117, -100
br label %119
119: ; preds = %116, %113
%120 = phi i1 [ false, %113 ], [ %118, %116 ]
%121 = zext i1 %120 to i64
%122 = select i1 %120, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%123 = load i32, i32* %7
%124 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %122, i32 %123)
br label %144
125: ; preds = %110
%126 = load i32, i32* %7
%127 = icmp slt i32 %126, 0
br i1 %127, label %128, label %131
128: ; preds = %125
%129 = load i32, i32* %7
%130 = icmp sgt i32 %129, -100
br label %131
131: ; preds = %128, %125
%132 = phi i1 [ false, %125 ], [ %130, %128 ]
%133 = zext i1 %132 to i64
%134 = select i1 %132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%135 = load i32, i32* %7
%136 = sdiv i32 %135, 100
%137 = load i32, i32* %7
%138 = load i32, i32* %7
%139 = sdiv i32 %138, 100
%140 = mul nsw i32 %139, 100
%141 = sub nsw i32 %137, %140
%142 = call i32 @abs(i32 %141)
%143 = call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %134, i32 %136, i32 %142)
br label %144
144: ; preds = %131, %119
br label %145
145: ; preds = %144, %104
br label %146
146: ; preds = %145, %95
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0)
}

LLVM IR (-O2):
@form_field_getstr_discount.str = internal global [14 x i8] zeroinitializer
@INT_MIN = global i32 0
@INT_MAX = global i32 0
@.str = [15 x i8] c"$%s########.##\00"
@.str.1 = [2 x i8] c"-\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"%s%d%%\00"
@.str.4 = [12 x i8] c"$%s%0d.%02d\00"
define i8* @form_field_getstr_discount(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i32* @strchr(i8* %0, i8 signext 45)
%4 = icmp eq i32* %3, null
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %35, label %7
7: ; preds = %2, %29
%8 = phi i8 [ %33, %29 ], [ %5, %2 ]
%9 = phi i32 [ %31, %29 ], [ 0, %2 ]
%10 = phi i8* [ %32, %29 ], [ %0, %2 ]
%11 = phi i32 [ %30, %29 ], [ 0, %2 ]
%12 = tail call i64 @isdigit(i8 signext %8)
%13 = icmp eq i64 %12, 0
%14 = load i8, i8* %10
br i1 %13, label %15, label %16
15: ; preds = %7
switch i8 %14, label %35 [
i8 36, label %16
i8 46, label %16
i8 45, label %16
i8 37, label %16
]
16: ; preds = %7, %15, %15, %15, %15
%17 = tail call i64 @isdigit(i8 signext %14)
%18 = icmp eq i64 %17, 0
br i1 %18, label %25, label %19
19: ; preds = %16
%20 = mul nsw i32 %11, 10
%21 = load i8, i8* %10
%22 = sext i8 %21 to i32
%23 = add i32 %20, -48
%24 = add i32 %23, %22
br label %29
25: ; preds = %16
%26 = load i8, i8* %10
%27 = icmp eq i8 %26, 37
%28 = select i1 %27, i32 1, i32 %9
br label %29
29: ; preds = %25, %19
%30 = phi i32 [ %24, %19 ], [ %11, %25 ]
%31 = phi i32 [ %9, %19 ], [ %28, %25 ]
%32 = getelementptr inbounds i8, i8* %10, i64 1
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 0
br i1 %34, label %35, label %7
35: ; preds = %29, %15, %2
%36 = phi i32 [ 0, %2 ], [ %11, %15 ], [ %30, %29 ]
%37 = phi i32 [ 0, %2 ], [ %9, %15 ], [ %31, %29 ]
%38 = sub nsw i32 0, %36
%39 = select i1 %4, i32 %36, i32 %38
%40 = load i32, i32* @INT_MIN
%41 = icmp slt i32 %39, %40
%42 = load i32, i32* @INT_MAX
%43 = icmp sgt i32 %39, %42
%44 = select i1 %43, i32 %42, i32 %39
%45 = select i1 %41, i32 %40, i32 %44
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %35
store i8 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0)
br label %68
48: ; preds = %35
%49 = icmp slt i32 %45, %42
%50 = icmp sgt i32 %45, %40
%51 = select i1 %49, i1 %50, i1 false
br i1 %51, label %56, label %52
52: ; preds = %48
%53 = icmp slt i32 %45, 0
%54 = select i1 %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%55 = tail call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %54)
br label %68
56: ; preds = %48
%57 = icmp eq i32 %37, 0
%58 = icmp ugt i32 %45, -100
%59 = select i1 %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
br i1 %57, label %62, label %60
60: ; preds = %56
%61 = tail call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %59, i32 %45)
br label %68
62: ; preds = %56
%63 = sdiv i32 %45, 100
%64 = mul nsw i32 %63, -100
%65 = add i32 %64, %45
%66 = tail call i32 @llvm.abs.i32(i32 %65, i1 true)
%67 = tail call i32 (i8*, i32, i8*, i8*, ...) @snprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0), i32 14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8* %59, i32 %63, i32 %66)
br label %68
68: ; preds = %52, %62, %60, %47
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @form_field_getstr_discount.str, i64 0, i64 0)
}