xunge/DecIR huggingface dataset:
/* Variables and functions */
int _write_sysfs_string(char const *, char const *, char const *, int);
int write_sysfs_string_and_verify(const char *filename, const char *basedir,
                                  const char *val) {
  return _write_sysfs_string(filename, basedir, val, 1);
}


x86 assembly (clang, -O0):
<write_sysfs_string_and_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <_write_sysfs_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_sysfs_string_and_verify>:
mov    $0x1,%ecx
jmp    1030 <_write_sysfs_string@plt>

LLVM IR (-O0):
define i32 @write_sysfs_string_and_verify(i8* %0, i8* %1, i8* %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
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @_write_sysfs_string(i8* %7, i8* %8, i8* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_sysfs_string_and_verify(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @_write_sysfs_string(i8* %0, i8* %1, i8* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() { system("chmod -R a+rw /var/lib/envol/"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"chmod -R a+rw /var/lib/envol/\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"chmod -R a+rw /var/lib/envol/\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int has_sse(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @has_sse() {
ret i32 1
}

LLVM IR (-O2):
define i32 @has_sse() {
ret i32 1
}
void tftpsetascii(argc, argv) char *argv[];
{ tftpsetmode("netascii"); }


x86 assembly (clang, -O0):
<tftpsetascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <tftpsetmode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tftpsetascii>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <tftpsetmode@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"netascii\00"
define void @tftpsetascii(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @tftpsetmode to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"netascii\00"
define void @tftpsetascii(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @tftpsetmode to i32 (i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *reverseString(char *);
int main(int argc, char *argv[]) {
  char str[] = "hello";
  printf("%s\n", reverseString(str));
  return 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    0xec4(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x16(%rbp),%rdi
call   1040 <reverseString@plt>
mov    %rax,%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6568,(%rsp)
mov    %rsp,%rdi
call   1040 <reverseString@plt>
lea    0xec8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@__const.main.str = [6 x i8] c"hello\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8]
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%5 = call i8* @reverseString(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
int arr1() { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @arr1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ rpx(unsigned long);
void printx(unsigned long x) {
  if (x == 0)
    putchar('0');
  else
    rpx(x);
  putchar(' ');
}


x86 assembly (clang, -O0):
<printx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <printx+0x26>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    114f <printx+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <rpx@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printx>:
push   %rax
test   %rdi,%rdi
je     112d <printx+0xd>
call   1040 <rpx@plt>
jmp    1137 <printx+0x17>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printx(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putchar(i8 signext 48)
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @rpx(i64 %8)
br label %10
10: ; preds = %7, %5
%11 = call i32 @putchar(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @printx(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putchar(i8 signext 48)
br label %7
5: ; preds = %1
%6 = tail call i32 @rpx(i64 %0)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @putchar(i8 signext 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void AT91F_UndefHandler() {
  puts("IUD");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<AT91F_UndefHandler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
jmp    1120 <AT91F_UndefHandler+0x10>

x86 assembly (clang, -O2):
<AT91F_UndefHandler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <AT91F_UndefHandler+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"IUD\00"
define void @AT91F_UndefHandler() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"IUD\00"
define void @AT91F_UndefHandler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showAclCfg();
void cmdShowAclCfg(int cmdType, struct cmd_arg *pCmdArg) { showAclCfg(); }


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowAclCfg(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showAclCfg()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowAclCfg(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showAclCfg()
ret void
}
/* Variables and functions */
int strlen(char *);
int overflow(char *str) {
  return (strlen(str) == 514 - 1 && str[514 - 2] != '\n') ? 1 : 0;
}


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x201,%ecx
mov    %al,-0x9(%rbp)
jne    114c <overflow+0x3c>
mov    -0x8(%rbp),%rax
movsbl 0x200(%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<overflow>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x201,%ecx
jne    1131 <overflow+0x21>
xor    %eax,%eax
cmpb   $0xa,0x200(%rbx)
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @overflow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = icmp eq i32 %4, 513
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 512
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 10
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @overflow(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 513
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 512
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 10
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *);
int main() {
  int e = 1;
  foo(&e);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @foo(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0xdb() {
  Assert_real((isgraph(219) == 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_isgraph.c",
              1100, ("isgraph should be 0 for 0xdb"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0xdb>:
push   %rax
mov    $0xdb,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x44c,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xdb\00"
define void @t_isgraph_0xdb() {
%1 = call i64 @isgraph(i32 219)
%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 1100, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0xdb\00"
define void @t_isgraph_0xdb() {
%1 = tail call i64 @isgraph(i32 219)
%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 1100, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ dev_t;

/* Variables and functions */
dev_t makedev(int maj, int min) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @makedev(i32 %0, i32 %1) {
ret i32 0
}
void gtk_notebook_next_page() {}


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

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

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

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

/* Variables and functions */
int matrix_add_sub_common(struct matrix **, struct matrix **,
                          int /*<<< orphan*/);
int matrix_sub(struct matrix *matrixs[], struct matrix **result) {
  return matrix_add_sub_common(matrixs, result, 0);
}


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

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

LLVM IR (-O0):
%struct.matrix = type { i32 }
define i32 @matrix_sub(%struct.matrix** %0, %struct.matrix** %1) {
%3 = alloca %struct.matrix**
%4 = alloca %struct.matrix**
store %struct.matrix** %0, %struct.matrix*** %3
store %struct.matrix** %1, %struct.matrix*** %4
%5 = load %struct.matrix**, %struct.matrix*** %3
%6 = load %struct.matrix**, %struct.matrix*** %4
%7 = call i32 @matrix_add_sub_common(%struct.matrix** %5, %struct.matrix** %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
%struct.matrix = type { i32 }
define i32 @matrix_sub(%struct.matrix** %0, %struct.matrix** %1) {
%3 = tail call i32 @matrix_add_sub_common(%struct.matrix** %0, %struct.matrix** %1, i32 0)
ret i32 %3
}
/* Variables and functions */
unsigned int Scatter(char const);
unsigned int Hash(const char *s) {
  unsigned int val = 0;
  for (; *s; s++)
    val = (val >> 1) ^ Scatter(*s);
  return val;
}


x86 assembly (clang, -O0):
<Hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <Hash+0x50>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <Scatter@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <Hash+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Hash>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1149 <Hash+0x39>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
shr    %ebp
movsbl %al,%edi
call   1030 <Scatter@plt>
xor    %eax,%ebp
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Hash+0x20>
jmp    114b <Hash+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = lshr i32 %6, 1
%9 = tail call i32 @Scatter(i8 signext %5)
%10 = xor i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
void drv_base_init_num() {}


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

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

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

LLVM IR (-O2):
define void @drv_base_init_num() {
ret void
}
int __attribute__((optimize("O0"))) func2() {
  int a = 1;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @func2() {
ret i32 1
}
int check_array_order(int *array, int arraySize) {
  int i;
  for (i = 1; i < arraySize; i++)
    if (array[i - 1] > array[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<check_array_order>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115e <check_array_order+0x5e>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    114b <check_array_order+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1165 <check_array_order+0x65>
jmp    1150 <check_array_order+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <check_array_order+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_array_order>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     1132 <check_array_order+0x32>
mov    %esi,%r8d
mov    (%rdi),%edx
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
mov    (%rdi,%rsi,4),%edx
cmp    %edx,%ecx
jg     1133 <check_array_order+0x33>
add    $0x1,%rsi
cmp    %rsi,%r8
jne    1120 <check_array_order+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @check_array_order(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i32, i32* %0
br label %9
7: ; preds = %9
%8 = icmp eq i64 %15, %5
br i1 %8, label %16, label %9
9: ; preds = %4, %7
%10 = phi i32 [ %6, %4 ], [ %13, %7 ]
%11 = phi i64 [ 1, %4 ], [ %15, %7 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp sgt i32 %10, %13
%15 = add nuw nsw i64 %11, 1
br i1 %14, label %16, label %7
16: ; preds = %9, %7, %2
%17 = phi i32 [ 1, %2 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ time_usleep(int);
void thread_c(void *arg) {
  printf("starting thread C\n");
  while (1) {
    printf("C, sleep...");
    time_usleep(3000);
    printf("wakeup !\n");
  }
}


x86 assembly (clang, -O0):
<thread_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    $0xbb8,%edi
call   1040 <time_usleep@plt>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
jmp    1138 <thread_c+0x18>

x86 assembly (clang, -O2):
<thread_c>:
push   %r14
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%r14
lea    0xed0(%rip),%rbx
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <printf@plt>
mov    $0xbb8,%edi
call   1050 <time_usleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
jmp    1150 <thread_c+0x20>

LLVM IR (-O0):
@.str = [19 x i8] c"starting thread C\0A\00"
@.str.1 = [12 x i8] c"C, sleep...\00"
@.str.2 = [10 x i8] c"wakeup !\0A\00"
define void @thread_c(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %1, %4
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @time_usleep(i32 3000)
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %4
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"C, sleep...\00"
@str = [18 x i8] c"starting thread C\00"
@str.3 = [9 x i8] c"wakeup !\00"
define void @thread_c(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @time_usleep(i32 3000)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
br label %3
}
void SetPort(unsigned short addr, unsigned char byte) {}


x86 assembly (clang, -O0):
<SetPort>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SetPort(i16 zeroext %0, i8 zeroext %1) {
ret void
}
int do_947() { return 947; }


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

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

LLVM IR (-O0):
define i32 @do_947() {
ret i32 947
}

LLVM IR (-O2):
define i32 @do_947() {
ret i32 947
}
int test_imm_25int8_mem(signed char *val) {
  return ((*val) & (0x25 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_25int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 37
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int foo(int);
int main(void) {
  int i = 3;
  return foo(4);
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x4,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 4)
ret i32 %1
}
int Operand_soffset_rtoa(unsigned int *valp, unsigned int pc) {
  *valp += pc;
  return 0;
}


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

x86 assembly (clang, -O2):
<Operand_soffset_rtoa>:
add    %esi,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @Operand_soffset_rtoa(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 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = add i32 %7, %5
store i32 %8, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @Operand_soffset_rtoa(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, %1
store i32 %4, i32* %0
ret i32 0
}
/* Variables and functions */
int chdir(char const *);
int IoDirectory_SetCurrentWorkingDirectory(const char *path) {
  return chdir(path);
}


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

x86 assembly (clang, -O2):
<IoDirectory_SetCurrentWorkingDirectory>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @IoDirectory_SetCurrentWorkingDirectory(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
void remove_base_qscores(char *s, int base) {
  while (*s) {
    *s = *s - base + 1;
    ++s;
  }
}


x86 assembly (clang, -O0):
<remove_base_qscores>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <remove_base_qscores+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <remove_base_qscores+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_base_qscores>:
mov    (%rdi),%al
test   %al,%al
je     1120 <remove_base_qscores+0x20>
mov    $0x1,%cl
sub    %sil,%cl
add    $0x1,%rdi
nop
add    %cl,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <remove_base_qscores+0x10>
ret

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

LLVM IR (-O2):
define void @remove_base_qscores(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = trunc i32 %1 to i8
%7 = sub i8 1, %6
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %13, %8 ]
%10 = phi i8* [ %0, %5 ], [ %12, %8 ]
%11 = add i8 %7, %9
store i8 %11, i8* %10
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret void
}
void gtk_cell_renderer_combo_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_cell_renderer_combo_new() {
ret void
}
/* Variables and functions */
int f(int, int, int, int, int, int, int, int);
double g(int, int, int, int, int, int, int, int);
main() {
  int i = f(1, 2, 3, 4, 5, 6, 7, 8);
  double x = g(1, 2, 3, 4, 5, 6, 7, 8);
  return i + x;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x8
push   $0x7
call   1030 <f@plt>
add    $0x10,%rsp
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x8
push   $0x7
call   1040 <g@plt>
add    $0x10,%rsp
cvtsi2sd %ebx,%xmm1
addsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
%4 = call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
store i32 %4, i32* %2
%5 = call double @g(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
store double %5, double* %3
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to double
%8 = load double, double* %3
%9 = fadd double %7, %8
%10 = fptosi double %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
%2 = tail call double @g(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
%3 = sitofp i32 %1 to double
%4 = fadd double %2, %3
%5 = fptosi double %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *strndup(const char *s1, size_t n) {
  char *copy = (char *)malloc(n + 1);
  memcpy(copy, s1, n);
  copy[n] = 0;
  return copy;
}


x86 assembly (clang, -O0):
<strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
%7 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %7
ret i8* %5
}
dysize(y) {
  return ((!((y) % 4) && (((y) % 100) || !((y) % 400))) ? 366 : 365);
}


x86 assembly (clang, -O0):
<dysize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1155 <dysize+0x55>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114f <dysize+0x4f>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
xor    $0xff,%al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%dl
mov    $0x16d,%eax
mov    $0x16e,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dysize>:
mov    $0x16d,%eax
test   $0x3,%dil
je     110c <dysize+0xc>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x16e,%eax
cmp    $0x28f5c28,%edx
ja     110b <dysize+0xb>
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
mov    $0x16d,%eax
adc    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @dysize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp ne i32 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br label %15
15: ; preds = %10, %6
%16 = phi i1 [ true, %6 ], [ %14, %10 ]
br label %17
17: ; preds = %15, %1
%18 = phi i1 [ false, %1 ], [ %16, %15 ]
%19 = zext i1 %18 to i64
%20 = select i1 %18, i32 366, i32 365
ret i32 %20
}

LLVM IR (-O2):
define i32 @dysize(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 366, i32 365
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 365, %1 ], [ 366, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *thread_func(void *arg) {
  int *t = (int *)arg;
  printf("Thread0, arg = %d\n", *t);
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_func>:
push   %rax
mov    (%rdi),%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Thread0, arg = %d\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = call i32 @pthread_exit(i32* null)
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"Thread0, arg = %d\0A\00"
define noalias i8* @thread_func(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x9c() {
  Assert_real((isodigit(156) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              785, ("isodigit should be 0 for 0x9c"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x9c>:
push   %rax
mov    $0x9c,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x311,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x9c\00"
define void @t_isodigit_0x9c() {
%1 = tail call i64 @isodigit(i32 156)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 785, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int CalculateParity(int Value) {
  int p = 1;
  uint16_t n = Value;
  while (n) {
    n &= (n - 1);
    p = !p;
  }
  return p;
}


x86 assembly (clang, -O0):
<CalculateParity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1140 <CalculateParity+0x40>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
and    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
jmp    1114 <CalculateParity+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @CalculateParity(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 1, %1 ]
%6 = add nsw i32 %4, -1
%7 = and i32 %6, %4
%8 = xor i32 %5, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ %8, %3 ]
ret i32 %11
}
void ktsan_irq_enable(void) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_irq_enable() {
ret void
}
double calcBoxArea(float length) { return length * length; }


x86 assembly (clang, -O0):
<calcBoxArea>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcBoxArea>:
mulss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @calcBoxArea(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = fmul float %3, %4
%6 = fpext float %5 to double
ret double %6
}

LLVM IR (-O2):
define double @calcBoxArea(float %0) {
%2 = fmul float %0, %0
%3 = fpext float %2 to double
ret double %3
}
void gtk_widget_get_composite_name() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_get_composite_name() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ escribir(int *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ leer(int *, int);
scalar_t__ malloc(int);
int main() {
  int *p = (int *)malloc(5 * sizeof(int));
  if (p != NULL) {
    leer(p, 5);
    escribir(p, 5);
    free(p);
    p = NULL;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1195 <main+0x55>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1050 <leer@plt>
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1040 <escribir@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x14,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1175 <main+0x35>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5,%esi
call   1050 <leer@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <escribir@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 20)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %14
7: ; preds = %0
%8 = load i32*, i32** %2
%9 = call i32 @leer(i32* %8, i32 5)
%10 = load i32*, i32** %2
%11 = call i32 @escribir(i32* %10, i32 5)
%12 = load i32*, i32** %2
%13 = call i32 @free(i32* %12)
store i32* null, i32** %2
br label %14
14: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 20)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 @leer(i32* %2, i32 5)
%6 = tail call i32 @escribir(i32* %2, i32 5)
%7 = tail call i32 @free(i32* %2)
br label %8
8: ; preds = %4, %0
ret i32 0
}
int tstswitch(int x) {
  switch (x) {
  case 1:
    return 9;
  case 2:
    return 3;
  case 3:
    return 4;
  case 4:
  case 5:
  case 6:
    return 5;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<tstswitch>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1160 <tstswitch+0x60>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x9,-0x4(%rbp)
jmp    1167 <tstswitch+0x67>
movl   $0x3,-0x4(%rbp)
jmp    1167 <tstswitch+0x67>
movl   $0x4,-0x4(%rbp)
jmp    1167 <tstswitch+0x67>
movl   $0x5,-0x4(%rbp)
jmp    1167 <tstswitch+0x67>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tstswitch>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x5,%edi
ja     1117 <tstswitch+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.tstswitch = [6 x i32] [i32 9, i32 3, i32 4, i32 5, i32 5, i32 5]
define i32 @tstswitch(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.tstswitch, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int max_height;
};
typedef TYPE_1__ XIconSize;

/* Variables and functions */
void set_XIconSize_max_height(void *_p, int _v) {
  ((XIconSize *)_p)->max_height = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XIconSize_max_height>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XIconSize_max_height(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XIconSize_max_height(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}