xunge/DecIR huggingface dataset:
/* Type definitions */
struct _Locale_codecvt {
  int dummy;
};
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t _WLocale_unshift(struct _Locale_codecvt *lcodecvt
                        __attribute__((__unused__)),
                        mbstate_t *st __attribute__((__unused__)), char *buf,
                        size_t n __attribute__((__unused__)), char **next) {
  *next = buf;
  return 0;
}


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

x86 assembly (clang, -O2):
<_WLocale_unshift>:
mov    %rdx,(%r8)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_unshift(%struct._Locale_codecvt* %0, i32* %1, i8* %2, i64 %3, i8** %4) {
%6 = alloca %struct._Locale_codecvt*
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8**
store %struct._Locale_codecvt* %0, %struct._Locale_codecvt** %6
store i32* %1, i32** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8** %4, i8*** %10
%11 = load i8*, i8** %8
%12 = load i8**, i8*** %10
store i8* %11, i8** %12
ret i64 0
}

LLVM IR (-O2):
%struct._Locale_codecvt = type { i32 }
define i64 @_WLocale_unshift(%struct._Locale_codecvt* nocapture readnone %0, i32* nocapture readnone %1, i8* %2, i64 %3, i8** nocapture writeonly %4) {
store i8* %2, i8** %4
ret i64 0
}
void g() { return; }


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

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

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

LLVM IR (-O2):
define void @g() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ max_Heapify(int *, int, int, int);
void build_MAX_heap(int arr[], int n, int k) {
  int i = (n - 1) / k;
  for (i = (n - 1) / k; i >= 0; i--) {
    max_Heapify(arr, i, n, k);
  }
}


x86 assembly (clang, -O0):
<build_MAX_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1166 <build_MAX_heap+0x56>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <max_Heapify@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <build_MAX_heap+0x2c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_MAX_heap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebx
lea    -0x1(%rbx),%eax
cltd
idiv   %r15d
test   %eax,%eax
js     1144 <build_MAX_heap+0x34>
mov    %rdi,%r14
mov    %eax,%ebp
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15d,%ecx
call   1030 <max_Heapify@plt>
add    $0xffffffff,%ebp
jb     1130 <build_MAX_heap+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @build_MAX_heap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = sdiv i32 %9, %10
store i32 %11, i32* %7
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %6
%15 = sdiv i32 %13, %14
store i32 %15, i32* %7
br label %16
16: ; preds = %25, %3
%17 = load i32, i32* %7
%18 = icmp sge i32 %17, 0
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32*, i32** %4
%21 = load i32, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = call i32 @max_Heapify(i32* %20, i32 %21, i32 %22, i32 %23)
br label %25
25: ; preds = %19
%26 = load i32, i32* %7
%27 = add nsw i32 %26, -1
store i32 %27, i32* %7
br label %16
28: ; preds = %16
ret void
}

LLVM IR (-O2):
define void @build_MAX_heap(i32* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = sdiv i32 %4, %2
%6 = icmp sgt i32 %5, -1
br i1 %6, label %7, label %12
7: ; preds = %3, %7
%8 = phi i32 [ %10, %7 ], [ %5, %3 ]
%9 = tail call i32 @max_Heapify(i32* %0, i32 %8, i32 %1, i32 %2)
%10 = add nsw i32 %8, -1
%11 = icmp eq i32 %8, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %3
ret void
}
void gtk_radio_action_set_group() {}


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

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

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

LLVM IR (-O2):
define void @gtk_radio_action_set_group() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ERR_error_string(int /*<<< orphan*/, char *);
int /*<<< orphan*/ ERR_get_error();
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void printLastError(char *msg) {
  char *err = malloc(130);
  ;
  ERR_load_crypto_strings();
  ERR_error_string(ERR_get_error(), err);
  printf("%s ERROR: %s\n", msg, err);
  free(err);
}


x86 assembly (clang, -O0):
<printLastError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x82,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1080 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1070 <ERR_get_error@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1060 <ERR_error_string@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe5e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLastError>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x82,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1080 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   1070 <ERR_get_error@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1060 <ERR_error_string@plt>
lea    0xe6d(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%s ERROR: %s\0A\00"
define void @printLastError(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @malloc(i32 130)
store i8* %4, i8** %3
%5 = call i32 (...) @ERR_load_crypto_strings()
%6 = call i32 (...) @ERR_get_error()
%7 = load i8*, i8** %3
%8 = call i32 @ERR_error_string(i32 %6, i8* %7)
%9 = load i8*, i8** %2
%10 = load i8*, i8** %3
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s ERROR: %s\0A\00"
define void @printLastError(i8* %0) {
%2 = tail call dereferenceable_or_null(130) i8* @malloc(i32 130)
%3 = tail call i32 (...) @ERR_load_crypto_strings()
%4 = tail call i32 (...) @ERR_get_error()
%5 = tail call i32 @ERR_error_string(i32 %4, i8* %2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
%7 = tail call i32 @free(i8* %2)
ret void
}
void read_bytes(unsigned long length, void *addr) {
  unsigned long i;
  unsigned char tmp;
  for (i = 0; i < length; i++)
    tmp += *((unsigned char *)(addr + i));
}


x86 assembly (clang, -O0):
<read_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1148 <read_bytes+0x48>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
movzbl -0x19(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <read_bytes+0x14>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @read_bytes(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
store i64 %0, i64* %3
store i8* %1, i8** %4
store i64 0, i64* %5
br label %7
7: ; preds = %21, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %3
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i64, i64* %5
%14 = getelementptr i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = add nsw i32 %18, %16
%20 = trunc i32 %19 to i8
store i8 %20, i8* %6
br label %21
21: ; preds = %11
%22 = load i64, i64* %5
%23 = add i64 %22, 1
store i64 %23, i64* %5
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @read_bytes(i64 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
size_t Maxsz(size_t, int /*<<< orphan*/);
int /*<<< orphan*/ Minsz(size_t, size_t);
size_t Clampsz(size_t v, size_t min, size_t max) {
  return Maxsz(min, Minsz(v, max));
}


x86 assembly (clang, -O0):
<Clampsz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Minsz@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <Maxsz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clampsz>:
push   %rbx
mov    %rsi,%rbx
mov    %rdx,%rsi
call   1030 <Minsz@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <Maxsz@plt>

LLVM IR (-O0):
define i64 @Clampsz(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = load i64, i64* %6
%10 = call i32 @Minsz(i64 %8, i64 %9)
%11 = call i64 @Maxsz(i64 %7, i32 %10)
ret i64 %11
}

LLVM IR (-O2):
define i64 @Clampsz(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 @Minsz(i64 %0, i64 %2)
%5 = tail call i64 @Maxsz(i64 %1, i32 %4)
ret i64 %5
}
/* Variables and functions */
short get_rand(int /*<<< orphan*/, int);
char gr_obj_char(void) {
  short r;
  const char *rs = "%!?]=/):*";
  r = get_rand(0, 8);
  return (rs[r]);
}


x86 assembly (clang, -O0):
<gr_obj_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
mov    $0x8,%esi
call   1030 <get_rand@plt>
mov    %ax,-0x2(%rbp)
mov    -0x10(%rbp),%rax
movswq -0x2(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gr_obj_char>:
push   %rax
xor    %edi,%edi
mov    $0x8,%esi
call   1030 <get_rand@plt>
movswq %ax,%rax
lea    0xed8(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%!?]=/):*\00"
define signext i8 @gr_obj_char() {
%1 = alloca i16
%2 = alloca i8*
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call signext i16 @get_rand(i32 0, i32 8)
store i16 %3, i16* %1
%4 = load i8*, i8** %2
%5 = load i16, i16* %1
%6 = sext i16 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
%8 = load i8, i8* %7
ret i8 %8
}

LLVM IR (-O2):
@.str = [10 x i8] c"%!?]=/):*\00"
define signext i8 @gr_obj_char() {
%1 = tail call signext i16 @get_rand(i32 0, i32 8)
%2 = sext i16 %1 to i64
%3 = getelementptr inbounds [10 x i8], [10 x i8]* @.str, i64 0, i64 %2
%4 = load i8, i8* %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
scalar_t__ test_satisfies();
int main(void) {
  if (0 != test_satisfies()) {
    printf("satisfies not working\n");
    exit(EXIT_FAILURE);
  }
  printf("okay\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_satisfies@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     116e <main+0x3e>
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_satisfies@plt>
test   %rax,%rax
jne    114d <main+0x1d>
lea    0xebc(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xeb1(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"satisfies not working\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [6 x i8] c"okay\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_satisfies()
%3 = icmp ne i64 0, %2
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [5 x i8] c"okay\00"
@str.2 = [22 x i8] c"satisfies not working\00"
define i32 @main() {
%1 = tail call i64 (...) @test_satisfies()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int testBit_fun_long(long x, unsigned i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_long>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_long>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
xor    %eax,%eax
test   %rdi,%rcx
setne  %al
ret

LLVM IR (-O0):
define i32 @testBit_fun_long(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = and i64 %5, %8
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @testBit_fun_long(i64 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = sext i32 %3 to i64
%5 = and i64 %4, %0
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void enableTimer(void) {
  volatile unsigned int *timerControl = (unsigned int *)((0x73000000) + 0);
  volatile unsigned int *timerLoad = (unsigned int *)((0x73000000) + 4);
  *timerLoad = 0x00000000;
  *timerControl = 0x590;
}


x86 assembly (clang, -O0):
<enableTimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0x73000000,%eax
mov    %rax,-0x8(%rbp)
mov    $0x73000004,%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x590,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<enableTimer>:
movl   $0x0,0x73000004
movl   $0x590,0x73000000
ret

LLVM IR (-O0):
define void @enableTimer() {
%1 = alloca i32*
%2 = alloca i32*
store i32* inttoptr (i64 1929379840 to i32*), i32** %1
store i32* inttoptr (i64 1929379844 to i32*), i32** %2
%3 = load i32*, i32** %2
store volatile i32 0, i32* %3
%4 = load i32*, i32** %1
store volatile i32 1424, i32* %4
ret void
}

LLVM IR (-O2):
define void @enableTimer() {
store volatile i32 0, i32* inttoptr (i64 1929379844 to i32*)
store volatile i32 1424, i32* inttoptr (i64 1929379840 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ emit_addimm(int, int, int);
int /*<<< orphan*/ emit_cmovle_reg(int, int);
int /*<<< orphan*/ emit_orimm(int, int, int);
int /*<<< orphan*/ emit_test(int, int);
void emit_cmppl(int s, int sr, int temp) {
  assert(temp >= 0);
  emit_orimm(sr, 1, sr);
  emit_addimm(sr, -1, temp);
  emit_test(s, s);
  emit_cmovle_reg(temp, sr);
}


x86 assembly (clang, -O0):
<emit_cmppl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1070 <emit_orimm@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xffffffff,%esi
call   1050 <emit_addimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <emit_test@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <emit_cmovle_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_cmppl>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %edx,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1070 <emit_orimm@plt>
mov    %ebp,%edi
mov    $0xffffffff,%esi
mov    %ebx,%edx
call   1050 <emit_addimm@plt>
mov    %r14d,%edi
mov    %r14d,%esi
call   1060 <emit_test@plt>
mov    %ebx,%edi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <emit_cmovle_reg@plt>

LLVM IR (-O0):
define void @emit_cmppl(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp sge i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @emit_orimm(i32 %11, i32 1, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 @emit_addimm(i32 %14, i32 -1, i32 %15)
%17 = load i32, i32* %4
%18 = load i32, i32* %4
%19 = call i32 @emit_test(i32 %17, i32 %18)
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = call i32 @emit_cmovle_reg(i32 %20, i32 %21)
ret void
}

LLVM IR (-O2):
define void @emit_cmppl(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = lshr i32 %4, 31
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @emit_orimm(i32 %1, i32 1, i32 %1)
%8 = tail call i32 @emit_addimm(i32 %1, i32 -1, i32 %2)
%9 = tail call i32 @emit_test(i32 %0, i32 %0)
%10 = tail call i32 @emit_cmovle_reg(i32 %2, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
void testElemRegion3(int **pp) {
  int *p = malloc(12);
  *pp = p;
  free(*pp);
}


x86 assembly (clang, -O0):
<testElemRegion3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testElemRegion3>:
push   %rbx
mov    %rdi,%rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,(%rbx)
mov    %rax,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @testElemRegion3(i32** %0) {
%2 = alloca i32**
%3 = alloca i32*
store i32** %0, i32*** %2
%4 = call i32* @malloc(i32 12)
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = load i32**, i32*** %2
store i32* %5, i32** %6
%7 = load i32**, i32*** %2
%8 = load i32*, i32** %7
%9 = call i32 @free(i32* %8)
ret void
}

LLVM IR (-O2):
define void @testElemRegion3(i32** nocapture writeonly %0) {
%2 = tail call i32* @malloc(i32 12)
store i32* %2, i32** %0
%3 = tail call i32 @free(i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgdiv(void) {
  gen("cwd");
  gen("idiv\tcx");
}


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

x86 assembly (clang, -O2):
<cgdiv>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <gen@plt>
lea    0xee0(%rip),%rdi
pop    %rax
jmp    1030 <gen@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cwd\00"
@.str.1 = [8 x i8] c"idiv\09cx\00"
define void @cgdiv() {
%1 = call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @gen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cwd\00"
@.str.1 = [8 x i8] c"idiv\09cx\00"
define void @cgdiv() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @gen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void __attribute__((__noreturn__)) __chk_fail(void) {
  char msg[] = "*** buffer overflow detected ***: terminated\n";
  write(2, msg, strlen(msg));
  raise(SIGABRT);
  _exit(127);
}


x86 assembly (clang, -O0):
<__chk_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xe9d(%rip),%rsi
mov    $0x2e,%edx
call   1070 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x38(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1050 <write@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x7f,%edi
call   1040 <_exit@plt>

x86 assembly (clang, -O2):
<__chk_fail>:
push   %rbx
sub    $0x30,%rsp
movups 0xed2(%rip),%xmm0
movups %xmm0,0x1e(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1050 <write@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
mov    $0x7f,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
@__const.__chk_fail.msg = [46 x i8] c"*** buffer overflow detected ***: terminated\0A\00"
@SIGABRT = global i32 0
define void @__chk_fail() {
%1 = alloca [46 x i8]
%2 = bitcast [46 x i8]* %1 to i8*
%3 = getelementptr inbounds [46 x i8], [46 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [46 x i8], [46 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
%7 = load i32, i32* @SIGABRT
%8 = call i32 @raise(i32 %7)
%9 = call i32 @_exit(i32 127)
unreachable
}

LLVM IR (-O2):
@__const.__chk_fail.msg = [46 x i8] c"*** buffer overflow detected ***: terminated\0A\00"
@SIGABRT = global i32 0
define void @__chk_fail() {
%1 = alloca [46 x i8]
%2 = getelementptr inbounds [46 x i8], [46 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @write(i32 2, i8* %2, i32 %3)
%5 = load i32, i32* @SIGABRT
%6 = call i32 @raise(i32 %5)
%7 = call i32 @_exit(i32 127)
unreachable
}
int cmp_uint(const void *a, const void *b) {
  unsigned int ia = *(int *)a;
  unsigned int ib = *(int *)b;
  return (ia > ib) - (ia < ib);
}


x86 assembly (clang, -O0):
<cmp_uint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
cmp    -0x18(%rbp),%ecx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_uint>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
seta   %al
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @cmp_uint(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp ugt i32 %13, %14
%16 = zext i1 %15 to i32
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = icmp ult i32 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmp_uint(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp ugt i32 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp ult i32 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
unsigned genhashkey(const char *s) {
  unsigned hashval;
  for (hashval = 0; *s != '\0'; s++)
    hashval = *s + 31 * hashval;
  return hashval % 101;
}


x86 assembly (clang, -O0):
<genhashkey>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <genhashkey+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <genhashkey+0xf>
mov    -0xc(%rbp),%eax
mov    $0x65,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<genhashkey>:
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <genhashkey+0x47>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
mov    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <genhashkey+0x10>
mov    %eax,%ecx
imul   $0x446f8657,%rcx,%rcx
shr    $0x20,%rcx
mov    %eax,%edx
sub    %ecx,%edx
shr    %edx
add    %ecx,%edx
shr    $0x6,%edx
imul   $0x65,%edx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @genhashkey(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul i32 %6, 31
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 101
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
int HashMap_CalcArraySize(int totalElemNum) {
  int size = 0;
  size = (totalElemNum * 0.75);
  printf("[F:%s L:%d] TotalElem=%d, HashMapArray_size=%d\n", __FUNCTION__, 367,
         totalElemNum, size);
  return size;
}


x86 assembly (clang, -O0):
<HashMap_CalcArraySize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xec0(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x16f,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashMap_CalcArraySize>:
push   %rbx
mov    %edi,%ecx
cvtsi2sd %edi,%xmm0
mulsd  0xee1(%rip),%xmm0
cvttsd2si %xmm0,%ebx
lea    0xede(%rip),%rdi
lea    0xf07(%rip),%rsi
mov    $0x16f,%edx
mov    %ebx,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"[F:%s L:%d] TotalElem=%d, HashMapArray_size=%d\0A\00"
@__FUNCTION__.HashMap_CalcArraySize = [22 x i8] c"HashMap_CalcArraySize\00"
define i32 @HashMap_CalcArraySize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 7.500000e-01
%7 = fptosi double %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.HashMap_CalcArraySize, i64 0, i64 0), i32 367, i32 %8, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [48 x i8] c"[F:%s L:%d] TotalElem=%d, HashMapArray_size=%d\0A\00"
@__FUNCTION__.HashMap_CalcArraySize = [22 x i8] c"HashMap_CalcArraySize\00"
define i32 @HashMap_CalcArraySize(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 7.500000e-01
%4 = fptosi double %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.HashMap_CalcArraySize, i64 0, i64 0), i32 367, i32 %0, i32 %4)
ret i32 %4
}
/* Variables and functions */
unsigned long MsgBox23(char const *, char const *, unsigned long);
unsigned long msgbox(const char *s, const char *title, unsigned long i) {
  return MsgBox23(s, title, i);
}


x86 assembly (clang, -O0):
<msgbox>:
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   1030 <MsgBox23@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msgbox>:
jmp    1030 <MsgBox23@plt>

LLVM IR (-O0):
define i64 @msgbox(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 @MsgBox23(i8* %7, i8* %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @msgbox(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @MsgBox23(i8* %0, i8* %1, i64 %2)
ret i64 %4
}
/* Variables and functions */
scalar_t__ my_isupper(int);
int my_tolower(int c) {
  if (my_isupper(c))
    return c | 32;
  return c;
}


x86 assembly (clang, -O0):
<my_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <my_isupper@plt>
cmp    $0x0,%rax
je     113b <my_tolower+0x2b>
mov    -0x8(%rbp),%eax
or     $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <my_tolower+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <my_isupper@plt>
mov    %ebx,%ecx
or     $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_tolower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @my_isupper(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = or i32 %8, 32
store i32 %9, i32* %2
br label %12
10: ; preds = %1
%11 = load i32, i32* %3
store i32 %11, i32* %2
br label %12
12: ; preds = %10, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @my_tolower(i32 %0) {
%2 = tail call i64 @my_isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = or i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CompileWord(int, int);
int /*<<< orphan*/ InlineWords(int, int, int);
void DoDeferStore(void) {
  CompileWord(95, 1);
  InlineWords(2, 11, 8);
}


x86 assembly (clang, -O0):
<DoDeferStore>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5f,%edi
mov    $0x1,%esi
call   1030 <CompileWord@plt>
mov    $0x2,%edi
mov    $0xb,%esi
mov    $0x8,%edx
call   1040 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoDeferStore>:
push   %rax
mov    $0x5f,%edi
mov    $0x1,%esi
call   1030 <CompileWord@plt>
mov    $0x2,%edi
mov    $0xb,%esi
mov    $0x8,%edx
pop    %rax
jmp    1040 <InlineWords@plt>

LLVM IR (-O0):
define void @DoDeferStore() {
%1 = call i32 @CompileWord(i32 95, i32 1)
%2 = call i32 @InlineWords(i32 2, i32 11, i32 8)
ret void
}

LLVM IR (-O2):
define void @DoDeferStore() {
%1 = tail call i32 @CompileWord(i32 95, i32 1)
%2 = tail call i32 @InlineWords(i32 2, i32 11, i32 8)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double randreal() { return (double)rand() / (double)((unsigned)RAND_MAX + 1); }


x86 assembly (clang, -O0):
<randreal>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<randreal>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @randreal() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
%6 = uitofp i32 %5 to double
%7 = fdiv double %2, %6
ret double %7
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @randreal() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
%6 = uitofp i32 %5 to double
%7 = fdiv double %2, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalnum(int);
void t_isalnum_0x74() {
  Assert_real((isalnum(116)),
              "/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_isalnum.c",
              585, ("isalnum should be 1 for t"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x74>:
push   %rbp
mov    %rsp,%rbp
mov    $0x74,%edi
call   1030 <isalnum@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x249,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x74>:
push   %rax
mov    $0x74,%edi
call   1030 <isalnum@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x249,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for t\00"
define void @t_isalnum_0x74() {
%1 = call i32 @isalnum(i32 116)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, 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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 1 for t\00"
define void @t_isalnum_0x74() {
%1 = tail call i32 @isalnum(i32 116)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 585, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int main(int argc, char **argv) {
  int x;
  int y;
  x = argc;
  x = x * x - 2 * x;
  y = 4 + argc;
  do {
    if (x > 2) {
      --x;
    } else {
      if (2 * x > y) {
        y = 2;
      } else {
        --x;
      };
      --x;
    };
    --x;
  } while (x > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x14(%rbp)
jle    114b <main+0x4b>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1178 <main+0x78>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
cmp    -0x18(%rbp),%eax
jle    1166 <main+0x66>
movl   $0x2,-0x18(%rbp)
jmp    116f <main+0x6f>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1133 <main+0x33>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %6
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 2, %12
%14 = sub nsw i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %4
%16 = add nsw i32 4, %15
store i32 %16, i32* %7
br label %17
17: ; preds = %38, %2
%18 = load i32, i32* %6
%19 = icmp sgt i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %6
%22 = add nsw i32 %21, -1
store i32 %22, i32* %6
br label %35
23: ; preds = %17
%24 = load i32, i32* %6
%25 = mul nsw i32 2, %24
%26 = load i32, i32* %7
%27 = icmp sgt i32 %25, %26
br i1 %27, label %28, label %29
28: ; preds = %23
store i32 2, i32* %7
br label %32
29: ; preds = %23
%30 = load i32, i32* %6
%31 = add nsw i32 %30, -1
store i32 %31, i32* %6
br label %32
32: ; preds = %29, %28
%33 = load i32, i32* %6
%34 = add nsw i32 %33, -1
store i32 %34, i32* %6
br label %35
35: ; preds = %32, %20
%36 = load i32, i32* %6
%37 = add nsw i32 %36, -1
store i32 %37, i32* %6
br label %38
38: ; preds = %35
%39 = load i32, i32* %6
%40 = icmp sgt i32 %39, 0
br i1 %40, label %17, label %41
41: ; preds = %38
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g15_cb(void *arg) { puts("GPIO_15 triggered"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"GPIO_15 triggered\00"
define void @g15_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"GPIO_15 triggered\00"
define void @g15_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char test(int);
int main() {
  if (test(2) != '1')
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1040 <test@plt>
movsbl %al,%eax
cmp    $0x31,%eax
je     114c <main+0x2c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <test@plt>
cmp    $0x31,%al
jne    1133 <main+0x13>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call signext i8 @test(i32 2)
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 49
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call signext i8 @test(i32 2)
%2 = icmp eq i8 %1, 49
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Variables and functions */
scalar_t__ soc_is_qca9561();
scalar_t__ soc_is_tp9343();
int soc_is_qca956x(void) { return soc_is_tp9343() || soc_is_qca9561(); }


x86 assembly (clang, -O0):
<soc_is_qca956x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <soc_is_tp9343@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1152 <soc_is_qca956x+0x32>
mov    $0x0,%al
call   1030 <soc_is_qca9561@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_is_qca956x>:
push   %rax
xor    %eax,%eax
call   1040 <soc_is_tp9343@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <soc_is_qca956x+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <soc_is_qca9561@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @soc_is_qca956x() {
%1 = call i64 (...) @soc_is_tp9343()
%2 = icmp ne i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i64 (...) @soc_is_qca9561()
%5 = icmp ne i64 %4, 0
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ true, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @soc_is_qca956x() {
%1 = tail call i64 (...) @soc_is_tp9343()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i64 (...) @soc_is_qca9561()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 1, %0 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int ecma119_node_cmp_flag(void const *, void const *, int);
int ecma119_node_cmp_nohard(const void *v1, const void *v2) {
  return ecma119_node_cmp_flag(v1, v2, 1 | 2);
}


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

x86 assembly (clang, -O2):
<ecma119_node_cmp_nohard>:
mov    $0x3,%edx
jmp    1030 <ecma119_node_cmp_flag@plt>

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

LLVM IR (-O2):
define i32 @ecma119_node_cmp_nohard(i8* %0, i8* %1) {
%3 = tail call i32 @ecma119_node_cmp_flag(i8* %0, i8* %1, i32 3)
ret i32 %3
}
int isValidCell(int row, int col, int mSize) {
  if (row < 0 || col < 0 || row >= mSize || col >= mSize)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isValidCell>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1139 <isValidCell+0x39>
cmpl   $0x0,-0xc(%rbp)
jl     1139 <isValidCell+0x39>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1139 <isValidCell+0x39>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1145 <isValidCell+0x45>
movl   $0x0,-0x4(%rbp)
jmp    114c <isValidCell+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidCell>:
mov    %esi,%eax
or     %edi,%eax
setns  %al
cmp    %edx,%edi
setl   %cl
and    %al,%cl
cmp    %edx,%esi
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isValidCell(i32 %0, i32 %1, i32 %2) {
%4 = or i32 %1, %0
%5 = icmp sgt i32 %4, -1
%6 = icmp slt i32 %0, %2
%7 = and i1 %5, %6
%8 = icmp slt i32 %1, %2
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void closelockfile(int f) { close(f); }


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

x86 assembly (clang, -O2):
<closelockfile>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @closelockfile(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void gtk_widget_set_style() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_set_style() {
ret void
}
/* Variables and functions */
scalar_t__ fmaxf(float, float);
int /*<<< orphan*/ link_failure_fmaxf();
void test_fmaxf(float f1, float f2) {
  if (fmaxf(f1, f2) != fmaxf(f1, f2))
    link_failure_fmaxf();
}


x86 assembly (clang, -O0):
<test_fmaxf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <fmaxf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <fmaxf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_fmaxf+0x4b>
mov    $0x0,%al
call   1030 <link_failure_fmaxf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fmaxf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1040 <fmaxf@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1040 <fmaxf@plt>
cmp    %rax,%rbx
jne    1155 <test_fmaxf+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_fmaxf@plt>

LLVM IR (-O0):
define void @test_fmaxf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call i64 @fmaxf(float %5, float %6)
%8 = load float, float* %3
%9 = load float, float* %4
%10 = call i64 @fmaxf(float %8, float %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_fmaxf()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_fmaxf(float %0, float %1) {
%3 = tail call i64 @fmaxf(float %0, float %1)
%4 = tail call i64 @fmaxf(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_fmaxf()
br label %8
8: ; preds = %6, %2
ret void
}