void set_an_alarm(void) {
  int nexttime = get_next_alarm_delay_time();
  if (!ds_get_boolean(0, 11) && nexttime) {
  } else {
    do {
      if (snmp_get_do_debugging()) {
        debugmsgtoken("trace", " %s, %d\n",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/luebbers/reconos/refs/"
                      "heads/master/core/ecos/ecos-patched/ecos/packages/net/"
                      "snmp/lib/current/src/snmp_alarm.c",
                      282),
            debugmsg("trace", " %s, %d\n",
                     "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                     "outputs/2022-01-22/02-19-57/repos/luebbers/reconos/refs/"
                     "heads/master/core/ecos/ecos-patched/ecos/packages/net/"
                     "snmp/lib/current/src/snmp_alarm.c",
                     282),
            debugmsgtoken("snmp_alarm_set_an_alarm",
                          "no alarms found to handle\n"),
            debugmsg("snmp_alarm_set_an_alarm", "no alarms found to handle\n");
      }
    } while (0);
  }
}


x86 assembly (clang, -O0):
<set_an_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <get_next_alarm_delay_time@plt>
mov    %eax,-0x4(%rbp)
xor    %edi,%edi
mov    $0xb,%esi
mov    $0x0,%al
call   1060 <ds_get_boolean@plt>
cmp    $0x0,%eax
jne    1188 <set_an_alarm+0x38>
cmpl   $0x0,-0x4(%rbp)
je     1188 <set_an_alarm+0x38>
jmp    1213 <set_an_alarm+0xc3>
jmp    118d <set_an_alarm+0x3d>
mov    $0x0,%al
call   1070 <snmp_get_do_debugging@plt>
cmp    $0x0,%eax
je     1209 <set_an_alarm+0xb9>
lea    0xe5c(%rip),%rdi
lea    0xe5b(%rip),%rsi
lea    0xe5d(%rip),%rdx
mov    $0x11a,%ecx
mov    $0x0,%al
call   1040 <debugmsgtoken@plt>
lea    0xe3b(%rip),%rdi
lea    0xe3a(%rip),%rsi
lea    0xe3c(%rip),%rdx
mov    $0x11a,%ecx
mov    $0x0,%al
call   1030 <debugmsg@plt>
lea    0xef1(%rip),%rdi
lea    0xf02(%rip),%rsi
mov    $0x0,%al
call   1040 <debugmsgtoken@plt>
lea    0xedc(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <debugmsg@plt>
jmp    120e <set_an_alarm+0xbe>
jmp    1213 <set_an_alarm+0xc3>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_an_alarm>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <get_next_alarm_delay_time@plt>
mov    %eax,%ebx
xor    %edi,%edi
mov    $0xb,%esi
xor    %eax,%eax
call   1060 <ds_get_boolean@plt>
test   %eax,%eax
jne    1174 <set_an_alarm+0x24>
test   %ebx,%ebx
jne    11eb <set_an_alarm+0x9b>
xor    %eax,%eax
call   1070 <snmp_get_do_debugging@plt>
test   %eax,%eax
je     11eb <set_an_alarm+0x9b>
lea    0xe7a(%rip),%rbx
lea    0xe79(%rip),%r14
lea    0xe7b(%rip),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x11a,%ecx
xor    %eax,%eax
call   1040 <debugmsgtoken@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    $0x11a,%ecx
xor    %eax,%eax
call   1030 <debugmsg@plt>
lea    0xf12(%rip),%rbx
lea    0xf23(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <debugmsgtoken@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <debugmsg@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"trace\00"
@.str.1 = [9 x i8] c" %s, %d\0A\00"
@.str.2 = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/luebbers/reconos/refs/heads/master/core/ecos/ecos-patched/ecos/packages/net/snmp/lib/current/src/snmp_alarm.c\00"
@.str.3 = [24 x i8] c"snmp_alarm_set_an_alarm\00"
@.str.4 = [27 x i8] c"no alarms found to handle\0A\00"
define void @set_an_alarm() {
%1 = alloca i32
%2 = call i32 (...) @get_next_alarm_delay_time()
store i32 %2, i32* %1
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @ds_get_boolean to i32 (i32, i32, ...)*)(i32 0, i32 11)
%4 = icmp ne i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
br label %20
9: ; preds = %5, %0
br label %10
10: ; preds = %9
%11 = call i32 (...) @snmp_get_do_debugging()
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @debugmsgtoken to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.2, i64 0, i64 0), i32 282)
%15 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @debugmsg to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.2, i64 0, i64 0), i32 282)
%16 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @debugmsgtoken to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @debugmsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %18
18: ; preds = %13, %10
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19, %8
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"trace\00"
@.str.1 = [9 x i8] c" %s, %d\0A\00"
@.str.2 = [200 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/luebbers/reconos/refs/heads/master/core/ecos/ecos-patched/ecos/packages/net/snmp/lib/current/src/snmp_alarm.c\00"
@.str.3 = [24 x i8] c"snmp_alarm_set_an_alarm\00"
@.str.4 = [27 x i8] c"no alarms found to handle\0A\00"
define void @set_an_alarm() {
%1 = tail call i32 (...) @get_next_alarm_delay_time()
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @ds_get_boolean to i32 (i32, i32, ...)*)(i32 0, i32 11)
%3 = icmp eq i32 %2, 0
%4 = icmp ne i32 %1, 0
%5 = select i1 %3, i1 %4, i1 false
br i1 %5, label %14, label %6
6: ; preds = %0
%7 = tail call i32 (...) @snmp_get_do_debugging()
%8 = icmp eq i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %6
%10 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @debugmsgtoken to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.2, i64 0, i64 0), i32 282)
%11 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @debugmsg to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str.2, i64 0, i64 0), i32 282)
%12 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @debugmsgtoken to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%13 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @debugmsg to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %14
14: ; preds = %6, %9, %0
ret void
}