xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_gr_fill_rect() { exit(1); }


x86 assembly (clang, -O0):
<caml_gr_fill_rect>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_gr_fill_rect>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_gr_fill_rect() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_gr_fill_rect() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
long labs(long j) {
  if (j < 0) {
    return -j;
  } else {
    return j;
  }
}


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    112a <labs+0x2a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = sub nsw i64 0, %7
store i64 %8, i64* %2
br label %11
9: ; preds = %1
%10 = load i64, i64* %3
store i64 %10, i64* %2
br label %11
11: ; preds = %9, %6
%12 = load i64, i64* %2
ret i64 %12
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
void test_no_args() {}


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

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

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

LLVM IR (-O2):
define void @test_no_args() {
ret void
}
void chrreplace(char *source, char old, char new) {
  while (*source) {
    if (source[0] == old)
      source[0] = new;
    source++;
  }
}


x86 assembly (clang, -O0):
<chrreplace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114d <chrreplace+0x4d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113c <chrreplace+0x3c>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <chrreplace+0x13>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @chrreplace(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %11
%7 = phi i8 [ %13, %11 ], [ %4, %3 ]
%8 = phi i8* [ %12, %11 ], [ %0, %3 ]
%9 = icmp eq i8 %7, %1
br i1 %9, label %10, label %11
10: ; preds = %6
store i8 %2, i8* %8
br label %11
11: ; preds = %10, %6
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %11, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int a, b, c;
  a = b = c = 1024;
  printf("%d %d %d\n", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x400,-0x10(%rbp)
movl   $0x400,-0xc(%rbp)
movl   $0x400,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xebc(%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
mov    $0x400,%esi
mov    $0x400,%edx
mov    $0x400,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1024, i32 1024, i32 1024)
ret i32 0
}
/* Type definitions */
struct option_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ optionlist_destroy(struct option_t *);
void config_destroy_optionlist(struct option_t *olist) {
  optionlist_destroy(olist);
}


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

x86 assembly (clang, -O2):
<config_destroy_optionlist>:
jmp    1030 <optionlist_destroy@plt>

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

LLVM IR (-O2):
%struct.option_t = type { i32 }
define void @config_destroy_optionlist(%struct.option_t* %0) {
%2 = tail call i32 @optionlist_destroy(%struct.option_t* %0)
ret void
}
/* Variables and functions */
size_t binarytree_tests(int, char **);
int main(int argc, char *argv[argc + 1]) {
  const size_t results = binarytree_tests(argc, argv);
  return results != 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <binarytree_tests@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i64 @binarytree_tests(i32 %0, i8** %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int bytes_to_int32(const int bytes) { return (((bytes) + 3) >> 2); }


x86 assembly (clang, -O0):
<bytes_to_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytes_to_int32>:
lea    0x3(%rdi),%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @bytes_to_int32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 3
%5 = ashr i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @bytes_to_int32(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = ashr i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int f201(int *);
int f202(int *p) { return f201(p); }


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

x86 assembly (clang, -O2):
<f202>:
jmp    1030 <f201@plt>

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

LLVM IR (-O2):
define i32 @f202(i32* %0) {
%2 = tail call i32 @f201(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ setConsoleLogging(int);
int /*<<< orphan*/ setFileLogging(char *, int, int /*<<< orphan*/);
void initLog(char *filename, int filelevel, char *s00, char *s01, int s02,
             int screenlevel) {
  setFileLogging(filename, filelevel, 0);
  setConsoleLogging(screenlevel);
}


x86 assembly (clang, -O0):
<initLog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
call   1040 <setFileLogging@plt>
mov    -0x28(%rbp),%edi
call   1030 <setConsoleLogging@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initLog>:
push   %rbx
mov    %r9d,%ebx
xor    %edx,%edx
call   1040 <setFileLogging@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <setConsoleLogging@plt>

LLVM IR (-O0):
define void @initLog(i8* %0, i32 %1, i8* %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @setFileLogging(i8* %13, i32 %14, i32 0)
%16 = load i32, i32* %12
%17 = call i32 @setConsoleLogging(i32 %16)
ret void
}

LLVM IR (-O2):
define void @initLog(i8* %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4, i32 %5) {
%7 = tail call i32 @setFileLogging(i8* %0, i32 %1, i32 0)
%8 = tail call i32 @setConsoleLogging(i32 %5)
ret void
}
unsigned short bswap_16(unsigned short val) {
  return ((val & 0xff) << 8) | ((val >> 8) & 0xff);
}


x86 assembly (clang, -O0):
<bswap_16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
movzwl -0x2(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bswap_16>:
mov    %edi,%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 255
%6 = shl i32 %5, 8
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = and i32 %9, 255
%11 = or i32 %6, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @bswap_16(i16 zeroext %0) {
%2 = tail call i16 @llvm.bswap.i16(i16 %0)
ret i16 %2
}
int bitcount(int number) {
  int bits = 0;
  while (number) {
    number &= (number - 1);
    bits += 1;
  }
  return bits;
}


x86 assembly (clang, -O0):
<bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <bitcount+0x32>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bitcount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %5, -1
%7 = and i32 %6, %5
%8 = add nuw nsw i32 %4, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ isdigit(unsigned char);
char tolower(unsigned char);
unsigned char from_hex(unsigned char ch) {
  return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
}


x86 assembly (clang, -O0):
<from_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1150 <from_hex+0x30>
movzbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1165 <from_hex+0x45>
movzbl -0x1(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_hex>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <from_hex+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movzbl %bl,%edi
call   1040 <tolower@plt>
add    $0xa9,%al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @from_hex(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isdigit(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = sub nsw i32 %8, 48
br label %16
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 zeroext %11)
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
%15 = add nsw i32 %14, 10
br label %16
16: ; preds = %10, %6
%17 = phi i32 [ %9, %6 ], [ %15, %10 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @from_hex(i8 zeroext %0) {
%2 = tail call i64 @isdigit(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %9
6: ; preds = %1
%7 = tail call signext i8 @tolower(i8 zeroext %0)
%8 = add i8 %7, -87
br label %9
9: ; preds = %6, %4
%10 = phi i8 [ %5, %4 ], [ %8, %6 ]
ret i8 %10
}
/* Type definitions */
typedef scalar_t__ time_t;

/* Variables and functions */
double difftime(time_t time2, time_t time1) { return (double)(time2 - time1); }


x86 assembly (clang, -O0):
<difftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftime>:
sub    %rsi,%rdi
cvtsi2sd %rdi,%xmm0
ret

LLVM IR (-O0):
define double @difftime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @difftime(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = sitofp i64 %3 to double
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
bool strcpy_safer(char *dst, const char *src, size_t size) {
  if (strlen(src) + 1 > size)
    return false;
  strcpy(dst, src);
  return true;
}


x86 assembly (clang, -O0):
<strcpy_safer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
cltq
cmp    -0x20(%rbp),%rax
jbe    1158 <strcpy_safer+0x38>
movl   $0x0,-0x4(%rbp)
jmp    116c <strcpy_safer+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_safer>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rcx
xor    %eax,%eax
cmp    %r15,%rcx
ja     1153 <strcpy_safer+0x33>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @strcpy_safer(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = icmp ugt i64 %6, %2
br i1 %7, label %10, label %8
8: ; preds = %3
%9 = tail call i32 @strcpy(i8* %0, i8* %1)
br label %10
10: ; preds = %3, %8
%11 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int f_bright() { return fputs("[1m", stdout); }


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

x86 assembly (clang, -O2):
<f_bright>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[1m\00"
@stdout = global i32 0
define i32 @f_bright() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[1m\00"
@stdout = global i32 0
define i32 @f_bright() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ lcd_draw_pixel(int, int, int);
void lcd_draw_hline(int row, int col1, int col2, int color) {
  int j;
  for (j = col1; j <= col2; j++)
    lcd_draw_pixel(row, j, color);
}


x86 assembly (clang, -O0):
<lcd_draw_hline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1152 <lcd_draw_hline+0x42>
mov    -0x4(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <lcd_draw_pixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <lcd_draw_hline+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_draw_hline>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jg     1144 <lcd_draw_hline+0x34>
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r15d
add    $0x1,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
mov    %ebx,%esi
mov    %r14d,%edx
call   1030 <lcd_draw_pixel@plt>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <lcd_draw_hline+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @lcd_draw_hline(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %1, %2
br i1 %5, label %11, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %1, %4 ]
%8 = tail call i32 @lcd_draw_pixel(i32 %0, i32 %7, i32 %3)
%9 = add i32 %7, 1
%10 = icmp eq i32 %7, %2
br i1 %10, label %11, label %6
11: ; preds = %6, %4
ret void
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int isdigit(int);
int iswdigit(wint_t c) { return c <= 255 ? isdigit(c) : 0; }


x86 assembly (clang, -O0):
<iswdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1138 <iswdigit+0x28>
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %eax,-0x8(%rbp)
jmp    1142 <iswdigit+0x32>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <iswdigit+0x32>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @iswdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct Node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kthLargestUtil(struct Node *, int, int *);
void kthLargest(struct Node *root, int k) {
  int c = 0;
  kthLargestUtil(root, k, &c);
}


x86 assembly (clang, -O0):
<kthLargest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1030 <kthLargestUtil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kthLargest>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
call   1030 <kthLargestUtil@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
define void @kthLargest(%struct.Node* %0, i32 %1) {
%3 = alloca %struct.Node*
%4 = alloca i32
%5 = alloca i32
store %struct.Node* %0, %struct.Node** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = load %struct.Node*, %struct.Node** %3
%7 = load i32, i32* %4
%8 = call i32 @kthLargestUtil(%struct.Node* %6, i32 %7, i32* %5)
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
define void @kthLargest(%struct.Node* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @kthLargestUtil(%struct.Node* %0, i32 %1, i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inkey();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basInkey() { pushNumber(inkey()); }


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

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

LLVM IR (-O0):
define void @basInkey() {
%1 = call i32 (...) @inkey()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basInkey() {
%1 = tail call i32 (...) @inkey()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x0c() {
  Assert_real((isalpha(12) == 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_isalpha.c",
              65, ("isalpha should be 0 for 0x0c"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x0c>:
push   %rax
mov    $0xc,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x0c\00"
define void @t_isalpha_0x0c() {
%1 = call i64 @isalpha(i32 12)
%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 65, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x0c\00"
define void @t_isalpha_0x0c() {
%1 = tail call i64 @isalpha(i32 12)
%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 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nc_clearall();
void ui_clear(void) { nc_clearall(); }


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

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

LLVM IR (-O0):
define void @ui_clear() {
%1 = call i32 (...) @nc_clearall()
ret void
}

LLVM IR (-O2):
define void @ui_clear() {
%1 = tail call i32 (...) @nc_clearall()
ret void
}
int jestePerioda(int n, int x[], int T) {
  int i;
  for (i = 0; i < n - T; i++)
    if (x[i] != x[i + T])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<jestePerioda>:
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
mov    -0x8(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1166 <jestePerioda+0x66>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    -0x14(%rbp),%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
je     1153 <jestePerioda+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116d <jestePerioda+0x6d>
jmp    1158 <jestePerioda+0x58>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <jestePerioda+0x15>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jestePerioda>:
sub    %edx,%edi
mov    $0x1,%eax
test   %edi,%edi
jle    1131 <jestePerioda+0x31>
movslq %edx,%rdx
mov    %edi,%r8d
lea    (%rsi,%rdx,4),%rdx
xor    %edi,%edi
nopw   0x0(%rax,%rax,1)
mov    (%rsi,%rdi,4),%ecx
cmp    (%rdx,%rdi,4),%ecx
jne    1132 <jestePerioda+0x32>
add    $0x1,%rdi
cmp    %rdi,%r8
jne    1120 <jestePerioda+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jestePerioda(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sub i32 %0, %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = sext i32 %2 to i64
%8 = zext i32 %4 to i64
br label %11
9: ; preds = %11
%10 = icmp eq i64 %19, %8
br i1 %10, label %20, label %11
11: ; preds = %6, %9
%12 = phi i64 [ 0, %6 ], [ %19, %9 ]
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
%15 = add nsw i64 %12, %7
%16 = getelementptr inbounds i32, i32* %1, i64 %15
%17 = load i32, i32* %16
%18 = icmp eq i32 %14, %17
%19 = add nuw nsw i64 %12, 1
br i1 %18, label %9, label %20
20: ; preds = %11, %9, %3
%21 = phi i32 [ 1, %3 ], [ 1, %9 ], [ 0, %11 ]
ret i32 %21
}
/* Variables and functions */
int /*<<< orphan*/ k_error(int /*<<< orphan*/);
int /*<<< orphan*/ sysmsg(int);
void k_illegal_call_name() { k_error(sysmsg(1130)); }


x86 assembly (clang, -O0):
<k_illegal_call_name>:
push   %rbp
mov    %rsp,%rbp
mov    $0x46a,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
call   1040 <k_error@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_illegal_call_name>:
push   %rax
mov    $0x46a,%edi
call   1030 <sysmsg@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <k_error@plt>

LLVM IR (-O0):
define void @k_illegal_call_name() {
%1 = call i32 @sysmsg(i32 1130)
%2 = call i32 @k_error(i32 %1)
ret void
}

LLVM IR (-O2):
define void @k_illegal_call_name() {
%1 = tail call i32 @sysmsg(i32 1130)
%2 = tail call i32 @k_error(i32 %1)
ret void
}
void XSyncListSystemCounters() {}


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

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

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

LLVM IR (-O2):
define void @XSyncListSystemCounters() {
ret void
}
/* Variables and functions */
char *caesar(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char text[] = "The quick brown fox jumps over the lazy dog.";
  printf("%s\n", caesar(text, 13));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2d,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1040 <caesar@plt>
mov    %rax,%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xef2(%rip),%xmm0
movups %xmm0,0x1d(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xd,%esi
call   1040 <caesar@plt>
lea    0xed2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.text = [45 x i8] c"The quick brown fox jumps over the lazy dog.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [45 x i8]
store i32 0, i32* %1
%3 = bitcast [45 x i8]* %2 to i8*
%4 = getelementptr inbounds [45 x i8], [45 x i8]* %2, i64 0, i64 0
%5 = call i8* @caesar(i8* %4, i32 13)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.text = [45 x i8] c"The quick brown fox jumps over the lazy dog.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [45 x i8]
%2 = getelementptr inbounds [45 x i8], [45 x i8]* %1, i64 0, i64 0
%3 = call i8* @caesar(i8* %2, i32 13)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int test_imm_C4int16_reg(short val) {
  return ((val) & (-0xC4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C4int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff3c,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4int16_reg>:
test   $0xff3c,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C4int16_reg(i16 signext %0) {
%2 = and i16 %0, -196
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void *malloc(int);
int /*<<< orphan*/ printf(char *);
void *xmalloc(int size) {
  void *res;
  res = malloc(size);
  if (res == NULL) {
    printf("Memory allocation fail !\n");
    exit(EXIT_FAILURE);
  }
  return (res);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116c <xmalloc+0x3c>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Memory allocation fail !\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@str = [25 x i8] c"Memory allocation fail !\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
const char *str_expr__Generic() { return "_Generic"; }


x86 assembly (clang, -O0):
<str_expr__Generic>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_expr__Generic>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [9 x i8] c"_Generic\00"
define i8* @str_expr__Generic() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [9 x i8] c"_Generic\00"
define i8* @str_expr__Generic() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int test_tagged_typedef_bitmask2(int val) { return val; }


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

x86 assembly (clang, -O2):
<test_tagged_typedef_bitmask2>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_tagged_typedef_bitmask2(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
unsigned long callthru4(int, unsigned long, unsigned long, unsigned long,
                        unsigned long);
unsigned long bogus_socket_conn_recv(int dev, void *addr, int maxlen,
                                     int conn) {
  return callthru4(226, (unsigned long)dev, (unsigned long)addr,
                   (unsigned long)maxlen, (unsigned long)conn);
}


x86 assembly (clang, -O0):
<bogus_socket_conn_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movslq -0x4(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rcx
movslq -0x18(%rbp),%r8
mov    $0xe2,%edi
call   1030 <callthru4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bogus_socket_conn_recv>:
mov    %rsi,%r9
movslq %edi,%rsi
movslq %edx,%rax
movslq %ecx,%r8
mov    $0xe2,%edi
mov    %r9,%rdx
mov    %rax,%rcx
jmp    1030 <callthru4@plt>

LLVM IR (-O0):
define i64 @bogus_socket_conn_recv(i32 %0, i8* %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = load i32, i32* %8
%16 = sext i32 %15 to i64
%17 = call i64 @callthru4(i32 226, i64 %10, i64 %12, i64 %14, i64 %16)
ret i64 %17
}

LLVM IR (-O2):
define i64 @bogus_socket_conn_recv(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = sext i32 %0 to i64
%6 = ptrtoint i8* %1 to i64
%7 = sext i32 %2 to i64
%8 = sext i32 %3 to i64
%9 = tail call i64 @callthru4(i32 226, i64 %5, i64 %6, i64 %7, i64 %8)
ret i64 %9
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ fork();
scalar_t__ malloc(int);
int /*<<< orphan*/ wait(int);
int dodo() {
  int *asdr = (int *)malloc(123123);
  pid_t pid1 = fork();
  pid_t pid2 = fork();
  if (pid1 == 0)
    dodo();
  if (pid2 == 0)
    dodo();
  wait(1);
}


x86 assembly (clang, -O0):
<dodo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1e0f3,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <fork@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117c <dodo+0x3c>
call   1030 <dodo@plt>
cmpq   $0x0,-0x20(%rbp)
jne    118c <dodo+0x4c>
call   1030 <dodo@plt>
mov    $0x1,%edi
call   1050 <wait@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dodo>:
push   %r14
push   %rbx
push   %rax
mov    $0x1e0f3,%edi
call   1040 <malloc@plt>
xor    %eax,%eax
call   1060 <fork@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <fork@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     117d <dodo+0x3d>
test   %r14,%r14
je     1187 <dodo+0x47>
mov    $0x1,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <wait@plt>
call   1030 <dodo@plt>
test   %r14,%r14
jne    116c <dodo+0x2c>
call   1030 <dodo@plt>
jmp    116c <dodo+0x2c>

LLVM IR (-O0):
define i32 @dodo() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
%5 = call i64 @malloc(i32 123123)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %2
%7 = call i64 (...) @fork()
store i64 %7, i64* %3
%8 = call i64 (...) @fork()
store i64 %8, i64* %4
%9 = load i64, i64* %3
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @dodo()
br label %13
13: ; preds = %11, %0
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @dodo()
br label %18
18: ; preds = %16, %13
%19 = call i32 @wait(i32 1)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @dodo() {
%1 = tail call i64 @malloc(i32 123123)
%2 = tail call i64 (...) @fork()
%3 = tail call i64 (...) @fork()
%4 = icmp eq i64 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @dodo()
br label %7
7: ; preds = %5, %0
%8 = icmp eq i64 %3, 0
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @dodo()
br label %11
11: ; preds = %9, %7
%12 = tail call i32 @wait(i32 1)
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int mvwprintw(int /*<<< orphan*/ *, int, int, char const *, long);
int l_mvwprintw(WINDOW *win, int y, int x, const char *fmt, long i) {
  return (mvwprintw(win, y, x, fmt, i));
}


x86 assembly (clang, -O0):
<l_mvwprintw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <mvwprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_mvwprintw>:
jmp    1030 <mvwprintw@plt>

LLVM IR (-O0):
define i32 @l_mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3, i64 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = call i32 @mvwprintw(i32* %11, i32 %12, i32 %13, i8* %14, i64 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @l_mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3, i64 %4) {
%6 = tail call i32 @mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3, i64 %4)
ret i32 %6
}
void test_file_is_not_recognized_as_dir(void) {
  do {
    seatest_assert_false(is_dir("test-data/existing-files/a"), __FUNCTION__, 8);
  } while (0);
}


x86 assembly (clang, -O0):
<test_file_is_not_recognized_as_dir>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test_file_is_not_recognized_as_dir+0x9>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <is_dir@plt>
mov    %eax,%edi
lea    0xedb(%rip),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <seatest_assert_false@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_file_is_not_recognized_as_dir>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <is_dir@plt>
lea    0xee5(%rip),%rsi
mov    %eax,%edi
mov    $0x8,%edx
xor    %eax,%eax
pop    %rcx
jmp    1040 <seatest_assert_false@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"test-data/existing-files/a\00"
@__FUNCTION__.test_file_is_not_recognized_as_dir = [35 x i8] c"test_file_is_not_recognized_as_dir\00"
define void @test_file_is_not_recognized_as_dir() {
br label %1
1: ; preds = %0
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @is_dir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_false to i32 (i32, i8*, i32, ...)*)(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__FUNCTION__.test_file_is_not_recognized_as_dir, i64 0, i64 0), i32 8)
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"test-data/existing-files/a\00"
@__FUNCTION__.test_file_is_not_recognized_as_dir = [35 x i8] c"test_file_is_not_recognized_as_dir\00"
define void @test_file_is_not_recognized_as_dir() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @is_dir to i32 (i8*, ...)*)(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_false to i32 (i32, i8*, i32, ...)*)(i32 %1, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__FUNCTION__.test_file_is_not_recognized_as_dir, i64 0, i64 0), i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(unsigned int, unsigned int);
int /*<<< orphan*/ foo(unsigned int, unsigned int, unsigned int);
int main() {
  foo(-1U, 1U + 0x7fffffff, 1U);
  bar(-1U, 1U + 0x7fffffff);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
mov    $0x80000000,%esi
mov    $0x1,%edx
call   1040 <foo@plt>
mov    $0xffffffff,%edi
mov    $0x80000000,%esi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x80000000,%esi
mov    $0x1,%edx
call   1040 <foo@plt>
mov    $0xffffffff,%edi
mov    $0x80000000,%esi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 -1, i32 -2147483648, i32 1)
%2 = tail call i32 @bar(i32 -1, i32 -2147483648)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void logiccircuitdesignmarkovalgorithm(void) {
  printf("logiccircuitdesignmarkovalgorithm\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"logiccircuitdesignmarkovalgorithm\00"
define void @logiccircuitdesignmarkovalgorithm() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}