#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 (!strcmp(widget, "caSlider"))
    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    1272 <Qt_setPrecision+0x122>
mov    -0x8(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    119f <Qt_setPrecision+0x4f>
jmp    1272 <Qt_setPrecision+0x122>
mov    -0x8(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11bd <Qt_setPrecision+0x6d>
jmp    1272 <Qt_setPrecision+0x122>
mov    -0x8(%rbp),%rdi
lea    0xe56(%rip),%rsi
call   1070 <strstr@plt>
cmp    $0x0,%rax
je     1234 <Qt_setPrecision+0xe4>
mov    -0x18(%rbp),%rdi
lea    0xe46(%rip),%rsi
lea    -0x1c(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x18(%rbp),%rdx
lea    0xe35(%rip),%rdi
lea    0xe3c(%rip),%rsi
call   1030 <Qt_handleString@plt>
lea    -0x26(%rbp),%rdi
mov    -0x1c(%rbp),%edx
add    $0x1,%edx
lea    0xe15(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x26(%rbp),%rdx
lea    0xe1d(%rip),%rdi
lea    0xe0f(%rip),%rsi
call   1030 <Qt_handleString@plt>
jmp    1272 <Qt_setPrecision+0x122>
mov    -0x18(%rbp),%rdi
lea    0xde9(%rip),%rsi
lea    -0x2c(%rbp),%rdx
call   1050 <sscanf@plt>
lea    -0x36(%rbp),%rdi
mov    -0x2c(%rbp),%edx
lea    0xdd2(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x36(%rbp),%rdx
lea    0xde8(%rip),%rdi
lea    0xdcc(%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     124e <Qt_setPrecision+0xfe>
lea    0xe90(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     124e <Qt_setPrecision+0xfe>
lea    0xe82(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     124e <Qt_setPrecision+0xfe>
lea    0xe74(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strstr@plt>
test   %rax,%rax
je     120d <Qt_setPrecision+0xbd>
lea    0xe6a(%rip),%r15
lea    0x8(%rsp),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <sscanf@plt>
lea    0xe56(%rip),%rdi
lea    0xe5d(%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    0xe3b(%rip),%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
jmp    1249 <Qt_setPrecision+0xf9>
lea    0xe14(%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    0xe0f(%rip),%rdi
lea    0xdf3(%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 = [9 x i8] c"caSlider\00"
@.str.3 = [10 x i8] c"caNumeric\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [14 x i8] c"decimalDigits\00"
@.str.6 = [7 x i8] c"number\00"
@.str.7 = [14 x i8] c"integerDigits\00"
@.str.8 = [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 %49
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 %49
21: ; preds = %16
%22 = load i8*, i8** %4
%23 = call i32 @strcmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp ne i32 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %21
br label %49
26: ; preds = %21
%27 = load i8*, i8** %4
%28 = call i8* @strstr(i8* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %41
30: ; preds = %26
%31 = load i8*, i8** %6
%32 = call i32 @sscanf(i8* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%33 = load i8*, i8** %6
%34 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %33)
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
%38 = call i32 @sprintf(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%40 = call i32 @Qt_handleString(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %39)
br label %49
41: ; preds = %26
%42 = load i8*, i8** %6
%43 = call i32 @sscanf(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %9)
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%45 = load i32, i32* %9
%46 = call i32 @sprintf(i8* %44, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%48 = call i32 @Qt_handleString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %47)
br label %49
49: ; preds = %15, %20, %25, %41, %30
ret void
}

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