xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ILI948x_drv_init_LCD();
void gfx_init_lcd(void) { ILI948x_drv_init_LCD(); }


x86 assembly (clang, -O0):
<gfx_init_lcd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ILI948x_drv_init_LCD@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfx_init_lcd>:
xor    %eax,%eax
jmp    1030 <ILI948x_drv_init_LCD@plt>

LLVM IR (-O0):
define void @gfx_init_lcd() {
%1 = call i32 (...) @ILI948x_drv_init_LCD()
ret void
}

LLVM IR (-O2):
define void @gfx_init_lcd() {
%1 = tail call i32 (...) @ILI948x_drv_init_LCD()
ret void
}
void genBoard(char arr[4][9]) {
  int i, j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 9; j++) {
      arr[i][j] = ' ';
    }
  }
}


x86 assembly (clang, -O0):
<genBoard>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1162 <genBoard+0x62>
movl   $0x0,-0x10(%rbp)
cmpl   $0x9,-0x10(%rbp)
jge    114f <genBoard+0x4f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x9,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1120 <genBoard+0x20>
jmp    1154 <genBoard+0x54>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <genBoard+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<genBoard>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x20202020,0x20(%rdi)
ret

LLVM IR (-O0):
define void @genBoard([9 x i8]* %0) {
%2 = alloca [9 x i8]*
%3 = alloca i32
%4 = alloca i32
store [9 x i8]* %0, [9 x i8]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %27
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %20, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 9
br i1 %11, label %12, label %23
12: ; preds = %9
%13 = load [9 x i8]*, [9 x i8]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [9 x i8], [9 x i8]* %13, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [9 x i8], [9 x i8]* %16, i64 0, i64 %18
store i8 32, i8* %19
br label %20
20: ; preds = %12
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %9
23: ; preds = %9
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @genBoard([9 x i8]* nocapture writeonly %0) {
%2 = getelementptr [9 x i8], [9 x i8]* %0, i64 0, i64 0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int isgraph(int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int ls_isgraph(int c) {
  int ret;
  setlocale(LC_ALL, "");
  ret = isgraph(c);
  setlocale(LC_ALL, "C");
  return ret;
}


x86 assembly (clang, -O0):
<ls_isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec6(%rip),%rsi
call   1030 <setlocale@plt>
mov    -0x4(%rbp),%edi
call   1040 <isgraph@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <setlocale@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_isgraph>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb3(%rip),%r14
mov    (%r14),%edi
lea    0xeca(%rip),%rsi
call   1030 <setlocale@plt>
mov    %ebx,%edi
call   1040 <isgraph@plt>
mov    %eax,%ebx
mov    (%r14),%edi
lea    0xeb1(%rip),%rsi
call   1030 <setlocale@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isgraph(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @LC_ALL
%5 = call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @isgraph(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* @LC_ALL
%9 = call i32 @setlocale(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"C\00"
define i32 @ls_isgraph(i32 %0) {
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @isgraph(i32 %0)
%5 = load i32, i32* @LC_ALL
%6 = tail call i32 @setlocale(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fchs() {
  put8(0xD9);
  put8(0xE0);
}


x86 assembly (clang, -O0):
<fchs>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xe0,%edi
call   1030 <put8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fchs>:
push   %rax
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    $0xe0,%edi
pop    %rax
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fchs() {
%1 = call i32 @put8(i32 217)
%2 = call i32 @put8(i32 224)
ret void
}

LLVM IR (-O2):
define void @fchs() {
%1 = tail call i32 @put8(i32 217)
%2 = tail call i32 @put8(i32 224)
ret void
}
double distance(int circle_x, int circle_y, int collision_x, int collision_y) {
  int delta_x = collision_x - circle_x;
  int delta_y = collision_y - circle_y;
  return (double)((delta_x * delta_x) + (delta_y * delta_y));
}


x86 assembly (clang, -O0):
<distance>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x18(%rbp),%ecx
imul   -0x18(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance>:
sub    %edi,%edx
sub    %esi,%ecx
imul   %edx,%edx
imul   %ecx,%ecx
add    %edx,%ecx
cvtsi2sd %ecx,%xmm0
ret

LLVM IR (-O0):
define double @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %5
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %9
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = sub nsw i32 %14, %15
store i32 %16, i32* %10
%17 = load i32, i32* %9
%18 = load i32, i32* %9
%19 = mul nsw i32 %17, %18
%20 = load i32, i32* %10
%21 = load i32, i32* %10
%22 = mul nsw i32 %20, %21
%23 = add nsw i32 %19, %22
%24 = sitofp i32 %23 to double
ret double %24
}

LLVM IR (-O2):
define double @distance(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %2, %0
%6 = sub nsw i32 %3, %1
%7 = mul nsw i32 %5, %5
%8 = mul nsw i32 %6, %6
%9 = add nuw nsw i32 %8, %7
%10 = sitofp i32 %9 to double
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int elg_pform_num_cpus() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<elg_pform_num_cpus>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<elg_pform_num_cpus>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <sysconf@plt>

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @elg_pform_num_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @elg_pform_num_cpus() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void write8(volatile void *addr, uint8_t val) {
  *(volatile uint8_t *)addr = val;
}


x86 assembly (clang, -O0):
<write8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write8>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @write8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @write8(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
double randd();
int randomBinomial(int n, double p) {
  int i, c = 0;
  for (i = 0; i < n; i++)
    if (randd() < p)
      c++;
  return (c);
}


x86 assembly (clang, -O0):
<randomBinomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116f <randomBinomial+0x5f>
mov    $0x0,%al
call   1030 <randd@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <randomBinomial+0x4c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1161 <randomBinomial+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <randomBinomial+0x1e>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomBinomial>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    113e <randomBinomial+0x2e>
mov    %edi,%ebx
xor    %ebp,%ebp
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <randd@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <randomBinomial+0x10>
jmp    1140 <randomBinomial+0x30>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randomBinomial(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = call double (...) @randd()
%13 = load double, double* %4
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load i32, i32* %6
%17 = add nsw i32 %16, 1
store i32 %17, i32* %6
br label %18
18: ; preds = %15, %11
br label %19
19: ; preds = %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
define i32 @randomBinomial(i32 %0, double %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32 [ %11, %4 ], [ 0, %2 ]
%7 = tail call double (...) @randd()
%8 = fcmp olt double %7, %1
%9 = zext i1 %8 to i32
%10 = add nuw nsw i32 %5, %9
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i32 [ 0, %2 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
struct sockaddr_in6 {
  int /*<<< orphan*/ sin6_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int INET6_ADDRSTRLEN;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, int /*<<< orphan*/ *, char *,
                             int);
char *malloc(int);
const char *net_getConnectedIP_ipv6(struct sockaddr_in6 *dest) {
  char *str = malloc(sizeof(char) * INET6_ADDRSTRLEN);
  inet_ntop(AF_INET6, &(dest->sin6_addr), str, INET6_ADDRSTRLEN);
  return str;
}


x86 assembly (clang, -O0):
<net_getConnectedIP_ipv6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
movslq (%rax),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2e8b(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_getConnectedIP_ipv6>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eba(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %ebp,%ecx
call   1030 <inet_ntop@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in6 = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@AF_INET6 = global i32 0
define i8* @net_getConnectedIP_ipv6(%struct.sockaddr_in6* %0) {
%2 = alloca %struct.sockaddr_in6*
%3 = alloca i8*
store %struct.sockaddr_in6* %0, %struct.sockaddr_in6** %2
%4 = load i32, i32* @INET6_ADDRSTRLEN
%5 = sext i32 %4 to i64
%6 = mul i64 1, %5
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i32, i32* @AF_INET6
%10 = load %struct.sockaddr_in6*, %struct.sockaddr_in6** %2
%11 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %10, i32 0, i32 0
%12 = load i8*, i8** %3
%13 = load i32, i32* @INET6_ADDRSTRLEN
%14 = call i32 @inet_ntop(i32 %9, i32* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
%struct.sockaddr_in6 = type { i32 }
@INET6_ADDRSTRLEN = global i32 0
@AF_INET6 = global i32 0
define i8* @net_getConnectedIP_ipv6(%struct.sockaddr_in6* %0) {
%2 = load i32, i32* @INET6_ADDRSTRLEN
%3 = tail call i8* @malloc(i32 %2)
%4 = load i32, i32* @AF_INET6
%5 = getelementptr inbounds %struct.sockaddr_in6, %struct.sockaddr_in6* %0, i64 0, i32 0
%6 = tail call i32 @inet_ntop(i32 %4, i32* %5, i8* %3, i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ wait(int);
int main() {
  unsigned long i = 0;
  (*(volatile unsigned long *)0x56000050) = 0x00001500;
  (*(volatile unsigned long *)0x56000054) = 0x00000000;
  while (1) {
    wait(30000);
    (*(volatile unsigned long *)0x56000054) = (~(i << 4));
    if (++i == 8)
      i = 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x56000050,%eax
movq   $0x1500,(%rax)
mov    $0x56000054,%eax
movq   $0x0,(%rax)
mov    $0x7530,%edi
call   1030 <wait@plt>
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
xor    $0xffffffffffffffff,%rcx
mov    $0x56000054,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmp    $0x8,%rax
jne    117b <main+0x6b>
movq   $0x0,-0x10(%rbp)
jmp    113f <main+0x2f>

x86 assembly (clang, -O2):
<main>:
push   %rbx
movq   $0x1500,0x56000050
movq   $0x0,0x56000054
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x7530,%edi
call   1030 <wait@plt>
mov    %rbx,%rax
shl    $0x4,%rax
not    %rax
mov    %rax,0x56000054
56
add    $0x1,%rbx
cmp    $0x8,%rbx
mov    $0x0,%eax
cmove  %rax,%rbx
jmp    1130 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store volatile i64 5376, i64* inttoptr (i64 1442840656 to i64*)
store volatile i64 0, i64* inttoptr (i64 1442840660 to i64*)
br label %3
3: ; preds = %0, %12
%4 = call i32 @wait(i32 30000)
%5 = load i64, i64* %2
%6 = shl i64 %5, 4
%7 = xor i64 %6, -1
store volatile i64 %7, i64* inttoptr (i64 1442840660 to i64*)
%8 = load i64, i64* %2
%9 = add i64 %8, 1
store i64 %9, i64* %2
%10 = icmp eq i64 %9, 8
br i1 %10, label %11, label %12
11: ; preds = %3
store i64 0, i64* %2
br label %12
12: ; preds = %11, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
store volatile i64 5376, i64* inttoptr (i64 1442840656 to i64*)
store volatile i64 0, i64* inttoptr (i64 1442840660 to i64*)
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %8, %1 ]
%3 = tail call i32 @wait(i32 30000)
%4 = shl i64 %2, 4
%5 = xor i64 %4, -1
store volatile i64 %5, i64* inttoptr (i64 1442840660 to i64*)
%6 = add i64 %2, 1
%7 = icmp eq i64 %6, 8
%8 = select i1 %7, i64 0, i64 %6
br label %1
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int httpreq_parse_content_type(char *val) {
  if (strcmp(val, "application/json") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<httpreq_parse_content_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <httpreq_parse_content_type+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <httpreq_parse_content_type+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<httpreq_parse_content_type>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"application/json\00"
define i32 @httpreq_parse_content_type(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [17 x i8] c"application/json\00"
define i32 @httpreq_parse_content_type(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_D5uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xD5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D5uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0xd5,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_D5uint64_lowword_mem>:
testb  $0xd5,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_D5uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 213
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D5uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 213
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t sbrk(int incr) {
  extern caddr_t _end;
  static caddr_t *heap_end;
  caddr_t *prev_heap_end;
  if (heap_end == 0) {
    heap_end = &_end;
  }
  prev_heap_end = heap_end;
  heap_end += incr;
  return (caddr_t)prev_heap_end;
}


x86 assembly (clang, -O0):
<sbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpq   $0x0,0x2f19(%rip)
jne    1123 <sbrk+0x23>
mov    0x2ecc(%rip),%rax
mov    %rax,0x2f05(%rip)
mov    0x2efe(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    0x2ef0(%rip),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,0x2edf(%rip)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbrk>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
jne    1113 <sbrk+0x13>
mov    0x2ed5(%rip),%rax
movslq %edi,%rcx
lea    (%rax,%rcx,4),%rcx
mov    %rcx,0x2f07(%rip)
ret

LLVM IR (-O0):
@sbrk.heap_end = internal global i32* null
@_end = external global i32
define i32 @sbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32*, i32** @sbrk.heap_end
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32* @_end, i32** @sbrk.heap_end
br label %7
7: ; preds = %6, %1
%8 = load i32*, i32** @sbrk.heap_end
store i32* %8, i32** %3
%9 = load i32, i32* %2
%10 = load i32*, i32** @sbrk.heap_end
%11 = sext i32 %9 to i64
%12 = getelementptr inbounds i32, i32* %10, i64 %11
store i32* %12, i32** @sbrk.heap_end
%13 = load i32*, i32** %3
%14 = ptrtoint i32* %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@sbrk.heap_end = internal unnamed_addr global i32* null
@_end = external global i32
define i32 @sbrk(i32 %0) {
%2 = load i32*, i32** @sbrk.heap_end
%3 = icmp eq i32* %2, null
%4 = select i1 %3, i32* @_end, i32* %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %4, i64 %5
store i32* %6, i32** @sbrk.heap_end
%7 = ptrtoint i32* %4 to i64
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ agt_waitkey();
int /*<<< orphan*/ writeln(char *);
void wait_return(void) {
  writeln("          --- HIT ANY KEY ---");
  agt_waitkey();
}


x86 assembly (clang, -O0):
<wait_return>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <writeln@plt>
mov    $0x0,%al
call   1040 <agt_waitkey@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_return>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <writeln@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <agt_waitkey@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" --- HIT ANY KEY ---\00"
define void @wait_return() {
%1 = call i32 @writeln(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @agt_waitkey()
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c" --- HIT ANY KEY ---\00"
define void @wait_return() {
%1 = tail call i32 @writeln(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @agt_waitkey()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void p(void) { printf("hhh\n"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"hhh\0A\00"
define void @p() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"hhh\00"
define void @p() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret void
}
void emit_value_definition(struct processor_explicatory_state *process_state,
                           struct modern_stream *stream, void *stream_state,
                           struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_value_definition>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_value_definition(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_value_definition(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
SP_CASE(imacro, imetamacro_foreach_concat) {
  int i1 = 1, i2 = 2, i3 = 3;
  int i = i1 - i2 - i3;
  SP_TRUE(i == -4);
}


x86 assembly (clang, -O0):
<SP_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0xfffffffc,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <SP_TRUE@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SP_CASE>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <SP_TRUE@plt>

LLVM IR (-O0):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 1, i32* %6
store i32 2, i32* %7
store i32 3, i32* %8
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = sub nsw i32 %10, %11
%13 = load i32, i32* %8
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp eq i32 %15, -4
%17 = zext i1 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 %17)
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @SP_CASE(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @SP_TRUE to i32 (i32, ...)*)(i32 1)
ret i32 undef
}
int main(int argc, char *argv[]) {
  int b = 1;
  int a = 1 / (b - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
%8 = load i32, i32* %6
%9 = sub nsw i32 %8, 1
%10 = sdiv i32 1, %9
store i32 %10, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mpl115a2_read_data(void *, float *, float *);
float mpl115a2_temperature(void *_s) {
  float t, p;
  mpl115a2_read_data(_s, &t, &p);
  return t;
}


x86 assembly (clang, -O0):
<mpl115a2_temperature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <mpl115a2_read_data@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpl115a2_temperature>:
push   %rax
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1030 <mpl115a2_read_data@plt>
movss  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mpl115a2_temperature(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca float
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @mpl115a2_read_data(i8* %5, float* %3, float* %4)
%7 = load float, float* %3
ret float %7
}

LLVM IR (-O2):
define float @mpl115a2_temperature(i8* %0) {
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %2 to i8*
%5 = bitcast float* %3 to i8*
%6 = call i32 @mpl115a2_read_data(i8* %0, float* %2, float* %3)
%7 = load float, float* %2
ret float %7
}
/* Variables and functions */
char fgetc(unsigned int);
int fscan_udecimal(unsigned int);
int fscan_decimal(unsigned f) {
  int sign;
  char c;
  c = fgetc(f);
  if (c == '-') {
    sign = -1;
  } else if (c == '+') {
    sign = 1;
  } else {
    sign = 1;
  }
  return sign * fscan_udecimal(f);
}


x86 assembly (clang, -O0):
<fscan_decimal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fgetc@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x2d,%eax
jne    114f <fscan_decimal+0x2f>
movl   $0xffffffff,-0x8(%rbp)
jmp    1174 <fscan_decimal+0x54>
movsbl -0x9(%rbp),%eax
cmp    $0x2b,%eax
jne    1168 <fscan_decimal+0x48>
movl   $0x1,-0x8(%rbp)
jmp    116f <fscan_decimal+0x4f>
movl   $0x1,-0x8(%rbp)
jmp    1174 <fscan_decimal+0x54>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fscan_udecimal@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fscan_decimal>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <fscan_udecimal@plt>
mov    %eax,%ecx
neg    %ecx
cmp    $0x2d,%bpl
cmove  %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fscan_decimal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call signext i8 @fgetc(i32 %5)
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %3
br label %18
11: ; preds = %1
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 43
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %3
br label %17
16: ; preds = %11
store i32 1, i32* %3
br label %17
17: ; preds = %16, %15
br label %18
18: ; preds = %17, %10
%19 = load i32, i32* %3
%20 = load i32, i32* %2
%21 = call i32 @fscan_udecimal(i32 %20)
%22 = mul nsw i32 %19, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @fscan_decimal(i32 %0) {
%2 = tail call signext i8 @fgetc(i32 %0)
%3 = icmp eq i8 %2, 45
%4 = tail call i32 @fscan_udecimal(i32 %0)
%5 = sub nsw i32 0, %4
%6 = select i1 %3, i32 %5, i32 %4
ret i32 %6
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/);
void millisleep(int n) {
  struct timespec t;
  t.tv_sec = n / 1000;
  t.tv_nsec = (n % 1000) * 1000000;
  nanosleep(&t, 0);
}


x86 assembly (clang, -O0):
<millisleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0xf4240,%edx,%eax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millisleep>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @millisleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %5, i32* %6
%7 = load i32, i32* %2
%8 = srem i32 %7, 1000
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %3, i32 0)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @millisleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sdiv i32 %0, 1000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %4, i32* %5
%6 = srem i32 %0, 1000
%7 = mul nsw i32 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = call i32 @nanosleep(%struct.timespec* %2, i32 0)
ret void
}
/* Variables and functions */
int booster_statvfs64(char const *, void *);
int statvfs64(const char *pathname, void *buf) {
  return booster_statvfs64(pathname, buf);
}


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

x86 assembly (clang, -O2):
<statvfs64>:
jmp    1030 <booster_statvfs64@plt>

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

LLVM IR (-O2):
define i32 @statvfs64(i8* %0, i8* %1) {
%3 = tail call i32 @booster_statvfs64(i8* %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void WatchdogResetDisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000008))) &= ~(0x00000002);
}


x86 assembly (clang, -O0):
<WatchdogResetDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x8,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffffd,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WatchdogResetDisable>:
movslq %edi,%rax
andl   $0xfffffffd,0x8(%rax)
ret

LLVM IR (-O0):
define void @WatchdogResetDisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 8
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -3
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @WatchdogResetDisable(i32 %0) {
%2 = add nsw i32 %0, 8
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -3
store volatile i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, char const *argv[]) {
  int distance;
  float fuelTotal;
  scanf("%d", &distance);
  scanf("%f", &fuelTotal);
  float avgConsumption = distance / fuelTotal;
  printf("%.3f km/l\n", avgConsumption);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cvtsi2ssl -0x14(%rbp),%xmm0
divss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cvtsi2ssl 0x4(%rsp),%xmm0
divss  (%rsp),%xmm0
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%11 = load i32, i32* %6
%12 = sitofp i32 %11 to float
%13 = load float, float* %7
%14 = fdiv float %12, %13
store float %14, float* %8
%15 = load float, float* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [11 x i8] c"%.3f km/l\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca float
%5 = bitcast i32* %3 to i8*
%6 = bitcast float* %4 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to float
%11 = load float, float* %4
%12 = fdiv float %10, %11
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), float %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int /*<<< orphan*/ puts(char *);
unsigned int setbits(unsigned int, int /*<<< orphan*/, int, int);
int main() {
  unsigned x = 0;
  printf("x = %u\n", x);
  x = setbits(x, 0, 3, 4);
  printf("x = %u\n", x);
  if (x != 4) {
    puts("Error!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1050 <setbits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
cmpl   $0x4,-0x8(%rbp)
je     1191 <main+0x61>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <printf@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1050 <setbits@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cmp    $0x4,%ebp
je     1174 <main+0x44>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"x = %u\0A\00"
@.str.1 = [7 x i8] c"Error!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @setbits(i32 %5, i32 0, i32 3, i32 4)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %2
%10 = icmp ne i32 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"x = %u\0A\00"
@.str.1 = [7 x i8] c"Error!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @setbits(i32 0, i32 0, i32 3, i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp eq i32 %2, 4
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
double INT_MAX;
scalar_t__ rand();
double rand0a1() {
  double resultado = (double)rand() / INT_MAX;
  if (resultado > 1.0)
    resultado = 1.0;
  return resultado;
}


x86 assembly (clang, -O0):
<rand0a1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ebd(%rip),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1158 <rand0a1+0x48>
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand0a1>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm1
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm1
movsd  0xed0(%rip),%xmm0
minsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@INT_MAX = global double 0.000000e+00
define double @rand0a1() {
%1 = alloca double
%2 = call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load double, double* @INT_MAX
%5 = fdiv double %3, %4
store double %5, double* %1
%6 = load double, double* %1
%7 = fcmp ogt double %6, 1.000000e+00
br i1 %7, label %8, label %9
8: ; preds = %0
store double 1.000000e+00, double* %1
br label %9
9: ; preds = %8, %0
%10 = load double, double* %1
ret double %10
}

LLVM IR (-O2):
@INT_MAX = global double 0.000000e+00
define double @rand0a1() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @INT_MAX
%4 = fdiv double %2, %3
%5 = fcmp ogt double %4, 1.000000e+00
%6 = select i1 %5, double 1.000000e+00, double %4
ret double %6
}
int increment(int arg) { return arg + 1; }


x86 assembly (clang, -O0):
<increment>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @increment(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @increment(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int RZR2() { return 0; }


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

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

LLVM IR (-O0):
define i32 @RZR2() {
ret i32 0
}

LLVM IR (-O2):
define i32 @RZR2() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
unsigned long long rdtsc();
int main() {
  unsigned long long coldstart = 0;
  unsigned long long start = 0;
  unsigned long long end = 0;
  coldstart = rdtsc();
  start = rdtsc();
  end = rdtsc();
  printf("%llu", (end - start));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rdtsc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
sub    -0x10(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <rdtsc@plt>
xor    %eax,%eax
call   1040 <rdtsc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <rdtsc@plt>
sub    %rbx,%rax
lea    0xebd(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
store i64 0, i64* %1
store i64 0, i64* %2
store i64 0, i64* %3
%4 = call i64 (...) @rdtsc()
store i64 %4, i64* %1
%5 = call i64 (...) @rdtsc()
store i64 %5, i64* %2
%6 = call i64 (...) @rdtsc()
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = load i64, i64* %2
%9 = sub i64 %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i32 @main() {
%1 = tail call i64 (...) @rdtsc()
%2 = tail call i64 (...) @rdtsc()
%3 = tail call i64 (...) @rdtsc()
%4 = sub i64 %3, %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mmap_cat(char **);
int main(int argc, char *argv[]) {
  mmap_cat(argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @mmap_cat(i8** %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg) {
  if (errno) {
    perror(msg);
  } else {
    fprintf(stderr, "ERROR: %s\n", msg);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e95(%rip),%rax
cmpq   $0x0,(%rax)
je     115b <error+0x2b>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
jmp    1174 <error+0x44>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2e9d(%rip),%rax
cmpq   $0x0,(%rax)
je     1153 <error+0x23>
mov    %rdx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@errno = global i64 0
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @errno
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @perror(i8* %6)
br label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %8, %5
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@errno = global i64 0
@stderr = global i32 0
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @error(i8* %0) {
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %6, %4
%10 = tail call i32 @exit(i32 1)
unreachable
}
int txnstats_close() { return 0; }


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

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

LLVM IR (-O0):
define i32 @txnstats_close() {
ret i32 0
}

LLVM IR (-O2):
define i32 @txnstats_close() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int rc) {
  printf(("\nUsage:\n"
          " renice [-n] priority [-p|--pid] pid  [... pid]\n"
          " renice [-n] priority  -g|--pgrp pgrp [... pgrp]\n"
          " renice [-n] priority  -u|--user user [... user]\n"
          " renice -h | --help\n"
          " renice -v | --version\n\n"));
  exit(rc);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [199 x i8] c"\0AUsage:\0A renice [-n] priority [-p|--pid] pid [... pid]\0A renice [-n] priority -g|--pgrp pgrp [... pgrp]\0A renice [-n] priority -u|--user user [... user]\0A renice -h | --help\0A renice -v | --version\0A\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [198 x i8] c"\0AUsage:\0A renice [-n] priority [-p|--pid] pid [... pid]\0A renice [-n] priority -g|--pgrp pgrp [... pgrp]\0A renice [-n] priority -u|--user user [... user]\0A renice -h | --help\0A renice -v | --version\0A\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([198 x i8], [198 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}