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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int);
int main() {
  const char *string0 = "1234567891011121314151617181920";
  printf("sizeof: [%s] is [%i] \n", string0, sizeof(string0));
  const char *string1 = "1";
  printf("sizeof: [%s] is [%i] \n", string1, sizeof(string1));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf08(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <printf@plt>
lea    0xf04(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"1234567891011121314151617181920\00"
@.str.1 = [23 x i8] c"sizeof: [%s] is [%i] \0A\00"
@.str.2 = [2 x i8] c"1\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "usage: convert-vpu-firmware <infile> <outfile>\n");
  fprintf(stderr, "example: convert-vpu-firmware vpu_fw_imx53.bin "
                  "v4l-coda7541-imx53.bin\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xef7(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf01(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"usage: convert-vpu-firmware <infile> <outfile>\0A\00"
@.str.1 = [71 x i8] c"example: convert-vpu-firmware vpu_fw_imx53.bin v4l-coda7541-imx53.bin\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"usage: convert-vpu-firmware <infile> <outfile>\0A\00"
@.str.1 = [71 x i8] c"example: convert-vpu-firmware vpu_fw_imx53.bin v4l-coda7541-imx53.bin\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char dominate_color(char a, char b) {
  if (a == 0 && b == 1)
    return 1;
  if (a == 1 && b == 2)
    return 1;
  if (a == 2 && b == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dominate_color>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jne    1133 <dominate_color+0x33>
movsbl -0x3(%rbp),%eax
cmp    $0x1,%eax
jne    1133 <dominate_color+0x33>
movb   $0x1,-0x1(%rbp)
jmp    117d <dominate_color+0x7d>
movsbl -0x2(%rbp),%eax
cmp    $0x1,%eax
jne    1156 <dominate_color+0x56>
movsbl -0x3(%rbp),%eax
cmp    $0x2,%eax
jne    1156 <dominate_color+0x56>
movb   $0x1,-0x1(%rbp)
jmp    117d <dominate_color+0x7d>
movsbl -0x2(%rbp),%eax
cmp    $0x2,%eax
jne    1179 <dominate_color+0x79>
movsbl -0x3(%rbp),%eax
cmp    $0x0,%eax
jne    1179 <dominate_color+0x79>
movb   $0x1,-0x1(%rbp)
jmp    117d <dominate_color+0x7d>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dominate_color>:
mov    $0x1,%al
test   %dil,%dil
jne    110e <dominate_color+0xe>
cmp    $0x1,%sil
jne    110e <dominate_color+0xe>
ret
cmp    $0x1,%dil
jne    111a <dominate_color+0x1a>
cmp    $0x2,%sil
je     110d <dominate_color+0xd>
xor    $0x2,%dil
or     %sil,%dil
sete   %al
ret

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

LLVM IR (-O2):
define signext i8 @dominate_color(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %0, 0
%4 = icmp eq i8 %1, 1
%5 = and i1 %3, %4
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = icmp eq i8 %0, 1
%8 = icmp eq i8 %1, 2
%9 = and i1 %7, %8
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = icmp eq i8 %0, 2
%12 = icmp eq i8 %1, 0
%13 = and i1 %11, %12
%14 = zext i1 %13 to i8
br label %15
15: ; preds = %10, %6, %2
%16 = phi i8 [ 1, %2 ], [ 1, %6 ], [ %14, %10 ]
ret i8 %16
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ fstat(int, struct stat *);
char is_regular_file(int fd) {
  struct stat sb;
  return (fstat(fd, &sb) < 0 || S_ISREG(sb.st_mode));
}


x86 assembly (clang, -O0):
<is_regular_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1040 <fstat@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jl     115b <is_regular_file+0x3b>
mov    -0x8(%rbp),%edi
call   1030 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_regular_file>:
push   %rax
mov    %rsp,%rsi
call   1040 <fstat@plt>
test   %rax,%rax
js     113e <is_regular_file+0x1e>
mov    (%rsp),%edi
call   1030 <S_ISREG@plt>
test   %rax,%rax
setne  %al
pop    %rcx
ret
mov    $0x1,%al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define signext i8 @is_regular_file(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.stat
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @fstat(i32 %4, %struct.stat* %3)
%6 = icmp slt i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISREG(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ true, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define signext i8 @is_regular_file(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i8
br label %12
12: ; preds = %6, %1
%13 = phi i8 [ 1, %1 ], [ %11, %6 ]
ret i8 %13
}
int print(void *data, const char *line) {
  printf("%s%s\n", data, line);
  return 0;
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s\0A\00"
define i32 @print(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i32 0
}
/* Type definitions */
typedef int time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int *);
int mktime(struct tm *);
time_t gmmktime(struct tm *tm) {
  time_t t, tref;
  struct tm *tmref;
  t = mktime(tm);
  tmref = gmtime(&t);
  tref = mktime(tmref);
  t = t * 2 - tref;
  return t;
}


x86 assembly (clang, -O0):
<gmmktime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mktime@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <mktime@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmmktime>:
push   %rax
call   1030 <mktime@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
mov    %rax,%rdi
call   1030 <mktime@plt>
mov    0x4(%rsp),%ecx
add    %ecx,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @gmmktime(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = call i32 @mktime(%struct.tm* %6)
store i32 %7, i32* %3
%8 = call %struct.tm* @gmtime(i32* %3)
store %struct.tm* %8, %struct.tm** %5
%9 = load %struct.tm*, %struct.tm** %5
%10 = call i32 @mktime(%struct.tm* %9)
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, 2
%13 = load i32, i32* %4
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @gmmktime(%struct.tm* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @mktime(%struct.tm* %0)
store i32 %4, i32* %2
%5 = call %struct.tm* @gmtime(i32* %2)
%6 = call i32 @mktime(%struct.tm* %5)
%7 = load i32, i32* %2
%8 = shl nsw i32 %7, 1
%9 = sub nsw i32 %8, %6
ret i32 %9
}
void foo398(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo398(i32 %0) {
ret void
}
/* Variables and functions */
int system(char const *);
int System(const char *command) { return system(command); }


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

x86 assembly (clang, -O2):
<System>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @System(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
void nfs_fscache_release_cookie(struct inode *inode) {}


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

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

LLVM IR (-O0):
%struct.inode = type opaque
define void @nfs_fscache_release_cookie(%struct.inode* %0) {
%2 = alloca %struct.inode*
store %struct.inode* %0, %struct.inode** %2
ret void
}

LLVM IR (-O2):
%struct.inode = type opaque
define void @nfs_fscache_release_cookie(%struct.inode* nocapture %0) {
ret void
}
int dias_ano(int ano) {
  int x = ano;
  if (ano % 100 == 0)
    x = ano / 100;
  if (x % 4 == 0)
    return 366;
  else
    return 365;
}


x86 assembly (clang, -O0):
<dias_ano>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <dias_ano+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <dias_ano+0x4f>
movl   $0x16e,-0x4(%rbp)
jmp    1156 <dias_ano+0x56>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dias_ano>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x2,%eax
cmp    $0x28f5c28,%eax
ja     112c <dias_ano+0x2c>
movslq %edi,%rax
imul   $0x51eb851f,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
and    $0x3,%edi
cmp    $0x1,%edi
mov    $0x16d,%eax
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @dias_ano(i32 %0) {
%2 = srem i32 %0, 100
%3 = icmp eq i32 %2, 0
%4 = sdiv i32 %0, 100
%5 = select i1 %3, i32 %4, i32 %0
%6 = and i32 %5, 3
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 366, i32 365
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() { printf("sleep - Onyx coreutils 0.4\n"); }


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"sleep - Onyx coreutils 0.4\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int return_uint(unsigned int n) { return n; }


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

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

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

LLVM IR (-O2):
define i32 @return_uint(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct proc_psi_twolines {
  int dummy;
};

/* Variables and functions */
int proc_psi_read(struct proc_psi_twolines **, unsigned long long *,
                  char const *, unsigned long);
int proc_psi_read_memory(struct proc_psi_twolines **psi_memory,
                         unsigned long long *starvation, unsigned long delay) {
  const char *procpath = "/proc/pressure"
                         "/memory";
  return proc_psi_read(psi_memory, starvation, procpath, delay);
}


x86 assembly (clang, -O0):
<proc_psi_read_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <proc_psi_read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc_psi_read_memory>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <proc_psi_read@plt>

LLVM IR (-O0):
%struct.proc_psi_twolines = type { i32 }
@.str = [22 x i8] c"/proc/pressure/memory\00"
define i32 @proc_psi_read_memory(%struct.proc_psi_twolines** %0, i64* %1, i64 %2) {
%4 = alloca %struct.proc_psi_twolines**
%5 = alloca i64*
%6 = alloca i64
%7 = alloca i8*
store %struct.proc_psi_twolines** %0, %struct.proc_psi_twolines*** %4
store i64* %1, i64** %5
store i64 %2, i64* %6
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load %struct.proc_psi_twolines**, %struct.proc_psi_twolines*** %4
%9 = load i64*, i64** %5
%10 = load i8*, i8** %7
%11 = load i64, i64* %6
%12 = call i32 @proc_psi_read(%struct.proc_psi_twolines** %8, i64* %9, i8* %10, i64 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.proc_psi_twolines = type { i32 }
@.str = [22 x i8] c"/proc/pressure/memory\00"
define i32 @proc_psi_read_memory(%struct.proc_psi_twolines** %0, i64* %1, i64 %2) {
%4 = tail call i32 @proc_psi_read(%struct.proc_psi_twolines** %0, i64* %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ indirectl();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcIndirectLong8(void) { sbc8(readmem65816(indirectl())); }


x86 assembly (clang, -O0):
<sbcIndirectLong8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcIndirectLong8>:
push   %rax
xor    %eax,%eax
call   1040 <indirectl@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sbc8@plt>

LLVM IR (-O0):
define void @sbcIndirectLong8() {
%1 = call i32 (...) @indirectl()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcIndirectLong8() {
%1 = tail call i32 (...) @indirectl()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sign();
void recogniser1() { sign(); }


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

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

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

LLVM IR (-O2):
define void @recogniser1() {
%1 = tail call i32 (...) @sign()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;

/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *, int);
int /*<<< orphan*/ Cvar_Set(char *, char *);
void Cvar_SetInteger(char *var_name, int integer) {
  char val[32];
  Com_sprintf(val, sizeof(val), "%i", integer);
  Cvar_Set(var_name, val);
}


x86 assembly (clang, -O0):
<Cvar_SetInteger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x20,%esi
lea    0xebe(%rip),%rdx
call   1040 <Com_sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <Cvar_Set@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cvar_SetInteger>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ecx
mov    %rdi,%rbx
lea    0xecd(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
call   1040 <Com_sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Cvar_Set@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define void @Cvar_SetInteger(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [32 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = call i32 @Com_sprintf(i8* %6, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = call i32 @Cvar_Set(i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @Cvar_SetInteger(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @Com_sprintf(i8* %4, i32 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @Cvar_Set(i8* %0, i8* %4)
ret void
}
void rop3_152_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | S;
  stk3 = ~stk3;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_152_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_152_0_0>:
or     %esi,%edx
not    %dl
or     (%rdi),%dl
xor    %sil,%dl
not    %dl
mov    %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_152_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %9
%16 = load i8, i8* %9
%17 = zext i8 %16 to i32
%18 = xor i32 %17, -1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %9
%20 = load i8*, i8** %4
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = trunc i32 %35 to i8
store i8 %36, i8* %7
%37 = load i8, i8* %7
%38 = load i8*, i8** %4
store i8 %37, i8* %38
ret void
}

LLVM IR (-O2):
define void @rop3_152_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = xor i8 %4, -1
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isbdigit(int);
void t_isbdigit_0x31() {
  Assert_real((isbdigit(49)),
              "/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_isbdigit.c",
              250, ("isbdigit should be 1 for 1"));
}


x86 assembly (clang, -O0):
<t_isbdigit_0x31>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1040 <isbdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xfa,%edx
lea    0xf66(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isbdigit_0x31>:
push   %rax
mov    $0x31,%edi
call   1040 <isbdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0xfa,%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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 1 for 1\00"
define void @t_isbdigit_0x31() {
%1 = call i32 @isbdigit(i32 49)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([27 x i8], [27 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_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 1 for 1\00"
define void @t_isbdigit_0x31() {
%1 = tail call i32 @isbdigit(i32 49)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 250, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun0();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("To reach the end of this room, you must answer one simple question "
         "with base 10 numbers.\n");
  fun0();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <fun0@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [90 x i8] c"To reach the end of this room, you must answer one simple question with base 10 numbers.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([90 x i8], [90 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @fun0()
ret i32 0
}

LLVM IR (-O2):
@str = [89 x i8] c"To reach the end of this room, you must answer one simple question with base 10 numbers.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([89 x i8], [89 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @fun0()
ret i32 0
}
/* Variables and functions */
long long mask_value(long long);
long long int intNot(long long int x) { return mask_value(~x); }


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

x86 assembly (clang, -O2):
<intNot>:
not    %rdi
jmp    1030 <mask_value@plt>

LLVM IR (-O0):
define i64 @intNot(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = xor i64 %3, -1
%5 = call i64 @mask_value(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @intNot(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @mask_value(i64 %2)
ret i64 %3
}
minus(i) { return i - 1; }


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

x86 assembly (clang, -O2):
<minus>:
lea    -0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @minus(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ d4(int);
void d3(int n) { d4(n); }


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

x86 assembly (clang, -O2):
<d3>:
jmp    1030 <d4@plt>

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

LLVM IR (-O2):
define void @d3(i32 %0) {
%2 = tail call i32 @d4(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int test1(int);
int test4(int);
void test(int a, int b) {
  if (test1(a) != b)
    abort();
  if (test4(a) != b)
    abort();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <test1@plt>
cmp    -0x8(%rbp),%eax
je     1156 <test+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%edi
call   1050 <test4@plt>
cmp    -0x8(%rbp),%eax
je     116e <test+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <test1@plt>
cmp    %ebx,%eax
jne    1152 <test+0x22>
mov    %ebp,%edi
call   1050 <test4@plt>
cmp    %ebx,%eax
jne    1152 <test+0x22>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @test1(i32 %5)
%7 = load i32, i32* %4
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
%12 = load i32, i32* %3
%13 = call i32 @test4(i32 %12)
%14 = load i32, i32* %4
%15 = icmp ne i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %11
ret void
}

LLVM IR (-O2):
define void @test(i32 %0, i32 %1) {
%3 = tail call i32 @test1(i32 %0)
%4 = icmp eq i32 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call i32 @test4(i32 %0)
%9 = icmp eq i32 %8, %1
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %7
ret void
}
/* Type definitions */
typedef float int8_t;

/* Variables and functions */
int8_t maths_sign(float x) {
  if (x >= 0.0f) {
    return 1.0f;
  } else {
    return -1.0f;
  }
}


x86 assembly (clang, -O0):
<maths_sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112c <maths_sign+0x2c>
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1139 <maths_sign+0x39>
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<maths_sign>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @maths_sign(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp oge float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 1.000000e+00, float* %2
br label %8
7: ; preds = %1
store float -1.000000e+00, float* %2
br label %8
8: ; preds = %7, %6
%9 = load float, float* %2
ret float %9
}

LLVM IR (-O2):
define float @maths_sign(float %0) {
%2 = fcmp ult float %0, 0.000000e+00
%3 = select i1 %2, float -1.000000e+00, float 1.000000e+00
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sleep(int);
void ouch(int sig) {
  printf("\nOUCH! - I got signal %d\n", sig);
  sleep(3);
  signal(SIGINT, SIG_DFL);
}


x86 assembly (clang, -O0):
<ouch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ouch>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x3,%edi
call   1050 <sleep@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
pop    %rax
jmp    1040 <signal@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0AOUCH! - I got signal %d\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @sleep(i32 3)
%6 = load i32, i32* @SIGINT
%7 = load i32, i32* @SIG_DFL
%8 = call i32 @signal(i32 %6, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"\0AOUCH! - I got signal %d\0A\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @ouch(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 3)
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xe9() {
  Assert_real((isascii(233) == 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_isascii.c",
              1170, ("isascii should be 0 for 0xe9"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe9\00"
define void @t_isascii_0xe9() {
%1 = call i64 @isascii(i32 233)
%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 1170, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe9\00"
define void @t_isascii_0xe9() {
%1 = tail call i64 @isascii(i32 233)
%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 1170, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int dobldobl_diagonal_homotopy(int a, int b) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(289, &a, &b, c);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_diagonal_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x121,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_diagonal_homotopy>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x121,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dobldobl_diagonal_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc(i32 289, i32* %3, i32* %4, double* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_diagonal_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc(i32 289, i32* %3, i32* %4, double* undef)
ret i32 %5
}
/* Type definitions */
struct iovec {
  int dummy;
};
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
ssize_t readv(int fd, const struct iovec *iov, int iovcnt) {
  assert(!"NYI");
  return -1;
}


x86 assembly (clang, -O0):
<readv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readv>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.iovec = type { i32 }
@.str = [4 x i8] c"NYI\00"
define i32 @readv(i32 %0, %struct.iovec* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.iovec*
%6 = alloca i32
store i32 %0, i32* %4
store %struct.iovec* %1, %struct.iovec** %5
store i32 %2, i32* %6
%7 = call i32 @assert(i32 0)
ret i32 -1
}

LLVM IR (-O2):
%struct.iovec = type { i32 }
define i32 @readv(i32 %0, %struct.iovec* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @assert(i32 0)
ret i32 -1
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int getsockname(int, struct sockaddr *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void std_getsockname(int s, struct sockaddr *name, socklen_t *namelen) {
  if (getsockname(s, name, namelen) == -1) {
    perror("getsockname");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_getsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <getsockname@plt>
cmp    $0xffffffff,%eax
jne    1172 <std_getsockname+0x42>
lea    0xe9d(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_getsockname>:
push   %rax
call   1040 <getsockname@plt>
cmp    $0xffffffff,%eax
je     113d <std_getsockname+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"getsockname\00"
define void @std_getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load %struct.sockaddr*, %struct.sockaddr** %5
%9 = load i32*, i32** %6
%10 = call i32 @getsockname(i32 %7, %struct.sockaddr* %8, i32* %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [12 x i8] c"getsockname\00"
define void @std_getsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = tail call i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
int do_787() { return 787; }


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

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

LLVM IR (-O0):
define i32 @do_787() {
ret i32 787
}

LLVM IR (-O2):
define i32 @do_787() {
ret i32 787
}
/* Variables and functions */
int /*<<< orphan*/ pushNarray(char *, unsigned int);
void pushpointer4array(void *x, int n) {
  pushNarray((char *)x, (unsigned int)(n * 4));
}


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

x86 assembly (clang, -O2):
<pushpointer4array>:
shl    $0x2,%esi
jmp    1030 <pushNarray@plt>

LLVM IR (-O0):
define void @pushpointer4array(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 = mul nsw i32 %6, 4
%8 = call i32 @pushNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @pushpointer4array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @pushNarray(i8* %0, i32 %3)
ret void
}
void f(int *f) {
  if (f == (void *)0)
    g();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112e <f+0x1e>
mov    $0x0,%al
call   1030 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %rdi,%rdi
je     1116 <f+0x6>
ret
xor    %eax,%eax
jmp    1030 <g@plt>

LLVM IR (-O0):
define void @f(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @g()
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @f(i32* readnone %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @g()
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_number(int);
int /*<<< orphan*/ output_with_tab(char *);
void add_offset(int val) {
  output_with_tab("addd ");
  output_number(val);
  newline();
}


x86 assembly (clang, -O0):
<add_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    -0x4(%rbp),%edi
call   1050 <output_number@plt>
mov    $0x0,%al
call   1030 <newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_offset>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    %ebx,%edi
call   1050 <output_number@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"addd \00"
define void @add_offset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @output_number(i32 %4)
%6 = call i32 (...) @newline()
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"addd \00"
define void @add_offset(i32 %0) {
%2 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @output_number(i32 %0)
%4 = tail call i32 (...) @newline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_server();
void test_network() { test_server(); }


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

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

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

LLVM IR (-O2):
define void @test_network() {
%1 = tail call i32 (...) @test_server()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stdout;
void putcharf(int c) {
  putchar(c);
  fflush(stdout);
}


x86 assembly (clang, -O0):
<putcharf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcharf>:
push   %rax
call   1030 <putchar@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @putcharf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @putchar(i32 %3)
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @putcharf(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}