xunge/DecIR huggingface dataset:
__attribute__((no, noclone)) int f8(int x) { return x > 0 ? x : ~x; }


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <f8+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <f8+0x25>
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f8>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
neg    %eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @f8(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = xor i32 %8, -1
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @f8(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = sext i1 %2 to i32
%4 = xor i32 %3, %0
ret i32 %4
}
int fun1049() { return 1049; }


x86 assembly (clang, -O0):
<fun1049>:
push   %rbp
mov    %rsp,%rbp
mov    $0x419,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun1049() {
ret i32 1049
}

LLVM IR (-O2):
define i32 @fun1049() {
ret i32 1049
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int if_wifi_client_is_connecting() {
  FILE *fp;
  int ret = 0;
  if ((fp = fopen("/tmp/wifi_client_is_connecting", "r")) != NULL) {
    ret = 1;
    fclose(fp);
  } else
    ret = 0;
  return ret;
}


x86 assembly (clang, -O0):
<if_wifi_client_is_connecting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xeca(%rip),%rdi
lea    0xee2(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1165 <if_wifi_client_is_connecting+0x45>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
jmp    116c <if_wifi_client_is_connecting+0x4c>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_wifi_client_is_connecting>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xef0(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1148 <if_wifi_client_is_connecting+0x28>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"/tmp/wifi_client_is_connecting\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @if_wifi_client_is_connecting() {
%1 = alloca i32*
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
store i32 1, i32* %2
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
br label %9
8: ; preds = %0
store i32 0, i32* %2
br label %9
9: ; preds = %8, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@.str = [31 x i8] c"/tmp/wifi_client_is_connecting\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @if_wifi_client_is_connecting() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fclose(i32* %1)
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
ret i32 %6
}
double __VERIFIER_nondet_double() {
  double val;
  return val;
}


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

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

LLVM IR (-O0):
define double @__VERIFIER_nondet_double() {
%1 = alloca double
%2 = load double, double* %1
ret double %2
}

LLVM IR (-O2):
define double @__VERIFIER_nondet_double() {
ret double undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_network_monitor_get_timeout(void *m, uint64_t *timeout_usec) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_network_monitor_get_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecb(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_network_monitor_get_timeout>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_network_monitor_get_timeout(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_network_monitor_get_timeout(i8* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("cl_icd.h standalone test PASSED.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"cl_icd.h standalone test PASSED.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"cl_icd.h standalone test PASSED.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xf7() {
  Assert_real((isalpha(247) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1240, ("isalpha should be 0 for 0xf7"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xf7>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf7,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4d8,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xf7>:
push   %rax
mov    $0xf7,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d8,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf7\00"
define void @t_isalpha_0xf7() {
%1 = call i64 @isalpha(i32 247)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xf7\00"
define void @t_isalpha_0xf7() {
%1 = tail call i64 @isalpha(i32 247)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1240, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kfree(char *);
void freerange(void *start, void *end) {
  char *page = (char *)((int)start & 0xFFFFF000);
  for (; (void *)page < end; page += 4 * 1024) {
    kfree(page);
  }
}


x86 assembly (clang, -O0):
<freerange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xfffff000,%eax
mov    %eax,%eax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1159 <freerange+0x49>
mov    -0x18(%rbp),%rdi
call   1030 <kfree@plt>
mov    -0x18(%rbp),%rax
add    $0x1000,%rax
mov    %rax,-0x18(%rbp)
jmp    112f <freerange+0x1f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freerange>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
and    $0xfffff000,%ebx
cmp    %rsi,%rbx
jae    1144 <freerange+0x34>
mov    %rsi,%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1030 <kfree@plt>
add    $0x1000,%rbx
cmp    %r14,%rbx
jb     1130 <freerange+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @freerange(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i32
%8 = and i32 %7, -4096
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %5
br label %11
11: ; preds = %18, %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %4
%14 = icmp ult i8* %12, %13
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8*, i8** %5
%17 = call i32 @kfree(i8* %16)
br label %18
18: ; preds = %15
%19 = load i8*, i8** %5
%20 = getelementptr inbounds i8, i8* %19, i64 4096
store i8* %20, i8** %5
br label %11
21: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @freerange(i8* %0, i8* readnone %1) {
%3 = ptrtoint i8* %0 to i64
%4 = and i64 %3, 4294963200
%5 = inttoptr i64 %4 to i8*
%6 = icmp ult i8* %5, %1
br i1 %6, label %7, label %12
7: ; preds = %2, %7
%8 = phi i8* [ %10, %7 ], [ %5, %2 ]
%9 = tail call i32 @kfree(i8* %8)
%10 = getelementptr inbounds i8, i8* %8, i64 4096
%11 = icmp ult i8* %10, %1
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret void
}
int main(int input) {
  int x, y;
  y = 0;
  x = 7;
  x = x + 1;
  while (input) {
    x = 7;
    x++;
    y++;
  }
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x7,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114d <main+0x4d>
movl   $0x7,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <main+0x25>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0) {
ret i32 8
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRD4_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRD4_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRD4_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
float Lerp(float t, float a, float b) { return a + t * (b - a); }


x86 assembly (clang, -O0):
<Lerp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
subss  -0x8(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lerp>:
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Lerp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = load float, float* %6
%10 = load float, float* %5
%11 = fsub float %9, %10
%12 = call float @llvm.fmuladd.f32(float %8, float %11, float %7)
ret float %12
}

LLVM IR (-O2):
define float @Lerp(float %0, float %1, float %2) {
%4 = fsub float %2, %1
%5 = tail call float @llvm.fmuladd.f32(float %0, float %4, float %1)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ winx();
scalar_t__ winy();
void checksize() {
  if (winy() < 0 || winx() < 0) {
    endwin();
    printf("Terminal size not supported.\n");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<checksize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <winy@plt>
cmp    $0x0,%rax
jl     1176 <checksize+0x26>
mov    $0x0,%al
call   1040 <winx@plt>
cmp    $0x0,%rax
jge    1197 <checksize+0x47>
mov    $0x0,%al
call   1050 <endwin@plt>
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<checksize>:
push   %rax
xor    %eax,%eax
call   1070 <winy@plt>
test   %rax,%rax
js     116b <checksize+0x1b>
xor    %eax,%eax
call   1040 <winx@plt>
test   %rax,%rax
js     116b <checksize+0x1b>
pop    %rax
ret
xor    %eax,%eax
call   1050 <endwin@plt>
lea    0xe87(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Terminal size not supported.\0A\00"
@EXIT_FAILURE = global i32 0
define void @checksize() {
%1 = call i64 (...) @winy()
%2 = icmp slt i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @winx()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %0
%7 = call i32 (...) @endwin()
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [29 x i8] c"Terminal size not supported.\00"
define void @checksize() {
%1 = tail call i64 (...) @winy()
%2 = icmp slt i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i64 (...) @winx()
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %0
%7 = tail call i32 (...) @endwin()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3
ret void
}
int fooinc(int x) {
  if (x)
    return 1025;
  else
    return 1026;
}


x86 assembly (clang, -O0):
<fooinc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <fooinc+0x1d>
movl   $0x401,-0x4(%rbp)
jmp    1124 <fooinc+0x24>
movl   $0x402,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooinc>:
cmp    $0x1,%edi
mov    $0x401,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @fooinc(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1025, i32* %2
br label %8
7: ; preds = %1
store i32 1026, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @fooinc(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1026, i32 1025
ret i32 %3
}
double get_wight(int current_gen, int max_gen) {
  double temp = 0.9 - ((double)current_gen / (double)max_gen) * 0.5;
  return temp;
}


x86 assembly (clang, -O0):
<get_wight>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xec9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_wight>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xeec(%rip),%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @get_wight(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %11, double 5.000000e-01, double 9.000000e-01)
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @get_wight(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fneg double %3
%6 = fdiv double %5, %4
%7 = tail call double @llvm.fmuladd.f64(double %6, double 5.000000e-01, double 9.000000e-01)
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ my_putnbr(int);
int main() {
  char *dest;
  my_putnbr(12345);
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3039,%edi
call   1030 <my_putnbr@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @my_putnbr(i32 12345)
ret i32 0
}
int test_imm_D2uint8_mem(unsigned char *val) {
  return ((*val) & (0xD2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -46
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *safe_malloc(size_t);
int strlen(char const *);
char *get_string_copy(const char *original) {
  size_t size;
  char *copy;
  size = strlen(original) + 1;
  copy = safe_malloc(size);
  memcpy(copy, original, size);
  return (copy);
}


x86 assembly (clang, -O0):
<get_string_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <safe_malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string_copy>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1030 <safe_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @get_string_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @safe_malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @get_string_copy(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @safe_malloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
void cdrcvt(in, iout) int *in, *iout;
{ *iout = *in; }


x86 assembly (clang, -O0):
<cdrcvt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdrcvt>:
mov    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @cdrcvt(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 = load i32, i32* %5
%7 = load i32*, i32** %4
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @cdrcvt(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
store i32 %3, i32* %1
ret void
}
int main() { return sizeof(short); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 2
}
int test_imm_63int16_reg(short val) {
  return ((val) & (-0x63 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_63int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_63int16_reg>:
test   $0xff9d,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63int16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -99
%6 = icmp ne i32 %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_63int16_reg(i16 signext %0) {
%2 = and i16 %0, -99
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ MRT0_DriverIRQHandler();
__attribute__((weak)) void MRT0_IRQHandler(void) { MRT0_DriverIRQHandler(); }


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

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

LLVM IR (-O0):
define weak void @MRT0_IRQHandler() {
%1 = call i32 (...) @MRT0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @MRT0_IRQHandler() {
%1 = tail call i32 (...) @MRT0_DriverIRQHandler()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int width;
  int height;
};
typedef TYPE_1__ XResizeRequestEvent;
typedef int /*<<< orphan*/ XEvent;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void do_ResizeRequest(XEvent *eventp) {
  XResizeRequestEvent *e = (XResizeRequestEvent *)eventp;
  printf("    width %d, height %d\n", e->width, e->height);
}


x86 assembly (clang, -O0):
<do_ResizeRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ResizeRequest>:
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32, i32 }
@.str = [25 x i8] c" width %d, height %d\0A\00"
define void @do_ResizeRequest(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_2__*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = bitcast i32* %4 to %struct.TYPE_2__*
store %struct.TYPE_2__* %5, %struct.TYPE_2__** %3
%6 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%7 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load %struct.TYPE_2__*, %struct.TYPE_2__** %3
%10 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %9, i32 0, i32 1
%11 = load i32, i32* %10
%12 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c" width %d, height %d\0A\00"
define void @do_ResizeRequest(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %4)
ret void
}
/* Variables and functions */
char __mriPlatform_CommReceiveChar();
int didHostSendGdbAckChar(void) {
  return ('+' == __mriPlatform_CommReceiveChar());
}


x86 assembly (clang, -O0):
<didHostSendGdbAckChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <__mriPlatform_CommReceiveChar@plt>
movsbl %al,%ecx
mov    $0x2b,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<didHostSendGdbAckChar>:
push   %rax
xor    %eax,%eax
call   1030 <__mriPlatform_CommReceiveChar@plt>
xor    %ecx,%ecx
cmp    $0x2b,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @didHostSendGdbAckChar() {
%1 = call signext i8 (...) @__mriPlatform_CommReceiveChar()
%2 = sext i8 %1 to i32
%3 = icmp eq i32 43, %2
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @didHostSendGdbAckChar() {
%1 = tail call signext i8 (...) @__mriPlatform_CommReceiveChar()
%2 = icmp eq i8 %1, 43
%3 = zext i1 %2 to i32
ret i32 %3
}
extern int testandset(int *spinlock) {
  int ret;
  __asm__ __volatile__("xchgl %0, %1"
                       : "=r"(ret), "=m"(*spinlock)
                       : "0"(1), "m"(*spinlock)
                       : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<testandset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x8(%rbp),%rdx
mov    $0x1,%eax
xchg   %eax,(%rcx)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testandset>:
mov    $0x1,%eax
xchg   %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @testandset(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 asm sideeffect "xchgl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4, i32 1, i32* elementtype(i32) %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @testandset(i32* %0) {
%2 = tail call i32 asm sideeffect "xchgl $0, $1", "=r,=*m,0,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 1, i32* elementtype(i32) %0)
ret i32 %2
}
struct block *gen_greater(n)
int n;
{ return gen_len(0x30, n); }


x86 assembly (clang, -O0):
<gen_greater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x30,%edi
mov    $0x0,%al
call   1030 <gen_len@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_greater>:
push   %rax
mov    %edi,%esi
mov    $0x30,%edi
xor    %eax,%eax
call   1030 <gen_len@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.block = type opaque
define %struct.block* @gen_greater(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @gen_len to i32 (i32, i32, ...)*)(i32 48, i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to %struct.block*
ret %struct.block* %6
}

LLVM IR (-O2):
%struct.block = type opaque
define %struct.block* @gen_greater(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @gen_len to i32 (i32, i32, ...)*)(i32 48, i32 %0)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to %struct.block*
ret %struct.block* %4
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ height;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xgraphicsexpose_height(void *_p) {
  return (int)((XEvent *)_p)->xgraphicsexpose.height;
}


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

x86 assembly (clang, -O2):
<get_XEvent_xgraphicsexpose_height>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xgraphicsexpose_height(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xgraphicsexpose_height(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
char *AdmAccept(char *pt) {
  while (*pt && (*pt != ' ' && *pt != '\t'))
    pt++;
  return pt;
}


x86 assembly (clang, -O0):
<AdmAccept>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <AdmAccept+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0xa(%rbp)
je     1142 <AdmAccept+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <AdmAccept+0x58>
jmp    1169 <AdmAccept+0x69>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <AdmAccept+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdmAccept>:
mov    %rdi,%rax
movabs $0x100000201,%rcx
jmp    1114 <AdmAccept+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <AdmAccept+0x10>
bt     %rdx,%rcx
jae    1110 <AdmAccept+0x10>
ret

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

LLVM IR (-O2):
define i8* @AdmAccept(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ hexchar(unsigned char);
int /*<<< orphan*/ putch(int /*<<< orphan*/);
void printhex(unsigned char c) {
  putch(hexchar(c >> 4));
  putch(hexchar(c));
}


x86 assembly (clang, -O0):
<printhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1030 <hexchar@plt>
mov    %eax,%edi
call   1040 <putch@plt>
movzbl -0x1(%rbp),%edi
call   1030 <hexchar@plt>
mov    %eax,%edi
call   1040 <putch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhex>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <hexchar@plt>
mov    %eax,%edi
call   1040 <putch@plt>
mov    %ebx,%edi
call   1030 <hexchar@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <putch@plt>

LLVM IR (-O0):
define void @printhex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = trunc i32 %5 to i8
%7 = call i32 @hexchar(i8 zeroext %6)
%8 = call i32 @putch(i32 %7)
%9 = load i8, i8* %2
%10 = call i32 @hexchar(i8 zeroext %9)
%11 = call i32 @putch(i32 %10)
ret void
}

LLVM IR (-O2):
define void @printhex(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @hexchar(i8 zeroext %2)
%4 = tail call i32 @putch(i32 %3)
%5 = tail call i32 @hexchar(i8 zeroext %0)
%6 = tail call i32 @putch(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x73() {
  Assert_real((iscntrl(115) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              580, ("iscntrl should be 0 for s"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x73>:
push   %rbp
mov    %rsp,%rbp
mov    $0x73,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x244,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x73>:
push   %rax
mov    $0x73,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x244,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for s\00"
define void @t_iscntrl_0x73() {
%1 = call i64 @iscntrl(i32 115)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for s\00"
define void @t_iscntrl_0x73() {
%1 = tail call i64 @iscntrl(i32 115)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 580, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strlen(char *);
bool isValidID(char *pID) {
  bool isValid = false;
  int length = strlen(pID);
  if (0 <= length && 32 > length) {
    isValid = true;
  }
  return isValid;
}


x86 assembly (clang, -O0):
<isValidID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jg     114f <isValidID+0x3f>
mov    $0x20,%eax
cmp    -0x10(%rbp),%eax
jle    114f <isValidID+0x3f>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidID>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x20,%eax
setb   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isValidID(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sle i32 0, %7
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp sgt i32 32, %10
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1, i32* %3
br label %13
13: ; preds = %12, %9, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @isValidID(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp ult i32 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init_central();
void main(void) { (void)init_central(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @init_central()
ret void
}
/* Variables and functions */
int implicitSignChange(unsigned int);
int main(int argc, char **argv) { return implicitSignChange(~0U); }


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    $0xffffffff,%edi
call   1030 <implicitSignChange@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0xffffffff,%edi
jmp    1030 <implicitSignChange@plt>

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 = call i32 @implicitSignChange(i32 -1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @implicitSignChange(i32 -1)
ret i32 %3
}
OP(ed, fe) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void BlinkNoTimerTaskC$Leds$led1On(void) { LedsP$Leds$led1On(); }


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

x86 assembly (clang, -O2):
<BlinkNoTimerTaskC$Leds$led1On>:
xor    %eax,%eax
jmp    1030 <LedsP$Leds$led1On@plt>

LLVM IR (-O0):
define void @"BlinkNoTimerTaskC$Leds$led1On"() {
%1 = call i32 (...) @"LedsP$Leds$led1On"()
ret void
}

LLVM IR (-O2):
define void @"BlinkNoTimerTaskC$Leds$led1On"() {
%1 = tail call i32 (...) @"LedsP$Leds$led1On"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void die_if(int t) {
  if (t)
    abort();
}


x86 assembly (clang, -O0):
<die_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     112c <die_if+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_if>:
test   %edi,%edi
jne    1115 <die_if+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @die_if(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @die_if(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *);
int ok(int rc, const char *message) {
  static int count = 0;
  count++;
  if (rc) {
    printf("ok %d - %s\n", count, message);
  } else {
    printf("not ok %d - %s\n", count, message);
  }
  return rc;
}


x86 assembly (clang, -O0):
<ok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2f07(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2efe(%rip)
cmpl   $0x0,-0x4(%rbp)
je     1153 <ok+0x43>
mov    0x2eee(%rip),%esi
mov    -0x10(%rbp),%rdx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    1169 <ok+0x59>
mov    0x2ed3(%rip),%esi
mov    -0x10(%rbp),%rdx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ok>:
push   %rbx
mov    %rsi,%rdx
mov    %edi,%ebx
mov    0x2f10(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2f07(%rip)
test   %edi,%edi
lea    0xed2(%rip),%rax
lea    0xecf(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ok.count = internal global i32 0
@.str = [12 x i8] c"ok %d - %s\0A\00"
@.str.1 = [16 x i8] c"not ok %d - %s\0A\00"
define i32 @ok(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ok.count
%6 = add nsw i32 %5, 1
store i32 %6, i32* @ok.count
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @ok.count
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11)
br label %17
13: ; preds = %2
%14 = load i32, i32* @ok.count
%15 = load i8*, i8** %4
%16 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32 %14, i8* %15)
br label %17
17: ; preds = %13, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@ok.count = internal unnamed_addr global i32 0
@.str = [12 x i8] c"ok %d - %s\0A\00"
@.str.1 = [16 x i8] c"not ok %d - %s\0A\00"
define i32 @ok(i32 returned %0, i8* %1) {
%3 = load i32, i32* @ok.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @ok.count
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %4, i8* %1)
ret i32 %0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ descent;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
int get_XFontStruct_descent(void *_p) {
  return (int)((XFontStruct *)_p)->descent;
}


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

x86 assembly (clang, -O2):
<get_XFontStruct_descent>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XFontStruct_descent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XFontStruct_descent(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x82() {
  Assert_real((isgraph(130) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              655, ("isgraph should be 0 for 0x82"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x82>:
push   %rbp
mov    %rsp,%rbp
mov    $0x82,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x28f,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x82>:
push   %rax
mov    $0x82,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x28f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x82\00"
define void @t_isgraph_0x82() {
%1 = call i64 @isgraph(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x82\00"
define void @t_isgraph_0x82() {
%1 = tail call i64 @isgraph(i32 130)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 655, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}