xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ overlap(void *, void *, size_t);
int /*<<< orphan*/ printf(char *);
void verify_overlap2(void *r1, void *r2, size_t len) {
  if (overlap(r1, r2, len)) {
    printf("Memory regions overlap!\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<verify_overlap2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <overlap@plt>
cmp    $0x0,%rax
je     1175 <verify_overlap2+0x45>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_overlap2>:
push   %rax
call   1040 <overlap@plt>
test   %rax,%rax
jne    113d <verify_overlap2+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Memory regions overlap!\0A\00"
define void @verify_overlap2(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i64 @overlap(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Memory regions overlap!\00"
define void @verify_overlap2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @overlap(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
int MOVE(int sqSrc, int sqDst) { return sqSrc + sqDst * 256; }


x86 assembly (clang, -O0):
<MOVE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MOVE>:
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @MOVE(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* %4
%7 = mul nsw i32 %6, 256
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @MOVE(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 8
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long long tv_usec;
};

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


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %9, %7
ret i64 %10
}
/* Variables and functions */
int fib(int);
int main() { return fib(8); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fib(i32 8)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ __pid_t;

/* Variables and functions */
int /*<<< orphan*/ WAIT_ANY;
int /*<<< orphan*/ __waitpid(int /*<<< orphan*/, int *, int /*<<< orphan*/);
__pid_t __libc_wait(int *stat_loc) {
  return __waitpid(WAIT_ANY, (int *)stat_loc, 0);
}


x86 assembly (clang, -O0):
<__libc_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
xor    %edx,%edx
call   1030 <__waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_wait>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
jmp    1030 <__waitpid@plt>

LLVM IR (-O0):
@WAIT_ANY = global i32 0
define i32 @__libc_wait(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @WAIT_ANY
%4 = load i32*, i32** %2
%5 = call i32 @__waitpid(i32 %3, i32* %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@WAIT_ANY = global i32 0
define i32 @__libc_wait(i32* %0) {
%2 = load i32, i32* @WAIT_ANY
%3 = tail call i32 @__waitpid(i32 %2, i32* %0, i32 0)
ret i32 %3
}
void ft_strreplace(char *s, char search, char replace) {
  while (*s != '\0') {
    if (*s == search)
      *s = replace;
    s++;
  }
}


x86 assembly (clang, -O0):
<ft_strreplace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <ft_strreplace+0x50>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113f <ft_strreplace+0x3f>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <ft_strreplace+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strreplace>:
mov    (%rdi),%al
test   %al,%al
je     1125 <ft_strreplace+0x25>
add    $0x1,%rdi
jmp    111b <ft_strreplace+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <ft_strreplace+0x25>
cmp    %sil,%al
jne    1110 <ft_strreplace+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <ft_strreplace+0x10>
ret

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

LLVM IR (-O2):
define void @ft_strreplace(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
void cambio(char aux[50]) {
  int i, temp = 0;
  for (i = 0; i < 100 && temp == 0; i++) {
    if (aux[i] == '\n') {
      aux[i] = '\0';
      temp = 1;
    }
  }
}


x86 assembly (clang, -O0):
<cambio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x64,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jge    112f <cambio+0x2f>
cmpl   $0x0,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113f <cambio+0x3f>
jmp    117a <cambio+0x7a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1167 <cambio+0x67>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x1,-0x10(%rbp)
jmp    116c <cambio+0x6c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <cambio+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cambio>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
cmp    $0xa,%cl
je     1129 <cambio+0x29>
je     1128 <cambio+0x28>
lea    0x1(%rax),%rcx
cmp    $0x63,%rax
mov    %rcx,%rax
jb     1110 <cambio+0x10>
ret
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @cambio(i8* nocapture %0) {
br label %2
2: ; preds = %1, %9
%3 = phi i64 [ 0, %1 ], [ %10, %9 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %8
br label %13
9: ; preds = %2
%10 = add nuw nsw i64 %3, 1
%11 = icmp ugt i64 %3, 98
%12 = or i1 %6, %11
br i1 %12, label %13, label %2
13: ; preds = %9, %7
ret void
}
void may_over_or_underrun_symbolic_Nowarn_Good(int n) {
  int a[10];
  a[n] = 0;
}


x86 assembly (clang, -O0):
<may_over_or_underrun_symbolic_Nowarn_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movl   $0x0,-0x30(%rbp,%rax,4)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @may_over_or_underrun_symbolic_Nowarn_Good(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 %5
store i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @may_over_or_underrun_symbolic_Nowarn_Good(i32 %0) {
ret void
}
/* Variables and functions */
double RAND_MAX;
float rand();
int randint(float max) {
  return ((1 + (int)(max * rand() / (RAND_MAX + 1.0))));
}


x86 assembly (clang, -O0):
<randint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
mov    0x2e9b(%rip),%rax
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randint>:
push   %rax
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mulss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    0x2eb9(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float (...) @rand()
%5 = fmul float %3, %4
%6 = fpext float %5 to double
%7 = load double, double* @RAND_MAX
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double %6, %8
%10 = fptosi double %9 to i32
%11 = add nsw i32 1, %10
ret i32 %11
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i32 @randint(float %0) {
%2 = tail call float (...) @rand()
%3 = fmul float %2, %0
%4 = fpext float %3 to double
%5 = load double, double* @RAND_MAX
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
%8 = fptosi double %7 to i32
%9 = add nsw i32 %8, 1
ret i32 %9
}
/* Variables and functions */
int const rand();
int randNum(const int min, const int max) {
  return rand() % (max - min + 1) + min;
}


x86 assembly (clang, -O0):
<randNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randNum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randNum(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @randNum(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int scr_init(char *);
int wrap_scr_init(char *filename) { return scr_init(filename); }


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

x86 assembly (clang, -O2):
<wrap_scr_init>:
jmp    1030 <scr_init@plt>

LLVM IR (-O0):
define i32 @wrap_scr_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @scr_init(i8* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @wrap_scr_init(i8* %0) {
%2 = tail call i32 @scr_init(i8* %0)
ret i32 %2
}
/* Variables and functions */
int cardEepromGetSize();
int /*<<< orphan*/ cardEepromSectorErase(int);
void cardEepromChipErase(void) {
  int sz, sector;
  sz = cardEepromGetSize();
  for (sector = 0; sector < sz; sector += 0x10000) {
    cardEepromSectorErase(sector);
  }
}


x86 assembly (clang, -O0):
<cardEepromChipErase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <cardEepromGetSize@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115d <cardEepromChipErase+0x3d>
mov    -0x8(%rbp),%edi
call   1030 <cardEepromSectorErase@plt>
mov    -0x8(%rbp),%eax
add    $0x10000,%eax
mov    %eax,-0x8(%rbp)
jmp    1139 <cardEepromChipErase+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cardEepromChipErase>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <cardEepromGetSize@plt>
test   %eax,%eax
jle    1151 <cardEepromChipErase+0x31>
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <cardEepromSectorErase@plt>
add    $0x10000,%ebx
cmp    %ebp,%ebx
jl     1140 <cardEepromChipErase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @cardEepromChipErase() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @cardEepromGetSize()
store i32 %3, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @cardEepromSectorErase(i32 %9)
br label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 65536
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @cardEepromChipErase() {
%1 = tail call i32 (...) @cardEepromGetSize()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ 0, %0 ]
%5 = tail call i32 @cardEepromSectorErase(i32 %4)
%6 = add nuw nsw i32 %4, 65536
%7 = icmp slt i32 %6, %1
br i1 %7, label %3, label %8
8: ; preds = %3, %0
ret void
}
unsigned ucwrs2(unsigned _k) {
  ;
  return _k + (_k - 1);
}


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

x86 assembly (clang, -O2):
<ucwrs2>:
lea    (%rdi,%rdi,1),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @ucwrs2(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, -1
ret i32 %3
}
/* Variables and functions */
scalar_t__ calloc(unsigned int, int);
int /*<<< orphan*/ strncat(char *, char *, unsigned int);
char *createtoken(unsigned int size, char *from) {
  char *nt;
  nt = (char *)calloc(size, sizeof(char));
  strncat(nt, from, size - 1);
  return nt;
}


x86 assembly (clang, -O0):
<createtoken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createtoken>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
add    $0xffffffff,%ebp
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1030 <strncat@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @createtoken(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i64 @calloc(i32 %6, i32 1)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = load i32, i32* %3
%12 = sub i32 %11, 1
%13 = call i32 @strncat(i8* %9, i8* %10, i32 %12)
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @createtoken(i32 %0, i8* %1) {
%3 = tail call i64 @calloc(i32 %0, i32 1)
%4 = inttoptr i64 %3 to i8*
%5 = add i32 %0, -1
%6 = tail call i32 @strncat(i8* %4, i8* %1, i32 %5)
ret i8* %4
}
void USERNOTICE_new(void) {}


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

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

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

LLVM IR (-O2):
define void @USERNOTICE_new() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void double_init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<double_init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_FLAT = global i32 0
define void @double_init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_FLAT = global i32 0
define void @double_init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ cpu_set_t;
typedef int /*<<< orphan*/ cpu;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ perror(char *);
scalar_t__ sched_setaffinity(int /*<<< orphan*/, int, int /*<<< orphan*/ *);
void iso_proc_cpu(void) {
  pid_t pid = getpid();
  cpu_set_t cpu;
  CPU_ZERO(&cpu);
  CPU_SET(0, &cpu);
  if (sched_setaffinity(pid, sizeof(cpu), &cpu) < 0)
    perror("sched_setaffinity");
}


x86 assembly (clang, -O0):
<iso_proc_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <CPU_ZERO@plt>
xor    %edi,%edi
lea    -0x8(%rbp),%rsi
call   1070 <CPU_SET@plt>
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
lea    -0x8(%rbp),%rdx
call   1040 <sched_setaffinity@plt>
cmp    $0x0,%rax
jge    119d <iso_proc_cpu+0x4d>
lea    0xe68(%rip),%rdi
call   1060 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_proc_cpu>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1050 <CPU_ZERO@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1070 <CPU_SET@plt>
mov    %ebx,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1040 <sched_setaffinity@plt>
test   %rax,%rax
js     1190 <iso_proc_cpu+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe69(%rip),%rdi
call   1060 <perror@plt>
jmp    1188 <iso_proc_cpu+0x38>

LLVM IR (-O0):
@.str = [18 x i8] c"sched_setaffinity\00"
define void @iso_proc_cpu() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getpid()
store i32 %3, i32* %1
%4 = call i32 @CPU_ZERO(i32* %2)
%5 = call i32 @CPU_SET(i32 0, i32* %2)
%6 = load i32, i32* %1
%7 = call i64 @sched_setaffinity(i32 %6, i32 4, i32* %2)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"sched_setaffinity\00"
define void @iso_proc_cpu() {
%1 = alloca i32
%2 = tail call i32 (...) @getpid()
%3 = bitcast i32* %1 to i8*
%4 = call i32 @CPU_ZERO(i32* %1)
%5 = call i32 @CPU_SET(i32 0, i32* %1)
%6 = call i64 @sched_setaffinity(i32 %2, i32 4, i32* %1)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret void
}
void gtk_radio_action_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_action_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int sz;
  scanf("%d", &sz);
  char buf[sz];
  gets(buf);
  printf(buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x20(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1040 <gets@plt>
mov    -0x20(%rbp),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xebe(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    %rsp,%r14
mov    -0x14(%rbp),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r14,%rsp
xor    %eax,%eax
lea    -0x10(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = call i32 @gets(i8* %9)
%11 = call i32 @printf(i8* %9)
store i32 0, i32* %1
%12 = load i8*, i8** %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = zext i32 %4 to i64
%6 = call i8* @llvm.stacksave()
%7 = alloca i8, i64 %5
%8 = call i32 @gets(i8* %7)
%9 = call i32 @printf(i8* %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xa0() {
  Assert_real((isodigit(160) == 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_isodigit.c",
              805, ("isodigit should be 0 for 0xa0"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0xa0>:
push   %rax
mov    $0xa0,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x325,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa0\00"
define void @t_isodigit_0xa0() {
%1 = call i64 @isodigit(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xa0\00"
define void @t_isodigit_0xa0() {
%1 = tail call i64 @isodigit(i32 160)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 805, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int check_presence(int check, int *arr, int size) {
  int j;
  int flag;
  for (j = 0; j < size; j++) {
    if (check == arr[j]) {
      flag = 1;
      break;
    } else
      flag = 0;
  }
  return flag;
}


x86 assembly (clang, -O0):
<check_presence>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <check_presence+0x5b>
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1141 <check_presence+0x41>
movl   $0x1,-0x1c(%rbp)
jmp    115b <check_presence+0x5b>
movl   $0x0,-0x1c(%rbp)
jmp    114d <check_presence+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <check_presence+0x15>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_presence>:
test   %edx,%edx
jle    111e <check_presence+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <check_presence+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <check_presence+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_presence(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %7, %9, %3
%16 = phi i32 [ 0, %3 ], [ 1, %9 ], [ 0, %7 ]
ret i32 %16
}
void isr_busfault(void) {
  while (1)
    ;
  ;
}


x86 assembly (clang, -O0):
<isr_busfault>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <isr_busfault+0x9>
jmp    1109 <isr_busfault+0x9>

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

LLVM IR (-O0):
define void @isr_busfault() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @isr_busfault() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ decompose(scalar_t__ const, scalar_t__ *);
scalar_t__ const freeze(scalar_t__ const);
unsigned int make_hint(const uint32_t a, const uint32_t b) {
  uint32_t t;
  return decompose(a, &t) != decompose(freeze(a + b), &t);
}


x86 assembly (clang, -O0):
<make_hint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <decompose@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
call   1030 <freeze@plt>
mov    %rax,%rdi
lea    -0x18(%rbp),%rsi
call   1040 <decompose@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_hint>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsp,%r15
mov    %r15,%rsi
call   1040 <decompose@plt>
mov    %rax,%r12
add    %r14,%rbx
mov    %rbx,%rdi
call   1030 <freeze@plt>
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <decompose@plt>
xor    %ecx,%ecx
cmp    %rax,%r12
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @make_hint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i64 @decompose(i64 %6, i64* %5)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = add nsw i64 %8, %9
%11 = call i64 @freeze(i64 %10)
%12 = call i64 @decompose(i64 %11, i64* %5)
%13 = icmp ne i64 %7, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @make_hint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i64 @decompose(i64 %0, i64* %3)
%6 = add nsw i64 %1, %0
%7 = call i64 @freeze(i64 %6)
%8 = call i64 @decompose(i64 %7, i64* %3)
%9 = icmp ne i64 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int yas_bma250_read_reg_byte(int);
int yas_bma250_write_reg_byte(int, int);
int yas_bma250_set_offset_target_x(unsigned char data) {
  int ret = 0;
  int reg_data = 0;
  reg_data = yas_bma250_read_reg_byte(0x37);
  reg_data = ((reg_data & ~0x06) | ((data << 1) & 0x06));
  ret = yas_bma250_write_reg_byte(0x37, reg_data);
  return ret;
}


x86 assembly (clang, -O0):
<yas_bma250_set_offset_target_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x37,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffff9,%eax
movzbl -0x1(%rbp),%ecx
shl    $0x1,%ecx
and    $0x6,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x37,%edi
call   1030 <yas_bma250_write_reg_byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma250_set_offset_target_x>:
push   %rbx
mov    %edi,%ebx
mov    $0x37,%edi
call   1040 <yas_bma250_read_reg_byte@plt>
and    $0xfffffff9,%eax
and    $0x3,%ebx
lea    (%rax,%rbx,2),%esi
mov    $0x37,%edi
pop    %rbx
jmp    1030 <yas_bma250_write_reg_byte@plt>

LLVM IR (-O0):
define i32 @yas_bma250_set_offset_target_x(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
store i32 0, i32* %4
%5 = call i32 @yas_bma250_read_reg_byte(i32 55)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, -7
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 1
%11 = and i32 %10, 6
%12 = or i32 %7, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @yas_bma250_write_reg_byte(i32 55, i32 %13)
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @yas_bma250_set_offset_target_x(i8 zeroext %0) {
%2 = tail call i32 @yas_bma250_read_reg_byte(i32 55)
%3 = and i32 %2, -7
%4 = zext i8 %0 to i32
%5 = shl nuw nsw i32 %4, 1
%6 = and i32 %5, 6
%7 = or i32 %3, %6
%8 = tail call i32 @yas_bma250_write_reg_byte(i32 55, i32 %7)
ret i32 %8
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
typedef int /*<<< orphan*/ path_stat;
typedef int int32_t;

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct stat *, int /*<<< orphan*/, int);
int /*<<< orphan*/ stat(char const *, struct stat *);
int32_t mz_os_is_dir(const char *path) {
  struct stat path_stat;
  memset(&path_stat, 0, sizeof(path_stat));
  stat(path, &path_stat);
  if (S_ISDIR(path_stat.st_mode))
    return (0);
  return (-107);
}


x86 assembly (clang, -O0):
<mz_os_is_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <stat@plt>
mov    -0x18(%rbp),%edi
call   1030 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1177 <mz_os_is_dir+0x47>
movl   $0x0,-0x4(%rbp)
jmp    117e <mz_os_is_dir+0x4e>
movl   $0xffffff95,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_os_is_dir>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0x8(%rsp),%r14
xor    %ebp,%ebp
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <stat@plt>
mov    0x8(%rsp),%edi
call   1030 <S_ISDIR@plt>
test   %rax,%rax
mov    $0xffffff95,%eax
cmovne %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @mz_os_is_dir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = call i32 @memset(%struct.stat* %4, i32 0, i32 4)
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
%8 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISDIR(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %14
13: ; preds = %1
store i32 -107, i32* %2
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @mz_os_is_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @memset(%struct.stat* %2, i32 0, i32 4)
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = call i64 @S_ISDIR(i32 %7)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i32 -107, i32 0
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void custom_module_exit(void) { printk("custom_module_exit called!\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"custom_module_exit called!\0A\00"
define void @custom_module_exit() {
%1 = call i32 @printk(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"custom_module_exit called!\0A\00"
define void @custom_module_exit() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
short xor_h(short *, short *);
short intr_wrap_533(short p1, short p2) { return xor_h(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_533>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <xor_h@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_533>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <xor_h@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_533(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @xor_h(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_533(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @xor_h(i16* %3, i16* %4)
ret i16 %5
}
int is_close(a, b, delta)
short a, b, delta;
{
  int result = 0;
  short diff;
  diff = a - b;
  if (diff < 0)
    diff = diff * (-1);
  if (diff < delta)
    result = 1;
  return (result);
}


x86 assembly (clang, -O0):
<is_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edx,%eax
mov    %di,%dx
mov    %si,%cx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movl   $0x0,-0xc(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%eax
cmp    $0x0,%eax
jge    1145 <is_close+0x45>
movswl -0xe(%rbp),%eax
imul   $0xffffffff,%eax,%eax
mov    %ax,-0xe(%rbp)
movswl -0xe(%rbp),%eax
movswl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    115c <is_close+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_close>:
sub    %esi,%edi
mov    %edi,%ecx
neg    %ecx
test   $0x8000,%edi
cmove  %edi,%ecx
shl    $0x10,%ecx
shl    $0x10,%edx
xor    %eax,%eax
cmp    %edx,%ecx
setl   %al
ret

LLVM IR (-O0):
define i32 @is_close(i32 %0, i32 %1, i32 %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca i32
%8 = alloca i16
%9 = trunc i32 %0 to i16
%10 = trunc i32 %1 to i16
%11 = trunc i32 %2 to i16
store i16 %9, i16* %4
store i16 %10, i16* %5
store i16 %11, i16* %6
store i32 0, i32* %7
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = load i16, i16* %5
%15 = sext i16 %14 to i32
%16 = sub nsw i32 %13, %15
%17 = trunc i32 %16 to i16
store i16 %17, i16* %8
%18 = load i16, i16* %8
%19 = sext i16 %18 to i32
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %3
%22 = load i16, i16* %8
%23 = sext i16 %22 to i32
%24 = mul nsw i32 %23, -1
%25 = trunc i32 %24 to i16
store i16 %25, i16* %8
br label %26
26: ; preds = %21, %3
%27 = load i16, i16* %8
%28 = sext i16 %27 to i32
%29 = load i16, i16* %6
%30 = sext i16 %29 to i32
%31 = icmp slt i32 %28, %30
br i1 %31, label %32, label %33
32: ; preds = %26
store i32 1, i32* %7
br label %33
33: ; preds = %32, %26
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @is_close(i32 %0, i32 %1, i32 %2) {
%4 = sub i32 %0, %1
%5 = and i32 %4, 32768
%6 = icmp eq i32 %5, 0
%7 = sub i32 0, %4
%8 = select i1 %6, i32 %4, i32 %7
%9 = shl i32 %8, 16
%10 = shl i32 %2, 16
%11 = icmp slt i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int _echo(int argc, char *argv[]) { return 0; }


x86 assembly (clang, -O0):
<_echo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @_echo(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @_echo(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ st103_ep_set_rx_status(int, int);
void usb_lld_rx_enable(int ep_num) { st103_ep_set_rx_status(ep_num, (0x3000)); }


x86 assembly (clang, -O0):
<usb_lld_rx_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3000,%esi
call   1030 <st103_ep_set_rx_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_lld_rx_enable>:
mov    $0x3000,%esi
jmp    1030 <st103_ep_set_rx_status@plt>

LLVM IR (-O0):
define void @usb_lld_rx_enable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @st103_ep_set_rx_status(i32 %3, i32 12288)
ret void
}

LLVM IR (-O2):
define void @usb_lld_rx_enable(i32 %0) {
%2 = tail call i32 @st103_ep_set_rx_status(i32 %0, i32 12288)
ret void
}
int bytesToInt(unsigned char *bytes, int size) {
  int addr = bytes[0] & 0xFF;
  addr |= ((bytes[1] << 8) & 0xFF00);
  addr |= ((bytes[2] << 16) & 0xFF0000);
  addr |= ((bytes[3] << 24) & 0xFF000000);
  return addr;
}


x86 assembly (clang, -O0):
<bytesToInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
and    $0xff00,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
and    $0xff0000,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bytesToInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = and i32 %9, 255
store i32 %10, i32* %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = shl i32 %14, 8
%16 = and i32 %15, 65280
%17 = load i32, i32* %5
%18 = or i32 %17, %16
store i32 %18, i32* %5
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 2
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 16
%24 = and i32 %23, 16711680
%25 = load i32, i32* %5
%26 = or i32 %25, %24
store i32 %26, i32* %5
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 3
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 24
%32 = and i32 %31, -16777216
%33 = load i32, i32* %5
%34 = or i32 %33, %32
store i32 %34, i32* %5
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @bytesToInt(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 8
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 16
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = shl nuw i32 %17, 24
%19 = or i32 %14, %18
ret i32 %19
}