xunge/DecIR huggingface dataset:
void av_display_rotation_get() {}


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

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

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

LLVM IR (-O2):
define void @av_display_rotation_get() {
ret void
}
int hpsa_phy_reset(struct sas_phy *phy, int hard_reset) { return 0; }


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

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

LLVM IR (-O0):
%struct.sas_phy = type opaque
define i32 @hpsa_phy_reset(%struct.sas_phy* %0, i32 %1) {
%3 = alloca %struct.sas_phy*
%4 = alloca i32
store %struct.sas_phy* %0, %struct.sas_phy** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.sas_phy = type opaque
define i32 @hpsa_phy_reset(%struct.sas_phy* nocapture readnone %0, i32 %1) {
ret i32 0
}
void ARGBToNV12() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToNV12() {
ret void
}
/* Type definitions */
struct lconv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
struct lconv *localeconv(void) {
  fputs("localeconv\n", stderr);
  return 0;
}


x86 assembly (clang, -O0):
<localeconv>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<localeconv>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.lconv = type { i32 }
@.str = [12 x i8] c"localeconv\0A\00"
@stderr = global i32 0
define %struct.lconv* @localeconv() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret %struct.lconv* null
}

LLVM IR (-O2):
%struct.lconv = type { i32 }
@.str = [12 x i8] c"localeconv\0A\00"
@stderr = global i32 0
define noalias %struct.lconv* @localeconv() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
ret %struct.lconv* null
}
void RSA_set_default_method(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_set_default_method() {
ret void
}
int in_array(const int c, char **uniq, const int size) {
  int i;
  for (i = 0; i < size; ++i)
    if (c == (*uniq)[i])
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<in_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1159 <in_array+0x59>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1146 <in_array+0x46>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <in_array+0x60>
jmp    114b <in_array+0x4b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <in_array+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_array>:
mov    $0xffffffff,%eax
test   %edx,%edx
jle    1131 <in_array+0x31>
mov    (%rsi),%rcx
mov    %edx,%r8d
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%rcx,%rdx,1),%esi
cmp    %edi,%esi
je     1132 <in_array+0x32>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1120 <in_array+0x20>
ret
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @in_array(i32 %0, i8** nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = load i8*, i8** %1
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %5, %14
%9 = phi i64 [ 0, %5 ], [ %15, %14 ]
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, %0
br i1 %13, label %17, label %14
14: ; preds = %8
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %19, label %8
17: ; preds = %8
%18 = trunc i64 %9 to i32
br label %19
19: ; preds = %14, %17, %3
%20 = phi i32 [ -1, %3 ], [ %18, %17 ], [ -1, %14 ]
ret i32 %20
}
/* Variables and functions */
int strlen(char const *);
char *strstr(char const *, char const *);
char *pl_strrstr(const char *buf, const char *str) {
  char *ptr, *res = NULL;
  while ((ptr = strstr(buf, str))) {
    res = ptr;
    buf = ptr + strlen(str);
  }
  return res;
}


x86 assembly (clang, -O0):
<pl_strrstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1181 <pl_strrstr+0x61>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1138 <pl_strrstr+0x18>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl_strrstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <strstr@plt>
test   %rax,%rax
je     1160 <pl_strrstr+0x40>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strstr@plt>
test   %rax,%rax
jne    1140 <pl_strrstr+0x20>
jmp    1162 <pl_strrstr+0x42>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @pl_strrstr(i8* %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = tail call i32 @strlen(i8* %1)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = tail call i8* @strstr(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = phi i8* [ null, %2 ], [ %6, %5 ]
ret i8* %13
}
long gcd(long a, long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1138 <gcd+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <gcd+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %7, %4 ], [ %1, %2 ]
%6 = phi i64 [ %5, %4 ], [ %0, %2 ]
%7 = srem i64 %6, %5
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %5, %4 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g14_cb(void *arg) { puts("GPIO_14 triggered"); }


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"GPIO_14 triggered\00"
define void @g14_cb(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i = 0;
  scanf("%d", &i);
  printf("%d\n%d\n", i * i, i * i * i);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%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 = load i32, i32* %2
%6 = mul nsw i32 %4, %5
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%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 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
char hexToAscii(const char src) {
  char tmp;
  tmp = src + '0';
  if (tmp > 57) {
    tmp += 39;
  }
  return tmp;
}


x86 assembly (clang, -O0):
<hexToAscii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jle    112b <hexToAscii+0x2b>
movsbl -0x2(%rbp),%eax
add    $0x27,%eax
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexToAscii>:
lea    0x30(%rdi),%eax
add    $0x57,%dil
cmp    $0x3a,%al
movzbl %dil,%ecx
movzbl %al,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @hexToAscii(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = add nsw i32 %5, 48
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, 39
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
br label %16
16: ; preds = %11, %1
%17 = load i8, i8* %3
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @hexToAscii(i8 signext %0) {
%2 = add i8 %0, 48
%3 = icmp sgt i8 %2, 57
%4 = add i8 %0, 87
%5 = select i1 %3, i8 %4, i8 %2
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ is_hex_padded(char *);
char *is_hex_padded_02b() {
  char hex[] =
      "0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3";
  do {
    if (!(is_hex_padded(hex)))
      return "return true if hex string starts with '0X'";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<is_hex_padded_02b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x43,%edx
call   1030 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1040 <is_hex_padded@plt>
cmp    $0x0,%eax
jne    115f <is_hex_padded_02b+0x3f>
lea    0xeed(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <is_hex_padded_02b+0x4c>
jmp    1164 <is_hex_padded_02b+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_padded_02b>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x334132,0x3f(%rsp)
mov    %rsp,%rdi
call   1030 <is_hex_padded@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xee5(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.is_hex_padded_02b.hex = [67 x i8] c"0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [43 x i8] c"return true if hex string starts with '0X'\00"
define i8* @is_hex_padded_02b() {
%1 = alloca i8*
%2 = alloca [67 x i8]
%3 = bitcast [67 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [67 x i8], [67 x i8]* %2, i64 0, i64 0
%6 = call i32 @is_hex_padded(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.is_hex_padded_02b.hex = [67 x i8] c"0XB300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [43 x i8] c"return true if hex string starts with '0X'\00"
define i8* @is_hex_padded_02b() {
%1 = alloca [67 x i8]
%2 = getelementptr inbounds [67 x i8], [67 x i8]* %1, i64 0, i64 0
%3 = call i32 @is_hex_padded(i8* %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %5
}
int main() {
  volatile int zero = 0;
  return 4 / zero;
}


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

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
mov    $0x4,%eax
xor    %edx,%edx
idivl  -0x4(%rsp)
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = sdiv i32 4, %3
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t clipp(double x) {
  if (x < 0.0)
    return 0;
  else if (x > 255.0)
    return 255;
  else
    return x;
}


x86 assembly (clang, -O0):
<clipp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1123 <clipp+0x23>
movl   $0x0,-0x4(%rbp)
jmp    114e <clipp+0x4e>
movsd  -0x10(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <clipp+0x46>
movl   $0xff,-0x4(%rbp)
jmp    114e <clipp+0x4e>
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clipp>:
xor    %eax,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
ja     111f <clipp+0x1f>
mov    $0xff,%eax
ucomisd 0xee7(%rip),%xmm0
ja     111f <clipp+0x1f>
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @clipp(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %14
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 2.550000e+02
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 255, i32* %2
br label %14
11: ; preds = %7
%12 = load double, double* %3
%13 = fptosi double %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @clipp(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 2.550000e+02
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = fptosi double %0 to i32
br label %7
7: ; preds = %3, %1, %5
%8 = phi i32 [ %6, %5 ], [ 0, %1 ], [ 255, %3 ]
ret i32 %8
}
int init_data(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @init_data() {
ret i32 0
}

LLVM IR (-O2):
define i32 @init_data() {
ret i32 0
}
/* Variables and functions */
bool nrf52_errata_183(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_183() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_183() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ odwroc(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int main(void) {
  char c[10];
  printf("Podaj napis: ");
  fgets(c, 10, stdin);
  odwroc(c);
  printf("%s\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa(%rbp),%rdi
mov    0x2e97(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1050 <fgets@plt>
lea    -0xa(%rbp),%rdi
call   1030 <odwroc@plt>
lea    -0xa(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1040 <odwroc@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Podaj napis: \00"
@stdin = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %3, i32 10, i32 %4)
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%7 = call i32 @odwroc(i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Podaj napis: \00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 10, i32 %4)
%6 = call i32 @odwroc(i8* %2)
%7 = call i32 @puts(i8* %2)
ret i32 0
}
/* Type definitions */
struct ql_adapter {
  int dummy;
};

/* Variables and functions */
int ql_write_mpi_reg(struct ql_adapter *, int, int);
int ql_soft_reset_mpi_risc(struct ql_adapter *qdev) {
  int status;
  status = ql_write_mpi_reg(qdev, 0x00001010, 1);
  return status;
}


x86 assembly (clang, -O0):
<ql_soft_reset_mpi_risc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1010,%esi
mov    $0x1,%edx
call   1030 <ql_write_mpi_reg@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ql_soft_reset_mpi_risc>:
mov    $0x1010,%esi
mov    $0x1,%edx
jmp    1030 <ql_write_mpi_reg@plt>

LLVM IR (-O0):
%struct.ql_adapter = type { i32 }
define i32 @ql_soft_reset_mpi_risc(%struct.ql_adapter* %0) {
%2 = alloca %struct.ql_adapter*
%3 = alloca i32
store %struct.ql_adapter* %0, %struct.ql_adapter** %2
%4 = load %struct.ql_adapter*, %struct.ql_adapter** %2
%5 = call i32 @ql_write_mpi_reg(%struct.ql_adapter* %4, i32 4112, i32 1)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.ql_adapter = type { i32 }
define i32 @ql_soft_reset_mpi_risc(%struct.ql_adapter* %0) {
%2 = tail call i32 @ql_write_mpi_reg(%struct.ql_adapter* %0, i32 4112, i32 1)
ret i32 %2
}
void utilStrRmChars(char *str, int cnt) {
  do {
    *str = str[cnt];
  } while (*str++);
}


x86 assembly (clang, -O0):
<utilStrRmChars>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    110b <utilStrRmChars+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilStrRmChars>:
movslq %esi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rdi,%rax,1),%ecx
mov    %cl,(%rdi)
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <utilStrRmChars+0x10>
ret

LLVM IR (-O0):
define void @utilStrRmChars(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %12, %2
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = load i8*, i8** %3
store i8 %10, i8* %11
br label %12
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = icmp ne i8 %15, 0
br i1 %16, label %5, label %17
17: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @utilStrRmChars(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i8* [ %0, %2 ], [ %8, %4 ]
%6 = getelementptr inbounds i8, i8* %5, i64 %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = getelementptr inbounds i8, i8* %5, i64 1
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %4
10: ; preds = %4
ret void
}
void pm_wdt_ping(unsigned v) {}


x86 assembly (clang, -O0):
<pm_wdt_ping>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @pm_wdt_ping(i32 %0) {
ret void
}
int number(s) const char *s;
{
  if (!is_number(s))
    error2("Illegal number", (char *)s);
  return atoi(s);
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <is_number@plt>
cmp    $0x0,%eax
jne    1162 <number+0x32>
mov    -0x8(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <error2@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <is_number@plt>
test   %eax,%eax
jne    1150 <number+0x20>
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <error2@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1050 <atoi@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Illegal number\00"
define i32 @number(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @is_number to i32 (i8*, ...)*)(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2 to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"Illegal number\00"
define i32 @number(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_number to i32 (i8*, ...)*)(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @error2 to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %0)
ret i32 %7
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ispeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
speed_t cfgetispeed(const struct termios *termios) { return termios->c_ispeed; }


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @cfgetispeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @cfgetispeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xca() {
  Assert_real((iscntrl(202) == 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",
              1015, ("iscntrl should be 0 for 0xca"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xca>:
push   %rax
mov    $0xca,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3f7,%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 0xca\00"
define void @t_iscntrl_0xca() {
%1 = call i64 @iscntrl(i32 202)
%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 1015, 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 0xca\00"
define void @t_iscntrl_0xca() {
%1 = tail call i64 @iscntrl(i32 202)
%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 1015, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *match(char *source, char *str) {
  while (*str != '\0')
    if (*source++ != *str++)
      return NULL;
  return source;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115a <match+0x5a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1155 <match+0x55>
movq   $0x0,-0x8(%rbp)
jmp    1162 <match+0x62>
jmp    110c <match+0xc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rsi),%ecx
test   %cl,%cl
je     1128 <match+0x28>
lea    0x1(%rax),%rdx
add    $0x1,%rsi
cmp    %cl,(%rax)
mov    %rdx,%rax
je     1110 <match+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @match(i8* %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %11, %8 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = icmp eq i8 %10, %6
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i8* [ null, %8 ], [ %4, %3 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void quit(int signal) {
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @endwin()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit(i32 %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
float strlen(char *);
float scorefactor(char *stringa, char *stringb) {
  return 1;
  float result = 0;
  float lenga = strlen(stringa);
  float lengb = strlen(stringb);
  if (lenga > lengb) {
    result = lengb / lenga;
  } else {
    result = lenga / lengb;
  }
  return result;
}


x86 assembly (clang, -O0):
<scorefactor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xeec(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scorefactor>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @scorefactor(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
ret float 1.000000e+00
}

LLVM IR (-O2):
define float @scorefactor(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret float 1.000000e+00
}
/* Type definitions */
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit1(struct jit_state *, int);
int /*<<< orphan*/ emit_load_imm(struct jit_state *, int /*<<< orphan*/,
                                 uintptr_t);
void emit_call(struct jit_state *state, void *target) {
  emit_load_imm(state, 0, (uintptr_t)target);
  emit1(state, 0xff);
  emit1(state, 0xd0);
}


x86 assembly (clang, -O0):
<emit_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <emit_load_imm@plt>
mov    -0x8(%rbp),%rdi
mov    $0xff,%esi
call   1030 <emit1@plt>
mov    -0x8(%rbp),%rdi
mov    $0xd0,%esi
call   1030 <emit1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_call>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <emit_load_imm@plt>
mov    %rbx,%rdi
mov    $0xff,%esi
call   1030 <emit1@plt>
mov    %rbx,%rdi
mov    $0xd0,%esi
pop    %rbx
jmp    1030 <emit1@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_call(%struct.jit_state* %0, i8* %1) {
%3 = alloca %struct.jit_state*
%4 = alloca i8*
store %struct.jit_state* %0, %struct.jit_state** %3
store i8* %1, i8** %4
%5 = load %struct.jit_state*, %struct.jit_state** %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = call i32 @emit_load_imm(%struct.jit_state* %5, i32 0, i64 %7)
%9 = load %struct.jit_state*, %struct.jit_state** %3
%10 = call i32 @emit1(%struct.jit_state* %9, i32 255)
%11 = load %struct.jit_state*, %struct.jit_state** %3
%12 = call i32 @emit1(%struct.jit_state* %11, i32 208)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_call(%struct.jit_state* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = tail call i32 @emit_load_imm(%struct.jit_state* %0, i32 0, i64 %3)
%5 = tail call i32 @emit1(%struct.jit_state* %0, i32 255)
%6 = tail call i32 @emit1(%struct.jit_state* %0, i32 208)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkdir(char *, int /*<<< orphan*/);
int fs_mkdir(char *path, int mode) { return mkdir(path, (mode_t)mode); }


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

x86 assembly (clang, -O2):
<fs_mkdir>:
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @fs_mkdir(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t eeprom_read_dword(const uint32_t *addr) {
  uint32_t offset = (uint32_t)addr;
  if (offset >= 2048 - 3)
    return 0;
  return *(uint32_t *)(&((uint8_t *)0x14000000)[offset]);
}


x86 assembly (clang, -O0):
<eeprom_read_dword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x7fd,-0x14(%rbp)
jl     1128 <eeprom_read_dword+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1137 <eeprom_read_dword+0x37>
movslq -0x14(%rbp),%rcx
mov    $0x14000000,%eax
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_read_dword>:
xor    %eax,%eax
cmp    $0x7fc,%edi
jg     1114 <eeprom_read_dword+0x14>
movslq %edi,%rax
mov    0x14000000(,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @eeprom_read_dword(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = ptrtoint i32* %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2045
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* inttoptr (i64 335544320 to i32*), i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %2
br label %15
15: ; preds = %10, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @eeprom_read_dword(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 2044
br i1 %4, label %10, label %5
5: ; preds = %1
%6 = shl i64 %2, 32
%7 = ashr exact i64 %6, 32
%8 = getelementptr inbounds i32, i32* inttoptr (i64 335544320 to i32*), i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %5
%11 = phi i32 [ %9, %5 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int getpid();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void child_code(int dely) {
  printf("child %d here. will sleep for %d seconds\n", getpid(), dely);
  sleep(dely);
  printf("child done, about to exit\n");
  exit(17);
}


x86 assembly (clang, -O0):
<child_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1060 <sleep@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x11,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<child_code>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe9f(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1070 <sleep@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x11,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"child %d here. will sleep for %d seconds\0A\00"
@.str.1 = [27 x i8] c"child done, about to exit\0A\00"
define void @child_code(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @getpid()
%4 = load i32, i32* %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @sleep(i32 %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 17)
unreachable
}

LLVM IR (-O2):
@.str = [42 x i8] c"child %d here. will sleep for %d seconds\0A\00"
@str = [26 x i8] c"child done, about to exit\00"
define void @child_code(i32 %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
%4 = tail call i32 @sleep(i32 %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 17)
unreachable
}
int test_imm_43int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x43 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_43int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x43,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_43int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 287762808832
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank4Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m22_SetChrROMBank4();
void m22_setParamsDXX0(uint16_t addr, uint8_t val) {
  __setCHRBank4Low(addr, val);
  m22_SetChrROMBank4();
}


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

x86 assembly (clang, -O2):
<m22_setParamsDXX0>:
push   %rax
call   1030 <__setCHRBank4Low@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <m22_SetChrROMBank4@plt>

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

LLVM IR (-O2):
define void @m22_setParamsDXX0(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank4Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @m22_SetChrROMBank4()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enter_first_dir();
int /*<<< orphan*/ go_to_dir(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ set_cwd(char const *);
void process_dir_arg(const char *dir) {
  set_cwd(dir);
  if (!go_to_dir(NULL, 0))
    enter_first_dir();
}


x86 assembly (clang, -O0):
<process_dir_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <set_cwd@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1040 <go_to_dir@plt>
cmp    $0x0,%eax
jne    1160 <process_dir_arg+0x30>
mov    $0x0,%al
call   1050 <enter_first_dir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_dir_arg>:
push   %rax
call   1030 <set_cwd@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1040 <go_to_dir@plt>
test   %eax,%eax
je     1145 <process_dir_arg+0x15>
pop    %rax
ret
xor    %eax,%eax
pop    %rcx
jmp    1050 <enter_first_dir@plt>

LLVM IR (-O0):
define void @process_dir_arg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @set_cwd(i8* %3)
%5 = call i32 @go_to_dir(i32* null, i32 0)
%6 = icmp ne i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 (...) @enter_first_dir()
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @process_dir_arg(i8* %0) {
%2 = tail call i32 @set_cwd(i8* %0)
%3 = tail call i32 @go_to_dir(i32* null, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @enter_first_dir()
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
char *environ_exit_application_name(char *);
char *environ_get_application_name(char *argv_0) {
  return environ_exit_application_name(argv_0);
}


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

x86 assembly (clang, -O2):
<environ_get_application_name>:
jmp    1030 <environ_exit_application_name@plt>

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

LLVM IR (-O2):
define i8* @environ_get_application_name(i8* %0) {
%2 = tail call i8* @environ_exit_application_name(i8* %0)
ret i8* %2
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ epoll34(struct __test_metadata *);
void wrapper_epoll34(struct __test_metadata *_metadata,
                     struct __fixture_variant_metadata *variant) {
  epoll34(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_epoll34>:
jmp    1030 <epoll34@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll34(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @epoll34(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_epoll34(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @epoll34(%struct.__test_metadata* %0)
ret void
}