xunge/DecIR huggingface dataset:
/* Variables and functions */
int iwconfig_wlan1();
int route_wlan1();
int get_wifi_client_status() {
  int iwconfig_wlan1_status = 0;
  int route_wlan1_status = 0;
  int ret = 0;
  iwconfig_wlan1_status = iwconfig_wlan1();
  route_wlan1_status = route_wlan1();
  if (iwconfig_wlan1_status && route_wlan1_status) {
    ret = 1;
  } else if (iwconfig_wlan1_status == 0 || route_wlan1_status == 0) {
    ret = 0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_wifi_client_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <iwconfig_wlan1@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <route_wlan1@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1171 <get_wifi_client_status+0x51>
cmpl   $0x0,-0x8(%rbp)
je     1171 <get_wifi_client_status+0x51>
movl   $0x1,-0xc(%rbp)
jmp    1191 <get_wifi_client_status+0x71>
cmpl   $0x0,-0x4(%rbp)
je     1185 <get_wifi_client_status+0x65>
cmpl   $0x0,-0x8(%rbp)
jne    118c <get_wifi_client_status+0x6c>
movl   $0x0,-0xc(%rbp)
jmp    1191 <get_wifi_client_status+0x71>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wifi_client_status>:
push   %rbx
xor    %eax,%eax
call   1030 <iwconfig_wlan1@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <route_wlan1@plt>
test   %ebx,%ebx
setne  %cl
test   %eax,%eax
setne  %al
and    %cl,%al
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_wifi_client_status() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%4 = call i32 (...) @iwconfig_wlan1()
store i32 %4, i32* %1
%5 = call i32 (...) @route_wlan1()
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %3
br label %20
12: ; preds = %8, %0
%13 = load i32, i32* %1
%14 = icmp eq i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15, %12
store i32 0, i32* %3
br label %19
19: ; preds = %18, %15
br label %20
20: ; preds = %19, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @get_wifi_client_status() {
%1 = tail call i32 (...) @iwconfig_wlan1()
%2 = tail call i32 (...) @route_wlan1()
%3 = icmp ne i32 %1, 0
%4 = icmp ne i32 %2, 0
%5 = select i1 %3, i1 %4, i1 false
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char, unsigned char, double);
char *dtostrf(double val, signed char width, unsigned char prec, char *s) {
  sprintf(s, "%*.*lf", width, prec, val);
  return s;
}


x86 assembly (clang, -O0):
<dtostrf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%cl
movsd  %xmm0,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x9(%rbp),%cl
mov    -0xa(%rbp),%al
movsd  -0x8(%rbp),%xmm0
lea    0xebd(%rip),%rsi
movsbl %cl,%edx
movzbl %al,%ecx
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtostrf>:
push   %rbx
mov    %rdx,%rbx
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%*.*lf\00"
define i8* @dtostrf(double %0, i8 signext %1, i8 zeroext %2, i8* %3) {
%5 = alloca double
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8*
store double %0, double* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = load i8, i8* %6
%11 = load i8, i8* %7
%12 = load double, double* %5
%13 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %10, i8 zeroext %11, double %12)
%14 = load i8*, i8** %8
ret i8* %14
}

LLVM IR (-O2):
@.str = [7 x i8] c"%*.*lf\00"
define i8* @dtostrf(double %0, i8 signext %1, i8 zeroext %2, i8* returned writeonly %3) {
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %1, i8 zeroext %2, double %0)
ret i8* %3
}
int main() {
  int i;
  int led = 0;
  *(volatile int *)((0x80000000 + 0x0108)) = 0x00000000F;
  while (1) {
    *(volatile int *)((0x80000000 + 0x0100)) = led;
    for (i = 0; i < 2500000; i++)
      ;
    led = ~led;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x80000108,%eax
movl   $0xf,(%rax)
mov    -0xc(%rbp),%ecx
mov    $0x80000100,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2625a0,-0x8(%rbp)
jge    114e <main+0x4e>
jmp    1140 <main+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <main+0x2e>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
mov    $0x80000100,%eax
movl   $0xf,0x8(%rax)
xor    %ecx,%ecx
xchg   %ax,%ax
mov    %ecx,(%rax)
not    %ecx
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store volatile i32 15, i32* inttoptr (i64 2147483912 to i32*)
br label %4
4: ; preds = %0, %13
%5 = load i32, i32* %3
store volatile i32 %5, i32* inttoptr (i64 2147483904 to i32*)
store i32 0, i32* %2
br label %6
6: ; preds = %10, %4
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 2500000
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %6
13: ; preds = %6
%14 = load i32, i32* %3
%15 = xor i32 %14, -1
store i32 %15, i32* %3
br label %4
}

LLVM IR (-O2):
define i32 @main() {
store volatile i32 15, i32* inttoptr (i64 2147483912 to i32*)
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
store volatile i32 %2, i32* inttoptr (i64 2147483904 to i32*)
%3 = xor i32 %2, -1
br label %1
}
int main() {
  int i = 3;
  int sum = 0;
  switch (i) {
  default:
    while (i-- >= 0) {
      sum++;
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
jmp    111e <main+0x1e>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
jl     1140 <main+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <main+0x1e>
jmp    1145 <main+0x45>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %5 [
]
5: ; preds = %0
br label %6
6: ; preds = %10, %5
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp sge i32 %7, 0
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %6
13: ; preds = %6
br label %14
14: ; preds = %13
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @main() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ cgcalr();
int /*<<< orphan*/ gentext();
int /*<<< orphan*/ load();
void gencalr(void) {
  gentext();
  cgcalr();
  load();
}


x86 assembly (clang, -O0):
<gencalr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <gentext@plt>
mov    $0x0,%al
call   1030 <cgcalr@plt>
mov    $0x0,%al
call   1050 <load@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gencalr>:
push   %rax
xor    %eax,%eax
call   1040 <gentext@plt>
xor    %eax,%eax
call   1030 <cgcalr@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <load@plt>

LLVM IR (-O0):
define void @gencalr() {
%1 = call i32 (...) @gentext()
%2 = call i32 (...) @cgcalr()
%3 = call i32 (...) @load()
ret void
}

LLVM IR (-O2):
define void @gencalr() {
%1 = tail call i32 (...) @gentext()
%2 = tail call i32 (...) @cgcalr()
%3 = tail call i32 (...) @load()
ret void
}
int main(void) {
  char original[10 + 1] = "cadena";
  char copia[10 + 1];
  int i;
  for (i = 0; i <= 10; i++) {
    copia[i] = original[i];
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xeeb(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xee3(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xa,-0x20(%rbp)
jg     1159 <main+0x59>
movslq -0x20(%rbp),%rax
mov    -0xf(%rbp,%rax,1),%cl
movslq -0x20(%rbp),%rax
mov    %cl,-0x1a(%rbp,%rax,1)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1131 <main+0x31>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
@__const.main.original = [11 x i8] c"cadena\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca [11 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [11 x i8]* %2 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %17, %0
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 10
br i1 %8, label %9, label %20
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 %15
store i8 %13, i8* %16
br label %17
17: ; preds = %9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %6
20: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ freeConfig();
void quit(int signum) {
  freeConfig();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <freeConfig@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1030 <freeConfig@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @freeConfig()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 (...) @freeConfig()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fn1();
int /*<<< orphan*/ fn2();
int /*<<< orphan*/ fn3(int, int **);
int main() {
  int b[4][4];
  fn1();
  fn2();
  fn3(2, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    $0x0,%al
call   1030 <fn1@plt>
mov    $0x0,%al
call   1050 <fn2@plt>
lea    -0x40(%rbp),%rsi
mov    $0x2,%edi
call   1040 <fn3@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
xor    %eax,%eax
call   1030 <fn1@plt>
xor    %eax,%eax
call   1050 <fn2@plt>
mov    %rsp,%rsi
mov    $0x2,%edi
call   1040 <fn3@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = call i32 (...) @fn1()
%3 = call i32 (...) @fn2()
%4 = getelementptr inbounds [4 x [4 x i32]], [4 x [4 x i32]]* %1, i64 0, i64 0
%5 = bitcast [4 x i32]* %4 to i32**
%6 = call i32 @fn3(i32 2, i32** %5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [4 x [4 x i32]]
%2 = bitcast [4 x [4 x i32]]* %1 to i8*
%3 = tail call i32 (...) @fn1()
%4 = tail call i32 (...) @fn2()
%5 = bitcast [4 x [4 x i32]]* %1 to i32**
%6 = call i32 @fn3(i32 2, i32** %5)
ret i32 0
}
void COM_BitClear(int array[], int bitNum) {
  int i;
  i = 0;
  while (bitNum > 31) {
    i++;
    bitNum -= 32;
  }
  array[i] &= ~(1 << bitNum);
}


x86 assembly (clang, -O0):
<COM_BitClear>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x1f,-0xc(%rbp)
jle    1133 <COM_BitClear+0x33>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    1112 <COM_BitClear+0x12>
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    $0xffffffff,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_BitClear>:
mov    %esi,%ecx
cmp    $0x20,%esi
jl     112e <COM_BitClear+0x2e>
cmp    $0x3f,%ecx
mov    $0x3f,%eax
cmovl  %ecx,%eax
neg    %eax
lea    (%rcx,%rax,1),%edx
add    $0x1f,%edx
mov    %edx,%eax
shr    $0x5,%eax
add    $0x1,%eax
and    $0xffffffe0,%edx
neg    %edx
add    %edx,%ecx
add    $0xffffffe0,%ecx
jmp    1130 <COM_BitClear+0x30>
xor    %eax,%eax
mov    $0xfffffffe,%edx
rol    %cl,%edx
and    %edx,(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @COM_BitClear(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %9, %2
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 31
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
store i32 %11, i32* %5
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 32
store i32 %13, i32* %4
br label %6
14: ; preds = %6
%15 = load i32, i32* %4
%16 = shl i32 1, %15
%17 = xor i32 %16, -1
%18 = load i32*, i32** %3
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = and i32 %22, %17
store i32 %23, i32* %21
ret void
}

LLVM IR (-O2):
define void @COM_BitClear(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 31
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = add nuw i32 %1, 31
%6 = call i32 @llvm.smin.i32(i32 %1, i32 63)
%7 = sub nuw i32 %5, %6
%8 = lshr i32 %7, 5
%9 = add nuw nsw i32 %8, 1
%10 = and i32 %7, -32
%11 = add nsw i32 %1, -32
%12 = sub nsw i32 %11, %10
%13 = zext i32 %9 to i64
br label %14
14: ; preds = %4, %2
%15 = phi i32 [ %1, %2 ], [ %12, %4 ]
%16 = phi i64 [ 0, %2 ], [ %13, %4 ]
%17 = shl nuw i32 1, %15
%18 = xor i32 %17, -1
%19 = getelementptr inbounds i32, i32* %0, i64 %16
%20 = load i32, i32* %19
%21 = and i32 %20, %18
store i32 %21, i32* %19
ret void
}
/* Variables and functions */
scalar_t__ FlipEndian(void *, int);
short FLIP_SHORT(short pVar) {
  return *(short *)FlipEndian((void *)&pVar, sizeof(short));
}


x86 assembly (clang, -O0):
<FLIP_SHORT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <FlipEndian@plt>
movswl (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLIP_SHORT>:
push   %rax
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <FlipEndian@plt>
movzwl (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @FLIP_SHORT(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 2)
%5 = inttoptr i64 %4 to i16*
%6 = load i16, i16* %5
ret i16 %6
}

LLVM IR (-O2):
define signext i16 @FLIP_SHORT(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = bitcast i16* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 2)
%5 = inttoptr i64 %4 to i16*
%6 = load i16, i16* %5
ret i16 %6
}
/* Variables and functions */
int /*<<< orphan*/ max(int, int /*<<< orphan*/);
int min(int /*<<< orphan*/, int);
int clamp(int val, int maxval) { return min(max(val, 0), maxval - 1); }


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <max@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <min@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
push   %rbx
mov    %esi,%ebx
xor    %esi,%esi
call   1040 <max@plt>
add    $0xffffffff,%ebx
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <min@plt>

LLVM IR (-O0):
define i32 @clamp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @max(i32 %5, i32 0)
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = call i32 @min(i32 %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @clamp(i32 %0, i32 %1) {
%3 = tail call i32 @max(i32 %0, i32 0)
%4 = add nsw i32 %1, -1
%5 = tail call i32 @min(i32 %3, i32 %4)
ret i32 %5
}
void fa67(int n) {
  {
    int b[n];
    {
      int c[n];
      0;
    }
  a:
    goto a;
    {
      int d[n];
      0;
    };
    int e[n];
    0;
  };
  {
    int f[n];
    {
      int g[n];
      0;
    };
    {
      int h[n];
      0;
    };
    ;
    int i[n];
    0;
  };
  ;
  int j[n];
  0;
}


x86 assembly (clang, -O0):
<fa67>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
jmp    1131 <fa67+0x31>

x86 assembly (clang, -O2):
<fa67>:
jmp    1100 <fa67>

LLVM IR (-O0):
define void @fa67(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i64
store i32 %0, i32* %2
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = call i8* @llvm.stacksave()
store i8* %21, i8** %3
%22 = alloca i32, i64 %20
store i64 %20, i64* %4
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %5
%26 = alloca i32, i64 %24
store i64 %24, i64* %6
%27 = load i8*, i8** %5
br label %28
28: ; preds = %28, %1
br label %28
29: ; No predecessors!
%30 = load i32, i32* %2
%31 = zext i32 %30 to i64
%32 = call i8* @llvm.stacksave()
store i8* %32, i8** %7
%33 = alloca i32, i64 %31
store i64 %31, i64* %8
%34 = load i8*, i8** %7
%35 = load i32, i32* %2
%36 = zext i32 %35 to i64
%37 = alloca i32, i64 %36
store i64 %36, i64* %9
%38 = load i8*, i8** %3
%39 = load i32, i32* %2
%40 = zext i32 %39 to i64
%41 = call i8* @llvm.stacksave()
store i8* %41, i8** %10
%42 = alloca i32, i64 %40
store i64 %40, i64* %11
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
%45 = call i8* @llvm.stacksave()
store i8* %45, i8** %12
%46 = alloca i32, i64 %44
store i64 %44, i64* %13
%47 = load i8*, i8** %12
%48 = load i32, i32* %2
%49 = zext i32 %48 to i64
%50 = call i8* @llvm.stacksave()
store i8* %50, i8** %14
%51 = alloca i32, i64 %49
store i64 %49, i64* %15
%52 = load i8*, i8** %14
%53 = load i32, i32* %2
%54 = zext i32 %53 to i64
%55 = alloca i32, i64 %54
store i64 %54, i64* %16
%56 = load i8*, i8** %10
%57 = load i32, i32* %2
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %17
%60 = alloca i32, i64 %58
store i64 %58, i64* %18
%61 = load i8*, i8** %17
ret void
}

LLVM IR (-O2):
define void @fa67(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ NRF24_InsRead(int, int *, int);
uint8_t NRF24_Read_Reg(uint8_t reg) {
  uint8_t data;
  NRF24_InsRead(0x00 | reg, &data, 1);
  return data;
}


x86 assembly (clang, -O0):
<NRF24_Read_Reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x0,%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <NRF24_InsRead@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NRF24_Read_Reg>:
push   %rax
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <NRF24_InsRead@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @NRF24_Read_Reg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = or i32 0, %4
%6 = call i32 @NRF24_InsRead(i32 %5, i32* %3, i32 1)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @NRF24_Read_Reg(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @NRF24_InsRead(i32 %0, i32* %2, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t minipack_unpack_str8(void *ptr, size_t *sz) {
  *sz = 2;
  return ((uint8_t *)ptr)[1];
}


x86 assembly (clang, -O0):
<minipack_unpack_str8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x2,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minipack_unpack_str8>:
movq   $0x2,(%rsi)
mov    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @minipack_unpack_str8(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 2, i64* %5
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @minipack_unpack_str8(i8* nocapture %0, i64* nocapture writeonly %1) {
store i64 2, i64* %1
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_int2(void) { print("!! NMI "); }


x86 assembly (clang, -O0):
<idt_int2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <print@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<idt_int2>:
lea    0xee9(%rip),%rdi
jmp    1030 <print@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"!! NMI \00"
define void @idt_int2() {
%1 = call i32 @print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"!! NMI \00"
define void @idt_int2() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scs(int /*<<< orphan*/, int /*<<< orphan*/);
void scs_graphics(void) { scs(0, '0'); }


x86 assembly (clang, -O0):
<scs_graphics>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x30,%esi
call   1030 <scs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<scs_graphics>:
xor    %edi,%edi
mov    $0x30,%esi
jmp    1030 <scs@plt>

LLVM IR (-O0):
define void @scs_graphics() {
%1 = call i32 @scs(i32 0, i32 48)
ret void
}

LLVM IR (-O2):
define void @scs_graphics() {
%1 = tail call i32 @scs(i32 0, i32 48)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isprint(int /*<<< orphan*/);
int diminuto_escape_printable(const char *from) {
  int printable = !0;
  while (*from != '\0') {
    if (!isprint(*(from++))) {
      printable = 0;
      break;
    }
  }
  return printable;
}


x86 assembly (clang, -O0):
<diminuto_escape_printable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1164 <diminuto_escape_printable+0x54>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <isprint@plt>
cmp    $0x0,%eax
jne    115f <diminuto_escape_printable+0x4f>
movl   $0x0,-0xc(%rbp)
jmp    1164 <diminuto_escape_printable+0x54>
jmp    1123 <diminuto_escape_printable+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_escape_printable>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
test   %edi,%edi
je     1138 <diminuto_escape_printable+0x28>
add    $0x1,%rbx
call   1030 <isprint@plt>
test   %eax,%eax
jne    1120 <diminuto_escape_printable+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @diminuto_escape_printable(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1, i32* %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = call i32 @isprint(i32 %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %9
store i32 0, i32* %3
br label %18
17: ; preds = %9
br label %4
18: ; preds = %16, %4
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @diminuto_escape_printable(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %8, %6 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = sext i8 %4 to i32
%8 = getelementptr inbounds i8, i8* %3, i64 1
%9 = tail call i32 @isprint(i32 %7)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %2
11: ; preds = %6, %2
%12 = phi i32 [ 1, %2 ], [ 0, %6 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fdc_read_sector(int, int, char *);
void readblock_fd(int device, int blockno, char *buffer) {
  fdc_read_sector(device, blockno * 2, buffer);
  fdc_read_sector(device, blockno * 2 + 1, buffer + 512);
}


x86 assembly (clang, -O0):
<readblock_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
mov    -0x10(%rbp),%rdx
call   1030 <fdc_read_sector@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rdx
add    $0x200,%rdx
call   1030 <fdc_read_sector@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readblock_fd>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
lea    (%r14,%r14,1),%esi
call   1030 <fdc_read_sector@plt>
lea    (%r14,%r14,1),%esi
add    $0x1,%esi
add    $0x200,%rbx
mov    %ebp,%edi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fdc_read_sector@plt>

LLVM IR (-O0):
define void @readblock_fd(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul nsw i32 %8, 2
%10 = load i8*, i8** %6
%11 = call i32 @fdc_read_sector(i32 %7, i32 %9, i8* %10)
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = mul nsw i32 %13, 2
%15 = add nsw i32 %14, 1
%16 = load i8*, i8** %6
%17 = getelementptr inbounds i8, i8* %16, i64 512
%18 = call i32 @fdc_read_sector(i32 %12, i32 %15, i8* %17)
ret void
}

LLVM IR (-O2):
define void @readblock_fd(i32 %0, i32 %1, i8* %2) {
%4 = shl nsw i32 %1, 1
%5 = tail call i32 @fdc_read_sector(i32 %0, i32 %4, i8* %2)
%6 = or i32 %4, 1
%7 = getelementptr inbounds i8, i8* %2, i64 512
%8 = tail call i32 @fdc_read_sector(i32 %0, i32 %6, i8* %7)
ret void
}
void nvm_unregister(char *disk_name) {}


x86 assembly (clang, -O0):
<nvm_unregister>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvm_unregister>:
ret

LLVM IR (-O0):
define void @nvm_unregister(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @nvm_unregister(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void pathToLong(void) {
  printf("File path is to long. Closing application.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<pathToLong>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pathToLong>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"File path is to long. Closing application.\0A\00"
@EXIT_FAILURE = global i32 0
define void @pathToLong() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [43 x i8] c"File path is to long. Closing application.\00"
define void @pathToLong() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int32_t;

/* Variables and functions */
void bigendian_to_s32(int32_t *dst, uint8_t *src) {
  *dst = (((int32_t)src[0]) << 24) | (((int32_t)src[1]) << 16) |
         (((int32_t)src[2]) << 8) | (int32_t)src[3];
}


x86 assembly (clang, -O0):
<bigendian_to_s32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %eax,%ecx
shl    $0x18,%ecx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x10,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigendian_to_s32>:
mov    (%rsi),%eax
mov    0x8(%rsi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rsi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bigendian_to_s32(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 24
%10 = load i64*, i64** %4
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 16
%15 = or i32 %9, %14
%16 = load i64*, i64** %4
%17 = getelementptr inbounds i64, i64* %16, i64 2
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 8
%21 = or i32 %15, %20
%22 = load i64*, i64** %4
%23 = getelementptr inbounds i64, i64* %22, i64 3
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
%26 = or i32 %21, %25
%27 = load i32*, i32** %3
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @bigendian_to_s32(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
%5 = shl i32 %4, 24
%6 = getelementptr inbounds i64, i64* %1, i64 1
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i64, i64* %1, i64 2
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = getelementptr inbounds i64, i64* %1, i64 3
%17 = load i64, i64* %16
%18 = trunc i64 %17 to i32
%19 = or i32 %15, %18
store i32 %19, i32* %0
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long _now_ms(void) {
  struct timeval tv;
  unsigned long long now;
  gettimeofday(&tv, NULL);
  now = (unsigned long long)(tv.tv_sec) * 1000 +
        (unsigned long long)(tv.tv_usec) / 1000;
  return now;
}


x86 assembly (clang, -O0):
<_now_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_now_ms>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,0x10(%rsp),%rcx
mov    0x8(%rsp),%rax
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rdx
9b c4 20
mul    %rdx
shr    $0x4,%rdx
add    %rdx,%rcx
mov    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @_now_ms() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = udiv i64 %8, 1000
%10 = add i64 %6, %9
store i64 %10, i64* %2
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @_now_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = udiv i64 %8, 1000
%10 = add i64 %9, %6
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_CRL_it;
int i2d_X509_CRL(X509_CRL *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CRL_it);
}


x86 assembly (clang, -O0):
<i2d_X509_CRL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_X509_CRL>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@X509_CRL_it = global i32 0
define i32 @i2d_X509_CRL(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @X509_CRL_it)
ret i32 %7
}

LLVM IR (-O2):
@X509_CRL_it = global i32 0
define i32 @i2d_X509_CRL(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_CRL_it)
ret i32 %3
}
void breakpoint() { __asm("int3"); }


x86 assembly (clang, -O0):
<breakpoint>:
push   %rbp
mov    %rsp,%rbp
int3
pop    %rbp
ret

x86 assembly (clang, -O2):
<breakpoint>:
int3
ret

LLVM IR (-O0):
define void @breakpoint() {
ret void
}

LLVM IR (-O2):
define void @breakpoint() {
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t dcastu(double f) { return *(uint64_t *)&f; }


x86 assembly (clang, -O0):
<dcastu>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcastu>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @dcastu(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @dcastu(double %0) {
%2 = bitcast double %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ use(char *);
__attribute__((always_)) void helper_no_markers() {
  char a;
  use(&a);
}


x86 assembly (clang, -O0):
<helper_no_markers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x1(%rbp),%rdi
call   1030 <use@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<helper_no_markers>:
push   %rax
lea    0x7(%rsp),%rdi
call   1030 <use@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @helper_no_markers() {
%1 = alloca i8
%2 = call i32 @use(i8* %1)
ret void
}

LLVM IR (-O2):
define void @helper_no_markers() {
%1 = alloca i8
%2 = call i32 @use(i8* %1)
ret void
}
void test2() {}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
ret

LLVM IR (-O0):
define void @test2() {
ret void
}

LLVM IR (-O2):
define void @test2() {
ret void
}
int isnum(char c) {
  if (c >= '0' && c <= '9')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <isnum+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <isnum+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isnum+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnum>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isnum(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isnum(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void commu_alarm(int sig) {
  printf("ALARM...\n");
  return;
}


x86 assembly (clang, -O0):
<commu_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commu_alarm>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"ALARM...\0A\00"
define void @commu_alarm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"ALARM...\00"
define void @commu_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int Palindromes_abba(int l) {
  int p = l;
  for (; l; l /= 10)
    p = p * 10 + l % 10;
  return p;
}


x86 assembly (clang, -O0):
<Palindromes_abba>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Palindromes_abba+0x44>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110d <Palindromes_abba+0xd>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Palindromes_abba>:
test   %edi,%edi
je     1140 <Palindromes_abba+0x40>
mov    %edi,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %ecx,%rdx
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rcx
add    %esi,%ecx
lea    (%rcx,%rcx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edx,%edi
sub    %esi,%edi
lea    (%rdi,%rax,2),%eax
add    $0x9,%edx
cmp    $0x12,%edx
ja     1110 <Palindromes_abba+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Palindromes_abba(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
br label %5
5: ; preds = %14, %1
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, 10
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = add nsw i32 %10, %12
store i32 %13, i32* %3
br label %14
14: ; preds = %8
%15 = load i32, i32* %2
%16 = sdiv i32 %15, 10
store i32 %16, i32* %2
br label %5
17: ; preds = %5
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @Palindromes_abba(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Variables and functions */
char *easprintf(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
char *errno_message(char *filename) {
  return (easprintf("%s: %s", filename, strerror(errno)));
}


x86 assembly (clang, -O0):
<errno_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb1(%rip),%rdi
call   1030 <easprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errno_message>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <strerror@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <easprintf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define i8* @errno_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i8* @easprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s: %s\00"
@errno = global i32 0
define i8* @errno_message(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i8* @easprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret i8* %4
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, double *, double);
double *i() {
  double *d = (double *)malloc(sizeof(double));
  *d = 123.512;
  printf("direccion de d en la funcion i: %p. valor de d %lf\n", d, *d);
  return d;
}


x86 assembly (clang, -O0):
<i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xebe(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i>:
push   %rbx
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movabs $0x405ee0c49ba5e354,%rax
e0 5e 40
mov    %rax,(%rbx)
lea    0xec6(%rip),%rdi
movsd  0xeb6(%rip),%xmm0
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"direccion de d en la funcion i: %p. valor de d %lf\0A\00"
define double* @i() {
%1 = alloca double*
%2 = call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to double*
store double* %3, double** %1
%4 = load double*, double** %1
store double 1.235120e+02, double* %4
%5 = load double*, double** %1
%6 = load double*, double** %1
%7 = load double, double* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), double* %5, double %7)
%9 = load double*, double** %1
ret double* %9
}

LLVM IR (-O2):
@.str = [52 x i8] c"direccion de d en la funcion i: %p. valor de d %lf\0A\00"
define double* @i() {
%1 = tail call i64 @malloc(i32 8)
%2 = inttoptr i64 %1 to double*
store double 1.235120e+02, double* %2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), double* %2, double 1.235120e+02)
ret double* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void printListHeader(void) { printf("%8s%14s\n\n", "Time (ms)", "Event ID"); }


x86 assembly (clang, -O0):
<printListHeader>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
lea    0xeeb(%rip),%rdx
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printListHeader>:
lea    0xee9(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xeef(%rip),%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"%8s%14s\0A\0A\00"
@.str.1 = [10 x i8] c"Time (ms)\00"
@.str.2 = [9 x i8] c"Event ID\00"
define void @printListHeader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%8s%14s\0A\0A\00"
@.str.1 = [10 x i8] c"Time (ms)\00"
@.str.2 = [9 x i8] c"Event ID\00"
define void @printListHeader() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_signal();
int main() {
  print_signal();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <print_signal@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <print_signal@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @print_signal()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_signal()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ child();
int /*<<< orphan*/ child2();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("hello from C!\n");
  child();
  child2();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <child@plt>
mov    $0x0,%al
call   1050 <child2@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <child@plt>
xor    %eax,%eax
call   1050 <child2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"hello from C!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @child()
%4 = call i32 (...) @child2()
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"hello from C!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @child()
%3 = tail call i32 (...) @child2()
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
bool dmc_unrar_unicode_utf16_is_trail_surrogate(uint16_t code) {
  return (code >= 0xDC00) && (code <= 0xDFFF);
}


x86 assembly (clang, -O0):
<dmc_unrar_unicode_utf16_is_trail_surrogate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xdc00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <dmc_unrar_unicode_utf16_is_trail_surrogate+0x26>
cmpl   $0xdfff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmc_unrar_unicode_utf16_is_trail_surrogate>:
and    $0xfffffc00,%edi
xor    %eax,%eax
cmp    $0xdc00,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @dmc_unrar_unicode_utf16_is_trail_surrogate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 56320
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57343
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @dmc_unrar_unicode_utf16_is_trail_surrogate(i32 %0) {
%2 = and i32 %0, -1024
%3 = icmp eq i32 %2, 56320
%4 = zext i1 %3 to i32
ret i32 %4
}