xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ readFile(int /*<<< orphan*/ *);
int /*<<< orphan*/ writeTofile(int /*<<< orphan*/ *);
int main(void) {
  FILE *cfPtr;
  writeTofile(cfPtr);
  printf("This is the data written to the file.\n");
  printf("The file users.dat can be found in the directory where the program "
         "was compiled.\n");
  readFile(cfPtr);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"This is the data written to the file.\0A\00"
@.str.1 = [82 x i8] c"The file users.dat can be found in the directory where the program was compiled.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = load i32*, i32** %2
%4 = call i32 @writeTofile(i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32*, i32** %2
%8 = call i32 @readFile(i32* %7)
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"This is the data written to the file.\00"
@str.2 = [81 x i8] c"The file users.dat can be found in the directory where the program was compiled.\00"
define i32 @main() {
%1 = tail call i32 @writeTofile(i32* undef)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @readFile(i32* undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplMcs51GeneralIOC__P10__toggle();
void ReverseGPIOP__0__In__toggle(void) { HplMcs51GeneralIOC__P10__toggle(); }


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

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

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

LLVM IR (-O2):
define void @ReverseGPIOP__0__In__toggle() {
%1 = tail call i32 (...) @HplMcs51GeneralIOC__P10__toggle()
ret void
}
int main(void) {
  ~0;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCGETS;
int ioctl(int, int /*<<< orphan*/, struct termios *);
int tcgetattr(int fildes, struct termios *termios_p) {
  return ioctl(fildes, TCGETS, termios_p);
}


x86 assembly (clang, -O0):
<tcgetattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcgetattr>:
mov    %rsi,%rdx
mov    0x2ece(%rip),%rax
mov    (%rax),%esi
jmp    1030 <ioctl@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = alloca i32
%4 = alloca %struct.termios*
store i32 %0, i32* %3
store %struct.termios* %1, %struct.termios** %4
%5 = load i32, i32* %3
%6 = load i32, i32* @TCGETS
%7 = load %struct.termios*, %struct.termios** %4
%8 = call i32 @ioctl(i32 %5, i32 %6, %struct.termios* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@TCGETS = global i32 0
define i32 @tcgetattr(i32 %0, %struct.termios* %1) {
%3 = load i32, i32* @TCGETS
%4 = tail call i32 @ioctl(i32 %0, i32 %3, %struct.termios* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ println(char *);
int main(int argc, char **argv) {
  println("Hello, "
          "world"
          "!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @println(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
char *files_read_all_with_options(char *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/);
char *files_read_all(char *path, ssize_t *read_ptr) {
  return files_read_all_with_options(path, read_ptr, 0);
}


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

x86 assembly (clang, -O2):
<files_read_all>:
xor    %edx,%edx
jmp    1030 <files_read_all_with_options@plt>

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

LLVM IR (-O2):
define i8* @files_read_all(i8* %0, i32* %1) {
%3 = tail call i8* @files_read_all_with_options(i8* %0, i32* %1, i32 0)
ret i8* %3
}
f(int n) {
  int i;
  double v[n];
  for (i = 0; i < n; i++)
    v[i] = 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,8),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1163 <f+0x63>
mov    -0x28(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <f+0x39>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %5
%10 = alloca double, i64 %8
store i64 %8, i64* %6
store i32 0, i32* %4
br label %11
11: ; preds = %19, %1
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %11
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* %10, i64 %17
store double 0.000000e+00, double* %18
br label %19
19: ; preds = %15
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %11
22: ; preds = %11
%23 = load i8*, i8** %5
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int si475x_readStatus();
int /*<<< orphan*/ wait_us(int);
void si475x_waitForCTS() {
  unsigned short i = 100;
  while (--i && !(si475x_readStatus() & 0x80)) {
    wait_us(1000);
  }
}


x86 assembly (clang, -O0):
<si475x_waitForCTS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movw   $0x64,-0x2(%rbp)
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
movzwl %ax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x3(%rbp)
je     1162 <si475x_waitForCTS+0x42>
mov    $0x0,%al
call   1030 <si475x_readStatus@plt>
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
test   $0x1,%al
jne    1172 <si475x_waitForCTS+0x52>
jmp    1181 <si475x_waitForCTS+0x61>
mov    $0x3e8,%edi
call   1040 <wait_us@plt>
jmp    112e <si475x_waitForCTS+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475x_waitForCTS>:
push   %rbx
mov    $0xff9d,%bx
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1030 <si475x_readStatus@plt>
test   $0x80,%al
jne    114a <si475x_waitForCTS+0x2a>
mov    $0x3e8,%edi
call   1040 <wait_us@plt>
inc    %bx
jne    1130 <si475x_waitForCTS+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @si475x_waitForCTS() {
%1 = alloca i16
store i16 100, i16* %1
br label %2
2: ; preds = %14, %0
%3 = load i16, i16* %1
%4 = add i16 %3, -1
store i16 %4, i16* %1
%5 = zext i16 %4 to i32
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = call i32 (...) @si475x_readStatus()
%9 = and i32 %8, 128
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br label %12
12: ; preds = %7, %2
%13 = phi i1 [ false, %2 ], [ %11, %7 ]
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = call i32 @wait_us(i32 1000)
br label %2
16: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @si475x_waitForCTS() {
br label %1
1: ; preds = %0, %6
%2 = phi i16 [ 99, %0 ], [ %8, %6 ]
%3 = tail call i32 (...) @si475x_readStatus()
%4 = and i32 %3, 128
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @wait_us(i32 1000)
%8 = add nsw i16 %2, -1
%9 = icmp eq i16 %8, 0
br i1 %9, label %10, label %1
10: ; preds = %6, %1
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint8_t add8(uint8_t i, uint8_t j) {
  uint16_t t = i + j;
  return t;
}


x86 assembly (clang, -O0):
<add8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add8>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add8(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @add8(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int fcntl(int, int /*<<< orphan*/, ...);
int lbs_posix_del_fl(int fd, int flflags) {
  int orgfl = fcntl(fd, F_GETFL);
  if (orgfl < 0) {
    return -1;
  }
  return fcntl(fd, F_SETFL, orgfl & ~(flflags));
}


x86 assembly (clang, -O0):
<lbs_posix_del_fl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    114a <lbs_posix_del_fl+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <lbs_posix_del_fl+0x5b>
mov    -0x8(%rbp),%edi
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lbs_posix_del_fl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %eax,%eax
js     1149 <lbs_posix_del_fl+0x39>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
not    %ebp
and    %ebp,%eax
mov    %ebx,%edi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @lbs_posix_del_fl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @F_GETFL
%9 = call i32 (i32, i32, ...) @fcntl(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %21
13: ; preds = %2
%14 = load i32, i32* %4
%15 = load i32, i32* @F_SETFL
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = xor i32 %17, -1
%19 = and i32 %16, %18
%20 = call i32 (i32, i32, ...) @fcntl(i32 %14, i32 %15, i32 %19)
store i32 %20, i32* %3
br label %21
21: ; preds = %13, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @lbs_posix_del_fl(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @F_SETFL
%8 = xor i32 %1, -1
%9 = and i32 %4, %8
%10 = tail call i32 (i32, i32, ...) @fcntl(i32 %0, i32 %7, i32 %9)
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ -1, %2 ]
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t bswap32(uint32_t i) {
  uint32_t r;
  r = ((i >> 24) & 0xff);
  r |= ((i >> 16) & 0xff) << 8;
  r |= ((i >> 8) & 0xff) << 16;
  r |= ((i >> 0) & 0xff) << 24;
  return r;
}


x86 assembly (clang, -O0):
<bswap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
shl    $0x10,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
shl    $0x18,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bswap32(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 24
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 16
%9 = and i32 %8, 255
%10 = shl i32 %9, 8
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %2
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = shl i32 %15, 16
%17 = load i32, i32* %3
%18 = or i32 %17, %16
store i32 %18, i32* %3
%19 = load i32, i32* %2
%20 = ashr i32 %19, 0
%21 = and i32 %20, 255
%22 = shl i32 %21, 24
%23 = load i32, i32* %3
%24 = or i32 %23, %22
store i32 %24, i32* %3
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @bswap32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char *prog_name) {
  fprintf(stderr, "usage: %s <thread_count> <digraph file> <min split size>\n",
          prog_name);
  exit(0);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"usage: %s <thread_count> <digraph file> <min split size>\0A\00"
define void @Usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"usage: %s <thread_count> <digraph file> <min split size>\0A\00"
define void @Usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ send(int, int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void cbWriteShortC(int fd, uint16_t write_value) {
  write_value = htons(write_value);
  send(fd, &write_value, sizeof(uint16_t), 0);
}


x86 assembly (clang, -O0):
<cbWriteShortC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <htons@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbWriteShortC>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    %esi,%edi
call   1030 <htons@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cbWriteShortC(i32 %0, i32 %1) {
%3 = alloca i32
%4 = tail call i32 @htons(i32 %1)
store i32 %4, i32* %3
%5 = call i32 @send(i32 %0, i32* %3, i32 4, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void print_array_float(float *array, char *fmt_str, int size) {
  int i = 0;
  for (i = 0; i < size; i++) {
    printf(fmt_str, array[i]);
  }
}


x86 assembly (clang, -O0):
<print_array_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1161 <print_array_float+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <print_array_float+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array_float>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
jle    1147 <print_array_float+0x37>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movss  (%r15,%rbx,4),%xmm0
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_array_float+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @print_array_float(float* nocapture %0, i8* %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds float, float* %0, i64 %8
%10 = load float, float* %9
%11 = tail call i32 @printf(i8* %1, float %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/
ArbiterP__1__ResourceDefaultOwner__default__immediateRequested();
void ArbiterP__1__ResourceDefaultOwner__immediateRequested(void) {
  ArbiterP__1__ResourceDefaultOwner__default__immediateRequested();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__1__ResourceDefaultOwner__immediateRequested() {
%1 = tail call i32 (...) @ArbiterP__1__ResourceDefaultOwner__default__immediateRequested()
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *calloc_and_null_check(size_t nmemb, size_t size) {
  void *tmp = calloc(nmemb, size);
  if (!tmp) {
    (0);
  }
  return tmp;
}


x86 assembly (clang, -O0):
<calloc_and_null_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <calloc_and_null_check+0x31>
jmp    1141 <calloc_and_null_check+0x31>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc_and_null_check>:
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @calloc_and_null_check(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
int COM_Argc();
int /*<<< orphan*/ COM_Argv(int);
int /*<<< orphan*/ HU_SetCEchoDuration(int /*<<< orphan*/);
int /*<<< orphan*/ atoi(int /*<<< orphan*/);
void COM_CEchoDuration_f(void) {
  if (COM_Argc() > 1)
    HU_SetCEchoDuration(atoi(COM_Argv(1)));
}


x86 assembly (clang, -O0):
<COM_CEchoDuration_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <COM_Argc@plt>
cmp    $0x1,%eax
jle    116c <COM_CEchoDuration_f+0x2c>
mov    $0x1,%edi
call   1030 <COM_Argv@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1050 <HU_SetCEchoDuration@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<COM_CEchoDuration_f>:
push   %rax
xor    %eax,%eax
call   1040 <COM_Argc@plt>
cmp    $0x2,%eax
jl     1166 <COM_CEchoDuration_f+0x26>
mov    $0x1,%edi
call   1030 <COM_Argv@plt>
mov    %eax,%edi
call   1060 <atoi@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <HU_SetCEchoDuration@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @COM_CEchoDuration_f() {
%1 = call i32 (...) @COM_Argc()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @COM_Argv(i32 1)
%5 = call i32 @atoi(i32 %4)
%6 = call i32 @HU_SetCEchoDuration(i32 %5)
br label %7
7: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @COM_CEchoDuration_f() {
%1 = tail call i32 (...) @COM_Argc()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @COM_Argv(i32 1)
%5 = tail call i32 @atoi(i32 %4)
%6 = tail call i32 @HU_SetCEchoDuration(i32 %5)
br label %7
7: ; preds = %3, %0
ret void
}
/* Variables and functions */
float sinf(float);
float sqrtf(int);
void ao_sincosf(float a, float *s, float *c) {
  float _s = sinf(a);
  *s = _s;
  *c = sqrtf(1 - _s * _s);
}


x86 assembly (clang, -O0):
<ao_sincosf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sinf@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x1c(%rbp),%xmm0
movss  -0x1c(%rbp),%xmm1
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm1,%xmm0
movss  0xe8c(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1040 <sqrtf@plt>
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ao_sincosf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <sinf@plt>
movss  %xmm0,(%rbx)
mulss  %xmm0,%xmm0
movss  0xec1(%rip),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1040 <sqrtf@plt>
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ao_sincosf(float %0, float* %1, float* %2) {
%4 = alloca float
%5 = alloca float*
%6 = alloca float*
%7 = alloca float
store float %0, float* %4
store float* %1, float** %5
store float* %2, float** %6
%8 = load float, float* %4
%9 = call float @sinf(float %8)
store float %9, float* %7
%10 = load float, float* %7
%11 = load float*, float** %5
store float %10, float* %11
%12 = load float, float* %7
%13 = load float, float* %7
%14 = fneg float %12
%15 = call float @llvm.fmuladd.f32(float %14, float %13, float 1.000000e+00)
%16 = fptosi float %15 to i32
%17 = call float @sqrtf(i32 %16)
%18 = load float*, float** %6
store float %17, float* %18
ret void
}

LLVM IR (-O2):
define void @ao_sincosf(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2) {
%4 = tail call float @sinf(float %0)
store float %4, float* %1
%5 = fneg float %4
%6 = tail call float @llvm.fmuladd.f32(float %5, float %4, float 1.000000e+00)
%7 = fptosi float %6 to i32
%8 = tail call float @sqrtf(i32 %7)
store float %8, float* %2
ret void
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
char *strerror(int);
void errore(char *msg, int ret_code) {
  printf(msg);
  printf(" | errcode:%d (%s)\n", errno, strerror(errno));
  exit(ret_code);
}


x86 assembly (clang, -O0):
<errore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%esi
mov    %rax,%rdx
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errore>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e9d(%rip),%rax
mov    (%rax),%ebp
mov    %ebp,%edi
call   1050 <strerror@plt>
lea    0xead(%rip),%rdi
mov    %ebp,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c" | errcode:%d (%s)\0A\00"
@errno = global i32 0
define void @errore(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 = call i32 (i8*, ...) @printf(i8* %5)
%7 = load i32, i32* @errno
%8 = load i32, i32* @errno
%9 = call i8* @strerror(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %9)
%11 = load i32, i32* %4
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@.str = [20 x i8] c" | errcode:%d (%s)\0A\00"
@errno = global i32 0
define void @errore(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0)
%4 = load i32, i32* @errno
%5 = tail call i8* @strerror(i32 %4)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4, i8* %5)
%7 = tail call i32 @exit(i32 %1)
unreachable
}
void RTMemEfTmpFreeNP(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMemEfTmpFreeNP() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ stderr;
void selectDevice(int fd, int addr, char *name) {
  if (ioctl(fd, I2C_SLAVE, addr) < 0) {
    fprintf(stderr, "%s not present\n", name);
  }
}


x86 assembly (clang, -O0):
<selectDevice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
jge    1169 <selectDevice+0x49>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectDevice>:
push   %rbx
mov    %rdx,%rbx
mov    %esi,%edx
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
test   %rax,%rax
js     113b <selectDevice+0x1b>
pop    %rbx
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@I2C_SLAVE = global i32 0
@stderr = global i32 0
@.str = [16 x i8] c"%s not present\0A\00"
define void @selectDevice(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* @I2C_SLAVE
%9 = load i32, i32* %5
%10 = call i64 @ioctl(i32 %7, i32 %8, i32 %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %6
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
@stderr = global i32 0
@.str = [16 x i8] c"%s not present\0A\00"
define void @selectDevice(i32 %0, i32 %1, i8* %2) {
%4 = load i32, i32* @I2C_SLAVE
%5 = tail call i64 @ioctl(i32 %0, i32 %4, i32 %1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %7, %3
ret void
}
int test_imm_1Fint64_lowword_reg(long long val) {
  return ((val) & (0x1F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_1Fint64_lowword_reg>:
test   $0x1f,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Fint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 31
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void ext_dev_write_32(uint32_t addr, uint32_t val, void *ctxt) {}


x86 assembly (clang, -O0):
<ext_dev_write_32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ext_dev_write_32(i32 %0, i32 %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ASAP_PutLittleEndian(unsigned char *, int, int);
void ASAP_PutLittleEndians(unsigned char *buffer, int offset, int value1,
                           int value2) {
  ASAP_PutLittleEndian(buffer, offset, value1);
  ASAP_PutLittleEndian(buffer, offset + 4, value2);
}


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

x86 assembly (clang, -O2):
<ASAP_PutLittleEndians>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <ASAP_PutLittleEndian@plt>
add    $0x4,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ASAP_PutLittleEndian@plt>

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

LLVM IR (-O2):
define void @ASAP_PutLittleEndians(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @ASAP_PutLittleEndian(i8* %0, i32 %1, i32 %2)
%6 = add nsw i32 %1, 4
%7 = tail call i32 @ASAP_PutLittleEndian(i8* %0, i32 %6, i32 %3)
ret void
}
char hexhightoasc11(int xxc) {
  xxc &= 0xf0;
  xxc = xxc >> 4;
  if (xxc < 0x0a)
    xxc += '0';
  else
    xxc += 0x37;
  return (char)xxc;
}


x86 assembly (clang, -O0):
<hexhightoasc11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1133 <hexhightoasc11+0x33>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    113c <hexhightoasc11+0x3c>
mov    -0x4(%rbp),%eax
add    $0x37,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexhightoasc11>:
shr    $0x4,%edi
and    $0xf,%edi
lea    0x37(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0xa,%edi
movzbl %cl,%ecx
movzbl %al,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @hexhightoasc11(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = icmp ult i32 %3, 10
%5 = or i32 %3, 48
%6 = add nuw nsw i32 %3, 55
%7 = select i1 %4, i32 %5, i32 %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *displayPluginInfo() {
  printf("The hello world plugin takes no parameters!\nEnjoy!\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"The hello world plugin takes no parameters!\0AEnjoy!\0A\00"
define i8* @displayPluginInfo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [51 x i8] c"The hello world plugin takes no parameters!\0AEnjoy!\00"
define noalias i8* @displayPluginInfo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void err(const char *msg) {
  fprintf(stderr, "minbzcat: ");
  if (msg)
    perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
lea    0xeb4(%rip),%rsi
call   1030 <fprintf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1165 <err+0x35>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
test   %rbx,%rbx
je     1156 <err+0x26>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"minbzcat: \00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = call i32 @perror(i8* %8)
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"minbzcat: \00"
@EXIT_FAILURE = global i32 0
define void @err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @perror(i8* %0)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int Bits_log2x32(uint32_t number) {
  int out = 0;
  while (number >>= 1) {
    out++;
  }
  return out;
}


x86 assembly (clang, -O0):
<Bits_log2x32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <Bits_log2x32+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <Bits_log2x32+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bits_log2x32>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <Bits_log2x32+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <Bits_log2x32+0x10>
ret

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

LLVM IR (-O2):
define i32 @Bits_log2x32(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int strlen(char *);
char tolower(char);
void lowercase(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++) {
    s[i] = tolower(s[i]);
  }
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <lowercase+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <lowercase+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <lowercase+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <lowercase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @lowercase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_240() {
  Assert_real((isqrt(240) == 15),
              "/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/stdlib/isqrt.c",
              1205, ("Integer square root of 240 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_240>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf0,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4b5,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_240>:
push   %rax
mov    $0xf0,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4b5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 240 should be 15\00"
define void @t_sqrt_240() {
%1 = call i32 @isqrt(i32 240)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1205, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 240 should be 15\00"
define void @t_sqrt_240() {
%1 = tail call i32 @isqrt(i32 240)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1205, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}