xunge/DecIR huggingface dataset:
void SensorSetContrast_GC306(unsigned char val) {
  switch (val) {
  case 1:
    break;
  case 2:
    break;
  case 3:
    break;
  case 4:
    break;
  case 5:
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<SensorSetContrast_GC306>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x4,%eax
ja     114d <SensorSetContrast_GC306+0x4d>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
jmp    1152 <SensorSetContrast_GC306+0x52>
jmp    1152 <SensorSetContrast_GC306+0x52>
jmp    1152 <SensorSetContrast_GC306+0x52>
jmp    1152 <SensorSetContrast_GC306+0x52>
jmp    1152 <SensorSetContrast_GC306+0x52>
jmp    1152 <SensorSetContrast_GC306+0x52>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @SensorSetContrast_GC306(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %10 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
]
5: ; preds = %1
br label %11
6: ; preds = %1
br label %11
7: ; preds = %1
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %9, %8, %7, %6, %5
ret void
}

LLVM IR (-O2):
define void @SensorSetContrast_GC306(i8 zeroext %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int strlen(char *);
char *usage(char *argv0) {
  int size = (strlen(argv0) + strlen("Usage: [-a] [is] <pattern>") + 2);
  char *usage = (char *)malloc(size);
  snprintf(usage, size, "Usage: %s [-a] [is] <pattern>", argv0);
  return usage;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    0xeb1(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rcx
lea    0xe9c(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
call   1030 <strlen@plt>
mov    %eax,%r14d
lea    0xeb7(%rip),%rdi
call   1030 <strlen@plt>
lea    (%r14,%rax,1),%ebp
add    $0x2,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeb5(%rip),%rdx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r15,%rcx
call   1040 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: [-a] [is] <pattern>\00"
@.str.1 = [30 x i8] c"Usage: %s [-a] [is] <pattern>\00"
define i8* @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @strlen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%8 = add nsw i32 %6, %7
%9 = add nsw i32 %8, 2
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i32, i32* %3
%15 = load i8*, i8** %2
%16 = call i32 @snprintf(i8* %13, i32 %14, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: [-a] [is] <pattern>\00"
@.str.1 = [30 x i8] c"Usage: %s [-a] [is] <pattern>\00"
define i8* @usage(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = add i32 %2, 2
%5 = add i32 %4, %3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @snprintf(i8* %7, i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i8* %7
}
unsigned char hex_encode_ch(unsigned char value) {
  value = value & 0xf;
  if (value < 10)
    return '0' + value;
  else
    return 'a' - 10 + value;
}


x86 assembly (clang, -O0):
<hex_encode_ch>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1130 <hex_encode_ch+0x30>
movzbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    113a <hex_encode_ch+0x3a>
movzbl -0x2(%rbp),%eax
add    $0x57,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_encode_ch>:
and    $0xf,%dil
lea    0x30(%rdi),%eax
lea    0x57(%rdi),%ecx
cmp    $0xa,%dil
movzbl %al,%edx
movzbl %cl,%eax
cmovb  %edx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @hex_encode_ch(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = icmp ult i8 %2, 10
%4 = or i8 %2, 48
%5 = add nuw nsw i8 %2, 87
%6 = select i1 %3, i8 %4, i8 %5
ret i8 %6
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_uid;
};
struct passwd {
  int dummy;
};

/* Variables and functions */
struct passwd *getpwuid(int /*<<< orphan*/);
int check_nouser(struct stat fd_in) {
  struct passwd *userdet = NULL;
  userdet = getpwuid(fd_in.st_uid);
  if (userdet == NULL)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<check_nouser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <check_nouser+0x36>
movl   $0x1,-0x4(%rbp)
jmp    114d <check_nouser+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_nouser>:
push   %rax
call   1030 <getpwuid@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
%struct.passwd = type { i32 }
define i32 @check_nouser(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
%4 = alloca %struct.passwd*
%5 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
store i32 %0, i32* %5
store %struct.passwd* null, %struct.passwd** %4
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call %struct.passwd* @getpwuid(i32 %7)
store %struct.passwd* %8, %struct.passwd** %4
%9 = load %struct.passwd*, %struct.passwd** %4
%10 = icmp eq %struct.passwd* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define i32 @check_nouser(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ inet_pton(int /*<<< orphan*/, char const *,
                             int /*<<< orphan*/ *);
uint32_t usys_aton(const char *host) {
  uint32_t ip;
  inet_pton(AF_INET, host, &ip);
  return ip;
}


x86 assembly (clang, -O0):
<usys_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <inet_pton@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usys_aton>:
push   %rax
mov    %rdi,%rsi
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rdx
call   1030 <inet_pton@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @usys_aton(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @AF_INET
%5 = call i32 @inet_pton(i32 %4, i8* %0, i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}
void f_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @f_decref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA9_DriverIRQHandler();
__attribute__((weak)) void DMA9_IRQHandler(void) { DMA9_DriverIRQHandler(); }


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

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

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

LLVM IR (-O2):
define weak void @DMA9_IRQHandler() {
%1 = tail call i32 (...) @DMA9_DriverIRQHandler()
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t imodulo64(int64_t v1, int64_t v2) {
  int64_t v = v1 % v2;
  return (v >= 0) ? v : v + v2;
}


x86 assembly (clang, -O0):
<imodulo64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jl     1132 <imodulo64+0x32>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    113e <imodulo64+0x3e>
mov    -0x18(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imodulo64>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <imodulo64+0x16>
cqto
idiv   %rsi
jmp    111a <imodulo64+0x1a>
xor    %edx,%edx
div    %esi
mov    %rdx,%rax
sar    $0x3f,%rax
and    %rsi,%rax
add    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @imodulo64(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i64 %1, i64 0
%6 = add nsw i64 %5, %3
ret i64 %6
}
int main() {
  int arg1 = 0xAAAAAAAA;
  int arg2 = 0x02;
  int arg3 = 0x02;
  int out = 0;
  __asm__("addl %1, %1; adcl %2, %3; movl %3, %0;"
          : "=r"(out)
          : "a"(arg1), "b"(arg2), "c"(arg3));
  return out == 5;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
movl   $0x0,-0xc(%rbp)
movl   $0xaaaaaaaa,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x14(%rbp),%ebx
mov    -0x18(%rbp),%ecx
add    %eax,%eax
adc    %ebx,%ecx
mov    %ecx,%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x5,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xaaaaaaaa,%eax
mov    $0x2,%ebx
mov    $0x2,%ecx
add    %eax,%eax
adc    %ebx,%ecx
mov    %ecx,%ecx
xor    %eax,%eax
cmp    $0x5,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 -1431655766, i32* %2
store i32 2, i32* %3
store i32 2, i32* %4
store i32 0, i32* %5
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 asm "addl $1, $1; adcl $2, $3; movl $3, $0;", "=r,{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 %6, i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp eq i32 %10, 5
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "addl $1, $1; adcl $2, $3; movl $3, $0;", "=r,{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 -1431655766, i32 2, i32 2)
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void printline(long *t) {
  for (; *t; printf("%li ", *t++))
    ;
  puts("");
}


x86 assembly (clang, -O0):
<printline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1164 <printline+0x44>
jmp    113f <printline+0x1f>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
jmp    112c <printline+0xc>
lea    0xe99(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printline>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%rsi
test   %rsi,%rsi
je     1154 <printline+0x34>
mov    %rdi,%rbx
add    $0x8,%rbx
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1140 <printline+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%li \00"
define void @printline(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ %2, %1 ]
%6 = phi i64* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i64, i64* %6, i64 1
%8 = trunc i64 %5 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i64, i64* %7
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 @putchar(i32 10)
ret void
}
double double_minus(double x, double y, int index) { return x - y; }


x86 assembly (clang, -O0):
<double_minus>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_minus>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @double_minus(double %0, double %1, i32 %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @double_minus(double %0, double %1, i32 %2) {
%4 = fsub double %0, %1
ret double %4
}
float my_floor(float x) { return ((int)x); }


x86 assembly (clang, -O0):
<my_floor>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_floor>:
cvttps2dq %xmm0,%xmm0
cvtdq2ps %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @my_floor(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i32
%5 = sitofp i32 %4 to float
ret float %5
}

LLVM IR (-O2):
define float @my_floor(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
ret float %3
}
int isprint(int ch) { return (((ch >= 32) && (ch <= 126))); }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
void signalModifiedKey(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               127, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<signalModifiedKey>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x7f,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<signalModifiedKey>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x7f,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.signalModifiedKey = [18 x i8] c"signalModifiedKey\00"
define void @signalModifiedKey() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 127, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.signalModifiedKey, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.signalModifiedKey = [18 x i8] c"signalModifiedKey\00"
define void @signalModifiedKey() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 127, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.signalModifiedKey, i64 0, i64 0))
ret void
}
void test_35_0(char *mem) { __atomic_fetch_xor(mem, 1, 4); }


x86 assembly (clang, -O0):
<test_35_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0x1,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_35_0+0x4a>
jmp    111f <test_35_0+0x1f>
mov    -0x19(%rbp),%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_35_0>:
lock xorb $0x1,(%rdi)
ret

LLVM IR (-O0):
define void @test_35_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw xor i8* %5, i8 %6 acq_rel
store i8 %7, i8* %4
%8 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_35_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 1 acq_rel
ret void
}
/* Variables and functions */
int /*<<< orphan*/ core4_swap(char *, int);
void U_EMRELLIPSE_swap(char *record, int torev) { core4_swap(record, torev); }


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

x86 assembly (clang, -O2):
<U_EMRELLIPSE_swap>:
jmp    1030 <core4_swap@plt>

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

LLVM IR (-O2):
define void @U_EMRELLIPSE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core4_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
double __ieee754_log(double);
double jlog(double x) { return __ieee754_log(x); }


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

x86 assembly (clang, -O2):
<jlog>:
jmp    1030 <__ieee754_log@plt>

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

LLVM IR (-O2):
define double @jlog(double %0) {
%2 = tail call double @__ieee754_log(double %0)
ret double %2
}
int identity_either_char_to_other(void *baton, int either_char,
                                  int *other_char) {
  *other_char = either_char;
  return 1;
}


x86 assembly (clang, -O0):
<identity_either_char_to_other>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<identity_either_char_to_other>:
mov    %esi,(%rdx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @identity_either_char_to_other(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %5
%8 = load i32*, i32** %6
store i32 %7, i32* %8
ret i32 1
}

LLVM IR (-O2):
define i32 @identity_either_char_to_other(i8* nocapture readnone %0, i32 %1, i32* nocapture writeonly %2) {
store i32 %1, i32* %2
ret i32 1
}
int getBound(int in) { return ((in < 9) ? in / 3 : -1); }


x86 assembly (clang, -O0):
<getBound>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jge    1124 <getBound+0x24>
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1131 <getBound+0x31>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <getBound+0x31>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBound>:
mov    $0xffffffff,%eax
cmp    $0x8,%edi
jg     1121 <getBound+0x21>
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getBound(i32 %0) {
%2 = icmp slt i32 %0, 9
%3 = sdiv i32 %0, 3
%4 = select i1 %2, i32 %3, i32 -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void my_printf(char *str) { printf("%s", str); }


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

x86 assembly (clang, -O2):
<my_printf>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @my_printf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @my_printf(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
void f() { g(3); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    $0x3,%edi
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f() {
%1 = call i32 @g(i32 3)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = tail call i32 @g(i32 3)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int read(int, int *, int);
uint8_t getStatus(int socket) {
  uint8_t statusID = 0;
  if (socket < 0)
    return -1;
  int cnt = read(socket, &statusID, 1);
  return statusID;
}


x86 assembly (clang, -O0):
<getStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1138 <getStatus+0x28>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <getStatus+0x42>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStatus>:
push   %rax
movl   $0x0,0x4(%rsp)
test   %edi,%edi
js     1132 <getStatus+0x22>
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @getStatus(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = icmp slt i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 @read(i32 %0, i32* %2, i32 1)
%7 = load i32, i32* %2
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ -1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_it;
void X509_NAME_free(X509_NAME *a) {
  ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_it);
}


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

x86 assembly (clang, -O2):
<X509_NAME_free>:
mov    0x2ed1(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

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

LLVM IR (-O2):
@X509_NAME_it = global i32 0
define void @X509_NAME_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @X509_NAME_it)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ wcstod(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
int /*<<< orphan*/ wcstof(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
int /*<<< orphan*/ wcstold(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
void uninivar_wcstof(void) {
  const wchar_t *s;
  wchar_t **endp;
  (void)wcstof(s, endp);
  (void)wcstod(s, endp);
  (void)wcstold(s, endp);
}


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

x86 assembly (clang, -O2):
<uninivar_wcstof>:
push   %rax
call   1040 <wcstof@plt>
call   1030 <wcstod@plt>
pop    %rax
jmp    1050 <wcstold@plt>

LLVM IR (-O0):
define void @uninivar_wcstof() {
%1 = alloca i32*
%2 = alloca i32**
%3 = load i32*, i32** %1
%4 = load i32**, i32*** %2
%5 = call i32 @wcstof(i32* %3, i32** %4)
%6 = load i32*, i32** %1
%7 = load i32**, i32*** %2
%8 = call i32 @wcstod(i32* %6, i32** %7)
%9 = load i32*, i32** %1
%10 = load i32**, i32*** %2
%11 = call i32 @wcstold(i32* %9, i32** %10)
ret void
}

LLVM IR (-O2):
define void @uninivar_wcstof() {
%1 = tail call i32 @wcstof(i32* undef, i32** undef)
%2 = tail call i32 @wcstod(i32* undef, i32** undef)
%3 = tail call i32 @wcstold(i32* undef, i32** undef)
ret void
}
/* Variables and functions */
int fabsf(float);
float sinf_fast(float t) {
  static const float a = 4 / (3.14159265358979323846 * 3.14159265358979323846);
  static const float p = 0.225f;
  t = a * t * (3.14159265358979324f - fabsf(t));
  return t * (p * (fabsf(t) - 1) + 1);
}


x86 assembly (clang, -O0):
<sinf_fast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee7(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
movss  -0xc(%rbp),%xmm0
cvtsi2ss %eax,%xmm2
movss  0xebe(%rip),%xmm1
subss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabsf@plt>
movss  -0x8(%rbp),%xmm0
sub    $0x1,%eax
cvtsi2ss %eax,%xmm1
movss  0xe81(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xe79(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinf_fast>:
push   %rax
movss  0xee7(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
call   1030 <fabsf@plt>
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xecd(%rip),%xmm0
subss  %xmm1,%xmm0
mulss  0x4(%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
call   1030 <fabsf@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xeaa(%rip),%xmm0
addss  0xea6(%rip),%xmm0
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@sinf_fast.a = internal constant float 0x3FD9F02F60000000
@sinf_fast.p = internal constant float 0x3FCCCCCCC0000000
define float @sinf_fast(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 0x3FD9F02F60000000, %3
%5 = load float, float* %2
%6 = call i32 @fabsf(float %5)
%7 = sitofp i32 %6 to float
%8 = fsub float 0x400921FB60000000, %7
%9 = fmul float %4, %8
store float %9, float* %2
%10 = load float, float* %2
%11 = load float, float* %2
%12 = call i32 @fabsf(float %11)
%13 = sub nsw i32 %12, 1
%14 = sitofp i32 %13 to float
%15 = call float @llvm.fmuladd.f32(float 0x3FCCCCCCC0000000, float %14, float 1.000000e+00)
%16 = fmul float %10, %15
ret float %16
}

LLVM IR (-O2):
define float @sinf_fast(float %0) {
%2 = fmul float %0, 0x3FD9F02F60000000
%3 = tail call i32 @fabsf(float %0)
%4 = sitofp i32 %3 to float
%5 = fsub float 0x400921FB60000000, %4
%6 = fmul float %2, %5
%7 = tail call i32 @fabsf(float %6)
%8 = add nsw i32 %7, -1
%9 = sitofp i32 %8 to float
%10 = tail call float @llvm.fmuladd.f32(float %9, float 0x3FCCCCCCC0000000, float 1.000000e+00)
%11 = fmul float %6, %10
ret float %11
}
int f(int q[][3]) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @f([3 x i32]* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void help(char *pname) {
  printf("Usage: %s <source ip> <dest. ip>\n", pname);
  printf("[Use x.x.x.x format]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"Usage: %s <source ip> <dest. ip>\0A\00"
@.str.1 = [22 x i8] c"[Use x.x.x.x format]\0A\00"
define void @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"Usage: %s <source ip> <dest. ip>\0A\00"
@str = [21 x i8] c"[Use x.x.x.x format]\00"
define void @help(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int __C_isxdigit(int);
int isxdigit(int c) { return __C_isxdigit(c); }


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

x86 assembly (clang, -O2):
<isxdigit>:
jmp    1030 <__C_isxdigit@plt>

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

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = tail call i32 @__C_isxdigit(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xa1() {
  Assert_real((iscntrl(161) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              810, ("iscntrl should be 0 for 0xa1"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xa1\00"
define void @t_iscntrl_0xa1() {
%1 = tail call i64 @iscntrl(i32 161)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strstr(char *, char *);
char *str_str(char *s, char *wanted) { return strstr(s, wanted); }


x86 assembly (clang, -O0):
<str_str>:
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 <strstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_str>:
jmp    1030 <strstr@plt>

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

LLVM IR (-O2):
define i8* @str_str(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i8* %3
}
/* Variables and functions */
int clientWrite(int, char *, int);
int strlen(char *);
int clientPrint(int clientSocket, char *s) {
  int len = strlen(s);
  return clientWrite(clientSocket, s, len);
}


x86 assembly (clang, -O0):
<clientPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <clientWrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clientPrint>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <clientWrite@plt>

LLVM IR (-O0):
define i32 @clientPrint(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = call i32 @clientWrite(i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @clientPrint(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @clientWrite(i32 %0, i8* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void test_skip(char *name) { printf("skip: %s\n", name); }


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

x86 assembly (clang, -O2):
<test_skip>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"skip: %s\0A\00"
define void @test_skip(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"skip: %s\0A\00"
define void @test_skip(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("No threads, test skipped\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"No threads, test skipped\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int IoregSize();
int SramSize();
int DataLimit(void) { return 32 + IoregSize() + SramSize(); }


x86 assembly (clang, -O0):
<DataLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <IoregSize@plt>
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <SramSize@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DataLimit>:
push   %rbx
xor    %eax,%eax
call   1040 <IoregSize@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <SramSize@plt>
add    %ebx,%eax
add    $0x20,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @DataLimit() {
%1 = call i32 (...) @IoregSize()
%2 = add nsw i32 32, %1
%3 = call i32 (...) @SramSize()
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @DataLimit() {
%1 = tail call i32 (...) @IoregSize()
%2 = add nsw i32 %1, 32
%3 = tail call i32 (...) @SramSize()
%4 = add nsw i32 %2, %3
ret i32 %4
}
void check_memory_gf_crsr_c(void) {}


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

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

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

LLVM IR (-O2):
define void @check_memory_gf_crsr_c() {
ret void
}
/* Variables and functions */
int UINT16_MAX;
int hi_valid_port(int n) {
  if (n < 1 || n > UINT16_MAX) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<hi_valid_port>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1123 <hi_valid_port+0x23>
mov    -0x8(%rbp),%eax
mov    0x2ec5(%rip),%rcx
cmp    (%rcx),%eax
jle    112f <hi_valid_port+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <hi_valid_port+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_valid_port>:
test   %edi,%edi
setg   %al
mov    0x2ed4(%rip),%rcx
cmp    %edi,(%rcx)
setge  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@UINT16_MAX = global i32 0
define i32 @hi_valid_port(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @UINT16_MAX
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %12
11: ; preds = %6
store i32 1, i32* %2
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@UINT16_MAX = global i32 0
define i32 @hi_valid_port(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = load i32, i32* @UINT16_MAX
%4 = icmp sge i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
struct hash_it_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct hash_it_t *);
void hash_iterate_free(struct hash_it_t *iter_in) { free(iter_in); }


x86 assembly (clang, -O0):
<hash_iterate_free>:
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):
<hash_iterate_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.hash_it_t = type { i32 }
define void @hash_iterate_free(%struct.hash_it_t* %0) {
%2 = alloca %struct.hash_it_t*
store %struct.hash_it_t* %0, %struct.hash_it_t** %2
%3 = load %struct.hash_it_t*, %struct.hash_it_t** %2
%4 = call i32 @free(%struct.hash_it_t* %3)
ret void
}

LLVM IR (-O2):
%struct.hash_it_t = type { i32 }
define void @hash_iterate_free(%struct.hash_it_t* nocapture %0) {
%2 = tail call i32 @free(%struct.hash_it_t* %0)
ret void
}
void displayYUV_init() {}


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

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

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

LLVM IR (-O2):
define void @displayYUV_init() {
ret void
}
double StudentTP(t, df)
double t;
int df;
{ return BetaI(0.5 * df, 0.5, df / (t * t + df)); }


x86 assembly (clang, -O0):
<StudentTP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xed3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm4
cvtsi2sdl -0xc(%rbp),%xmm3
mulsd  %xmm4,%xmm1
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm2
movsd  0xea7(%rip),%xmm1
mov    $0x3,%al
call   1030 <BetaI@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StudentTP>:
push   %rax
cvtsi2sd %edi,%xmm2
movsd  0xee3(%rip),%xmm1
movapd %xmm2,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm2
movapd %xmm3,%xmm0
mov    $0x3,%al
call   1030 <BetaI@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @StudentTP(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, 5.000000e-01
%5 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%6 = fdiv double %3, %5
%7 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @BetaI to i32 (double, double, double, ...)*)(double %4, double 5.000000e-01, double %6)
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
int /*<<< orphan*/ VtolPathFollowerSettingsHandle();
void VtolPathFollowerSettingsRequestUpdate() {
  UAVObjRequestUpdate(VtolPathFollowerSettingsHandle());
}


x86 assembly (clang, -O0):
<VtolPathFollowerSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VtolPathFollowerSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VtolPathFollowerSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <VtolPathFollowerSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @VtolPathFollowerSettingsRequestUpdate() {
%1 = call i32 (...) @VtolPathFollowerSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VtolPathFollowerSettingsRequestUpdate() {
%1 = tail call i32 (...) @VtolPathFollowerSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}