#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*/ Qt_handleString(char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ sscanf(char *, char *, int *);
int /*<<< orphan*/ strcmp(char *, char *);
char *strstr(char *, char *);
void Qt_setPrecision(char *widget, int pen, char *token) {
  (void)(pen);
  if (!strcmp(widget, "caStripPlot"))
    return;
  if (!strcmp(widget, "caThermo"))
    return;
  if (strstr(widget, "caNumeric") != (char *)0) {
    int prec;
    char asc[10];
    sscanf(token, "%d", &prec);
    Qt_handleString("decimalDigits", "number", token);
    sprintf(asc, "%d", prec + 1);
    Qt_handleString("integerDigits", "number", asc);
  } else {
    int prec;
    char asc[10];
    sscanf(token, "%d", &prec);
    sprintf(asc, "%d", prec);
    Qt_handleString("precision", "number", asc);
  }
}


x86 assembly (clang, -O0):
<Qt_setPrecision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1181 <Qt_setPrecision+0x31>
jmp    1254 <Qt_setPrecision+0x104>
mov    -0x8(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    119f <Qt_setPrecision+0x4f>
jmp    1254 <Qt_setPrecision+0x104>
mov    -0x8(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1216 <Qt_setPrecision+0xc6>
mov    -0x18(%rbp),%rdi
lea    0xe5b(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe4a(%rip),%rdi
lea    0xe51(%rip),%rsi
call   1030 <Qt_handleString@plt>
lea    -0x26(%rbp),%rdi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
lea    0xe2a(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x26(%rbp),%rdx
lea    0xe32(%rip),%rdi
lea    0xe24(%rip),%rsi
call   1030 <Qt_handleString@plt>
jmp    1254 <Qt_setPrecision+0x104>
mov    -0x18(%rbp),%rdi
lea    0xdfe(%rip),%rsi
lea    -0x2c(%rbp),%rdx
call   1050 <sscanf@plt>
lea    -0x36(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xde7(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x36(%rbp),%rdx
lea    0xdfd(%rip),%rdi
lea    0xde1(%rip),%rsi
call   1030 <Qt_handleString@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Qt_setPrecision>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xe98(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1237 <Qt_setPrecision+0xe7>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1237 <Qt_setPrecision+0xe7>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     11f6 <Qt_setPrecision+0xa6>
lea    0xe78(%rip),%r15
lea    0x8(%rsp),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <sscanf@plt>
lea    0xe64(%rip),%rdi
lea    0xe6b(%rip),%r12
mov    %r12,%rsi
mov    %r14,%rdx
call   1030 <Qt_handleString@plt>
mov    0x8(%rsp),%edx
add    $0x1,%edx
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <sprintf@plt>
lea    0xe49(%rip),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
jmp    1232 <Qt_setPrecision+0xe2>
lea    0xe22(%rip),%rbx
lea    0x8(%rsp),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <sscanf@plt>
mov    0x8(%rsp),%edx
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <sprintf@plt>
lea    0xe1d(%rip),%rdi
lea    0xe01(%rip),%rsi
mov    %r14,%rdx
call   1030 <Qt_handleString@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"caStripPlot\00"
@.str.1 = [9 x i8] c"caThermo\00"
@.str.2 = [10 x i8] c"caNumeric\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [14 x i8] c"decimalDigits\00"
@.str.5 = [7 x i8] c"number\00"
@.str.6 = [14 x i8] c"integerDigits\00"
@.str.7 = [10 x i8] c"precision\00"
define void @Qt_setPrecision(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [10 x i8]
%9 = alloca i32
%10 = alloca [10 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%11 = load i32, i32* %5
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %3
br label %44
16: ; preds = %3
%17 = load i8*, i8** %4
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %16
br label %44
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = call i8* @strstr(i8* %22, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %36
25: ; preds = %21
%26 = load i8*, i8** %6
%27 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%28 = load i8*, i8** %6
%29 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
%33 = call i32 @sprintf(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%35 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %34)
br label %44
36: ; preds = %21
%37 = load i8*, i8** %6
%38 = call i32 @sscanf(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%40 = load i32, i32* %9
%41 = call i32 @sprintf(i8* %39, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%43 = call i32 @Qt_handleString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %42)
br label %44
44: ; preds = %15, %20, %36, %25
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"caStripPlot\00"
@.str.1 = [9 x i8] c"caThermo\00"
@.str.2 = [10 x i8] c"caNumeric\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [14 x i8] c"decimalDigits\00"
@.str.5 = [7 x i8] c"number\00"
@.str.6 = [14 x i8] c"integerDigits\00"
@.str.7 = [10 x i8] c"precision\00"
define void @Qt_setPrecision(i8* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca [10 x i8]
%6 = alloca i32
%7 = alloca [10 x i8]
%8 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %32, label %10
10: ; preds = %3
%11 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i32 %11, 0
br i1 %12, label %32, label %13
13: ; preds = %10
%14 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %25, label %16
16: ; preds = %13
%17 = bitcast i32* %4 to i8*
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%19 = call i32 @sscanf(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%20 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %2)
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
%23 = call i32 @sprintf(i8* %18, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %18)
br label %32
25: ; preds = %13
%26 = bitcast i32* %6 to i8*
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%28 = call i32 @sscanf(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%29 = load i32, i32* %6
%30 = call i32 @sprintf(i8* %27, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %29)
%31 = call i32 @Qt_handleString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %27)
br label %32
32: ; preds = %10, %3, %25, %16
ret void
}