xunge/DecIR huggingface dataset:
/* Variables and functions */
int real_stat(char const *, void *);
scalar_t__ smbw_path(char const *);
int smbw_stat(char const *, void *);
int stat(const char *name, void *st) {
  if (smbw_path(name)) {
    return smbw_stat(name, st);
  }
  return real_stat(name, st);
}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <smbw_path@plt>
cmp    $0x0,%rax
je     1168 <stat+0x38>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <smbw_stat@plt>
mov    %eax,-0x4(%rbp)
jmp    1178 <stat+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <real_stat@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <smbw_path@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
test   %rax,%rax
je     1156 <stat+0x26>
pop    %rbx
pop    %r14
jmp    1030 <smbw_stat@plt>
pop    %rbx
pop    %r14
jmp    1040 <real_stat@plt>

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

LLVM IR (-O2):
define i32 @stat(i8* %0, i8* %1) {
%3 = tail call i64 @smbw_path(i8* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @smbw_stat(i8* %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @real_stat(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
void SetUnicodePasteBuffer(short int *utf16, int count) {}


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

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

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

LLVM IR (-O2):
define void @SetUnicodePasteBuffer(i16* nocapture %0, i32 %1) {
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  {
    state[0UL] = (input[0UL] - 51238316UL) - (unsigned short)47038;
    local1 = 0UL;
    while (local1 < (unsigned short)0) {
      local1++;
    }
    output[0UL] = ((state[0UL] << (unsigned short)1) |
                   (state[0UL] >> (unsigned short)15)) ^
                  (unsigned short)57088;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
sub    $0x30dd5ac,%rax
sub    $0xb7be,%rax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x0,%eax
jge    1147 <RandomFunc+0x47>
mov    -0x14(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x14(%rbp)
jmp    1129 <RandomFunc+0x29>
movzwl -0x12(%rbp),%eax
shl    $0x1,%eax
movzwl -0x12(%rbp),%ecx
sar    $0xf,%ecx
or     %ecx,%eax
xor    $0xdf00,%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0x7296,%eax
rol    %ax
xor    $0xdf00,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%7 = load i16*, i16** %3
%8 = getelementptr inbounds i16, i16* %7, i64 0
%9 = load i16, i16* %8
%10 = zext i16 %9 to i64
%11 = sub i64 %10, 51238316
%12 = sub i64 %11, 47038
%13 = trunc i64 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %6
br label %15
15: ; preds = %19, %2
%16 = load i16, i16* %6
%17 = zext i16 %16 to i32
%18 = icmp slt i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i16, i16* %6
%21 = add i16 %20, 1
store i16 %21, i16* %6
br label %15
22: ; preds = %15
%23 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%24 = load i16, i16* %23
%25 = zext i16 %24 to i32
%26 = shl i32 %25, 1
%27 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%28 = load i16, i16* %27
%29 = zext i16 %28 to i32
%30 = ashr i32 %29, 15
%31 = or i32 %26, %30
%32 = xor i32 %31, 57088
%33 = trunc i32 %32 to i16
%34 = load i16*, i16** %4
%35 = getelementptr inbounds i16, i16* %34, i64 0
store i16 %33, i16* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, 29334
%5 = tail call i16 @llvm.fshl.i16(i16 %4, i16 %4, i16 1)
%6 = xor i16 %5, -8448
store i16 %6, i16* %1
ret void
}
/* Variables and functions */
size_t ls_get_swap_range(size_t dimension) { return dimension / 3; }


x86 assembly (clang, -O0):
<ls_get_swap_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_get_swap_range>:
mov    %rdi,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @ls_get_swap_range(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = udiv i64 %3, 3
ret i64 %4
}

LLVM IR (-O2):
define i64 @ls_get_swap_range(i64 %0) {
%2 = udiv i64 %0, 3
ret i64 %2
}
char *strcat(char *dest, char *src) { return strcat(dest, src); }


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

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

LLVM IR (-O0):
define i8* @strcat(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 i8* @strcat(i8* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @strcat(i8* nocapture readnone %0, i8* nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
/* Variables and functions */
scalar_t__ __builtin_llfloorf(float);
int /*<<< orphan*/ link_failure_builtin_llfloorf();
void test_builtin_llfloorf(float f) {
  if (__builtin_llfloorf(f) != __builtin_llfloorf(f))
    link_failure_builtin_llfloorf();
}


x86 assembly (clang, -O0):
<test_builtin_llfloorf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_llfloorf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_llfloorf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_llfloorf+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_llfloorf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_llfloorf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <__builtin_llfloorf@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <__builtin_llfloorf@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_llfloorf+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_llfloorf@plt>

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

LLVM IR (-O2):
define void @test_builtin_llfloorf(float %0) {
%2 = tail call i64 @__builtin_llfloorf(float %0)
%3 = tail call i64 @__builtin_llfloorf(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_llfloorf()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int getdtablesize(void) { return 1024; }


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

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

LLVM IR (-O0):
define i32 @getdtablesize() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @getdtablesize() {
ret i32 1024
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stdout;
void version_info() {
  fprintf(stdout, "%s -- version: %s\n", "sff_demult", "0.1.2");
}


x86 assembly (clang, -O0):
<version_info>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee8(%rip),%rdx
lea    0xeec(%rip),%rcx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_info>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xeec(%rip),%rdx
lea    0xef0(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [19 x i8] c"%s -- version: %s\0A\00"
@.str.1 = [11 x i8] c"sff_demult\00"
@.str.2 = [6 x i8] c"0.1.2\00"
define void @version_info() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [19 x i8] c"%s -- version: %s\0A\00"
@.str.1 = [11 x i8] c"sff_demult\00"
@.str.2 = [6 x i8] c"0.1.2\00"
define void @version_info() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exitB2() { printf("B2\n"); }


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

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

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

LLVM IR (-O2):
@str = [3 x i8] c"B2\00"
define void @exitB2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ioctl(int, char, int /*<<< orphan*/);
int tcsendbreak(int fd, int dur) {
  do {
    if (_ioctl(fd, (('T' << 8) | 5), 0) == -1)
      return -1;
  } while (dur--);
  return 0;
}


x86 assembly (clang, -O0):
<tcsendbreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <_ioctl@plt>
cmp    $0xffffffff,%eax
jne    1142 <tcsendbreak+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <tcsendbreak+0x52>
jmp    1147 <tcsendbreak+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jne    111e <tcsendbreak+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcsendbreak>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    $0x5,%esi
xor    %edx,%edx
call   1030 <_ioctl@plt>
cmp    $0xffffffff,%eax
je     113c <tcsendbreak+0x2c>
add    $0xffffffff,%ebx
jne    1120 <tcsendbreak+0x10>
xor    %eax,%eax
jmp    1141 <tcsendbreak+0x31>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @tcsendbreak(i32 %0, i32 %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i32 [ %1, %2 ], [ %8, %7 ]
%5 = tail call i32 @_ioctl(i32 %0, i8 signext 5, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = icmp eq i32 %4, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i32 [ -1, %3 ], [ 0, %7 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void atexit3(void) { printf("atexit3\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"atexit3\00"
define void @atexit3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_dvector(double *v) { free(v); }


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

x86 assembly (clang, -O2):
<free_dvector>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "Usage: %s {seed} [# iterations]\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s {seed} [# iterations]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"Usage: %s {seed} [# iterations]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void UARTHwFlowControlDisable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000030))) &=
      ~(0x00008000 | 0x00004000);
}


x86 assembly (clang, -O0):
<UARTHwFlowControlDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xffffffffffff3fff,%rcx
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTHwFlowControlDisable>:
andq   $0xffffffffffff3fff,0x30(%rdi)
ff
ret

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

LLVM IR (-O2):
define void @UARTHwFlowControlDisable(i64 %0) {
%2 = add nsw i64 %0, 48
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -49153
store volatile i64 %5, i64* %3
ret void
}
int is_valid_coord(int x, int y, int maxrow, int maxcol) {
  return ((x >= 0 && y >= 0) && (x < maxrow && y < maxcol)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_valid_coord>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jl     1151 <is_valid_coord+0x51>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     1151 <is_valid_coord+0x51>
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
cmp    -0xc(%rbp),%ecx
mov    %al,-0x12(%rbp)
jge    114b <is_valid_coord+0x4b>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
setl   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_valid_coord(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = or i32 %1, %0
%6 = icmp slt i32 %0, %2
%7 = icmp slt i32 %1, %3
%8 = and i1 %6, %7
%9 = icmp sgt i32 %5, -1
%10 = and i1 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
int test_imm_A2uint32_mem(unsigned int *val) {
  return ((*val) & (0xA2 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A2uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 162
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ malloc(int);
int main() {
  char *ptr = (char *)malloc(1024);
  char ch;
  ch = ptr[1024];
  ptr[1024] = 0;
  ptr = 0;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x400(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,0x400(%rax)
movq   $0x0,-0x10(%rbp)
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x400,%edi
call   1030 <malloc@plt>
movb   $0x0,0x400(%rax)
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8
store i32 0, i32* %1
%4 = call i64 @malloc(i32 1024)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1024
%8 = load i8, i8* %7
store i8 %8, i8* %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1024
store i8 0, i8* %10
store i8* null, i8** %2
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 1024)
%2 = inttoptr i64 %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 1024
store i8 0, i8* %3
%4 = tail call i32 @exit(i32 0)
unreachable
}
void curvebasis_(basisid) int *basisid;
{ curvebasis((short)*basisid); }


x86 assembly (clang, -O0):
<curvebasis_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movswl %ax,%edi
mov    $0x0,%al
call   1030 <curvebasis@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curvebasis_>:
movswl (%rdi),%edi
xor    %eax,%eax
jmp    1030 <curvebasis@plt>

LLVM IR (-O0):
define void @curvebasis_(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = trunc i32 %4 to i16
%6 = sext i16 %5 to i32
%7 = call i32 (i32, ...) bitcast (i32 (...)* @curvebasis to i32 (i32, ...)*)(i32 %6)
ret void
}

LLVM IR (-O2):
define void @curvebasis_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 16
%4 = ashr exact i32 %3, 16
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @curvebasis to i32 (i32, ...)*)(i32 %4)
ret void
}
int qpnp_misc_irq_available(struct device *consumer_dev) { return 0; }


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

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @qpnp_misc_irq_available(%struct.device* %0) {
%2 = alloca %struct.device*
store %struct.device* %0, %struct.device** %2
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @qpnp_misc_irq_available(%struct.device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void strfree(const char *const arg) { free((void *)arg); }


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

x86 assembly (clang, -O2):
<strfree>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @strfree(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int gzConfigInput(char *);
int textConfigInput(char *);
int configInput(char *inputName, int isZip) {
  if (isZip) {
    return gzConfigInput(inputName);
  } else {
    return textConfigInput(inputName);
  }
  return 0;
}


x86 assembly (clang, -O0):
<configInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     114a <configInput+0x2a>
mov    -0x10(%rbp),%rdi
call   1040 <gzConfigInput@plt>
mov    %eax,-0x4(%rbp)
jmp    1156 <configInput+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <textConfigInput@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<configInput>:
test   %esi,%esi
je     1129 <configInput+0x9>
jmp    1040 <gzConfigInput@plt>
jmp    1030 <textConfigInput@plt>

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

LLVM IR (-O2):
define i32 @configInput(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @gzConfigInput(i8* %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @textConfigInput(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ %5, %4 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int a;
  scanf("%x", &a);
  printf("%d\n", a);
  getchar();
  getchar();
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%x\00"
@.str.1 = [4 x i8] c"%d\0A\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 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @getchar()
%7 = call i32 (...) @getchar()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
unsigned int fread(void *, int, unsigned int, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void Nacti(void *kam, int velikost, unsigned kolikrat, FILE *odkud,
           char *varovani) {
  if (fread(kam, velikost, kolikrat, odkud) != kolikrat) {
    fprintf(stderr, "Error reading %s.\n", varovani);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<Nacti>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <fread@plt>
cmp    -0x10(%rbp),%eax
je     1189 <Nacti+0x59>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Nacti>:
push   %rbp
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %edx,%ebp
call   1030 <fread@plt>
cmp    %ebp,%eax
jne    1148 <Nacti+0x18>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Error reading %s.\0A\00"
define void @Nacti(i8* %0, i32 %1, i32 %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32*, i32** %9
%15 = call i32 @fread(i8* %11, i32 %12, i32 %13, i32* %14)
%16 = load i32, i32* %8
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %5
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %10
%21 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 -1)
unreachable
23: ; preds = %5
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Error reading %s.\0A\00"
define void @Nacti(i8* nocapture %0, i32 %1, i32 %2, i32* nocapture %3, i8* %4) {
%6 = tail call i32 @fread(i8* %0, i32 %1, i32 %2, i32* %3)
%7 = icmp eq i32 %6, %2
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = load i32, i32* @stderr
%10 = tail call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %5
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dbg_set_chain(int);
int /*<<< orphan*/ get_response_from_vpi();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ send_address_to_vpi(int);
int /*<<< orphan*/ send_block_data_to_vpi(int, int *);
int /*<<< orphan*/ send_command_to_vpi(int);
int /*<<< orphan*/ send_data_to_vpi(int);
int dbg_cpu0_write(uint32_t adr, uint32_t *data, uint32_t length) {
  if (0)
    printf("dbg_cpu0_write: adr 0x%.8x\n", adr);
  dbg_set_chain(1);
  send_command_to_vpi(0x5);
  send_address_to_vpi(adr);
  send_data_to_vpi(length);
  send_block_data_to_vpi(length, data);
  get_response_from_vpi();
  return 0;
}


x86 assembly (clang, -O0):
<dbg_cpu0_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%edi
call   1060 <dbg_set_chain@plt>
mov    $0x5,%edi
call   1030 <send_command_to_vpi@plt>
mov    -0x4(%rbp),%edi
call   1040 <send_address_to_vpi@plt>
mov    -0x14(%rbp),%edi
call   1080 <send_data_to_vpi@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <send_block_data_to_vpi@plt>
mov    $0x0,%al
call   1070 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_cpu0_write>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x1,%edi
call   1060 <dbg_set_chain@plt>
mov    $0x5,%edi
call   1030 <send_command_to_vpi@plt>
mov    %ebp,%edi
call   1040 <send_address_to_vpi@plt>
mov    %ebx,%edi
call   1080 <send_data_to_vpi@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <send_block_data_to_vpi@plt>
xor    %eax,%eax
call   1070 <get_response_from_vpi@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dbg_cpu0_write(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 = call i32 @dbg_set_chain(i32 1)
%8 = call i32 @send_command_to_vpi(i32 5)
%9 = load i32, i32* %4
%10 = call i32 @send_address_to_vpi(i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @send_data_to_vpi(i32 %11)
%13 = load i32, i32* %6
%14 = load i32*, i32** %5
%15 = call i32 @send_block_data_to_vpi(i32 %13, i32* %14)
%16 = call i32 (...) @get_response_from_vpi()
ret i32 0
}

LLVM IR (-O2):
define i32 @dbg_cpu0_write(i32 %0, i32* %1, i32 %2) {
%4 = tail call i32 @dbg_set_chain(i32 1)
%5 = tail call i32 @send_command_to_vpi(i32 5)
%6 = tail call i32 @send_address_to_vpi(i32 %0)
%7 = tail call i32 @send_data_to_vpi(i32 %2)
%8 = tail call i32 @send_block_data_to_vpi(i32 %2, i32* %1)
%9 = tail call i32 (...) @get_response_from_vpi()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void finish_output_buffer(void *context, void *acquired_handle) {
  ((void)(context));
  fprintf(stderr, "finished output buffer, handle %p\n", acquired_handle);
}


x86 assembly (clang, -O0):
<finish_output_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish_output_buffer>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"finished output buffer, handle %p\0A\00"
define void @finish_output_buffer(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 i32, i32* @stderr
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"finished output buffer, handle %p\0A\00"
define void @finish_output_buffer(i8* nocapture readnone %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
double AMIN1(double a, double b) { return a < b ? a : b; }


x86 assembly (clang, -O0):
<AMIN1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <AMIN1+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <AMIN1+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMIN1>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @AMIN1(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @AMIN1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ glColor4i(int, int, int, int);
void Color4i(int r, int g, int b, int a) { glColor4i(r, g, b, a); }


x86 assembly (clang, -O0):
<Color4i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <glColor4i@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Color4i>:
jmp    1030 <glColor4i@plt>

LLVM IR (-O0):
define void @Color4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @glColor4i(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Color4i(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @glColor4i(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
int sum(int n1, int n2, int n3, int n4, int n5) {
  return n1 + n2 + n3 + n4 + n5;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
add    %r8d,%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %1, %0
%7 = add nsw i32 %6, %2
%8 = add nsw i32 %7, %3
%9 = add nsw i32 %8, %4
ret i32 %9
}
/* Type definitions */
struct activity {
  int dummy;
};

/* Variables and functions */
int get_temp_nr();
int wrap_get_temp_nr(struct activity *a) { return (get_temp_nr()); }


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

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

LLVM IR (-O0):
%struct.activity = type { i32 }
define i32 @wrap_get_temp_nr(%struct.activity* %0) {
%2 = alloca %struct.activity*
store %struct.activity* %0, %struct.activity** %2
%3 = call i32 (...) @get_temp_nr()
ret i32 %3
}

LLVM IR (-O2):
%struct.activity = type { i32 }
define i32 @wrap_get_temp_nr(%struct.activity* nocapture readnone %0) {
%2 = tail call i32 (...) @get_temp_nr()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t lseek(int file __attribute__((unused)), off_t ptr __attribute__((unused)),
            int dir __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<lseek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lseek(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
ret i32 0
}

LLVM IR (-O2):
define i32 @lseek(i32 %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mutilsExtension(char *);
char *mutilsStrLower(int /*<<< orphan*/);
char *mutilsExtensionLower(char *path) {
  char *ext;
  return (mutilsStrLower(mutilsExtension(path)));
}


x86 assembly (clang, -O0):
<mutilsExtensionLower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mutilsExtension@plt>
mov    %eax,%edi
call   1040 <mutilsStrLower@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mutilsExtensionLower>:
push   %rax
call   1030 <mutilsExtension@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <mutilsStrLower@plt>

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

LLVM IR (-O2):
define i8* @mutilsExtensionLower(i8* %0) {
%2 = tail call i32 @mutilsExtension(i8* %0)
%3 = tail call i8* @mutilsStrLower(i32 %2)
ret i8* %3
}
void MODULE_NAME(void) {
  volatile int i;
  i = 1;
  return;
}


x86 assembly (clang, -O0):
<MODULE_NAME>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<MODULE_NAME>:
movl   $0x1,-0x4(%rsp)
ret

LLVM IR (-O0):
define void @MODULE_NAME() {
%1 = alloca i32
store volatile i32 1, i32* %1
ret void
}

LLVM IR (-O2):
define void @MODULE_NAME() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x1e() {
  Assert_real((isodigit(30) == 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",
              155, ("isodigit should be 0 for 0x1e"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x9b,%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 0x1e\00"
define void @t_isodigit_0x1e() {
%1 = call i64 @isodigit(i32 30)
%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 155, 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 0x1e\00"
define void @t_isodigit_0x1e() {
%1 = tail call i64 @isodigit(i32 30)
%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 155, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Usage() {
  printf("\nUsage: xtemp\n");
  printf("       xtemp -h\n\n");
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"\0AUsage: xtemp\0A\00"
@.str.1 = [18 x i8] c" xtemp -h\0A\0A\00"
define void @Usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"\0AUsage: xtemp\00"
@str.2 = [17 x i8] c" xtemp -h\0A\00"
define void @Usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_length();
int main(int argc, const char *argv[]) {
  test_length();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_length()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(int /*<<< orphan*/, int, int, int, int, int, int, int);
int main(void) {
  test(0, 1, 2, 3, 4, 5, 6, 7);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
call   1030 <test@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0x7
push   $0x6
call   1030 <test@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7)
ret i32 0
}
/* Variables and functions */
int S_IROTH;
int S_IRWXG;
int S_IRWXU;
int S_IXOTH;
int /*<<< orphan*/ mkfifo(char const *, int);
int slate_CreateFIFO(const char *path) {
  return !mkfifo(path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}


x86 assembly (clang, -O0):
<slate_CreateFIFO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2e8f(%rip),%rax
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
call   1030 <mkfifo@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slate_CreateFIFO>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2eb9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
or     (%rax),%esi
mov    0x2ead(%rip),%rax
or     (%rax),%esi
call   1030 <mkfifo@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @slate_CreateFIFO(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @S_IRWXU
%5 = load i32, i32* @S_IRWXG
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IROTH
%8 = or i32 %6, %7
%9 = load i32, i32* @S_IXOTH
%10 = or i32 %8, %9
%11 = call i32 @mkfifo(i8* %3, i32 %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
@S_IRWXU = global i32 0
@S_IRWXG = global i32 0
@S_IROTH = global i32 0
@S_IXOTH = global i32 0
define i32 @slate_CreateFIFO(i8* %0) {
%2 = load i32, i32* @S_IRWXU
%3 = load i32, i32* @S_IRWXG
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IROTH
%6 = or i32 %4, %5
%7 = load i32, i32* @S_IXOTH
%8 = or i32 %6, %7
%9 = tail call i32 @mkfifo(i8* %0, i32 %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
void raw_local_irq_disable(void) { __asm__ __volatile__("cli" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @raw_local_irq_disable() {
tail call void asm sideeffect "cli", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}