xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(const void *data) { printf(" %02d", *(int *)data); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    (%rdi),%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c" %02d\00"
define void @print(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int test_imm_1Fint16_reg(short val) {
  return ((val) & (0x1F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Fint16_reg(i16 signext %0) {
%2 = and i16 %0, 31
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_91uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x91 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_91uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 145
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int getpid();
int getYAKThreadid(void) { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @getYAKThreadid() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getYAKThreadid() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ NapiszTekst(char *);
int /*<<< orphan*/ PiszW(int, int);
void WyswietlEkranWygranej() {
  PiszW(4, 4);
  NapiszTekst("Wygrana");
}


x86 assembly (clang, -O0):
<WyswietlEkranWygranej>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%esi
mov    %esi,%edi
call   1030 <PiszW@plt>
lea    0xec9(%rip),%rdi
call   1040 <NapiszTekst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<WyswietlEkranWygranej>:
push   %rax
mov    $0x4,%edi
mov    $0x4,%esi
call   1030 <PiszW@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1040 <NapiszTekst@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Wygrana\00"
define void @WyswietlEkranWygranej() {
%1 = call i32 @PiszW(i32 4, i32 4)
%2 = call i32 @NapiszTekst(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Wygrana\00"
define void @WyswietlEkranWygranej() {
%1 = tail call i32 @PiszW(i32 4, i32 4)
%2 = tail call i32 @NapiszTekst(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void crash_fprintf() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  fprintf(f, "blablabla\n");
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_fprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_fprintf>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"blablabla\0A\00"
define void @crash_fprintf() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"blablabla\0A\00"
define void @crash_fprintf() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64 10, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _umask_usage(void) {
  fputs("Usage: umask [-s][mask]\n  -S	provide symbolic output\n", stderr);
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"Usage: umask [-s][mask]\0A -S\09provide symbolic output\0A\00"
@stderr = global i32 0
define i32 @_umask_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [54 x i8] c"Usage: umask [-s][mask]\0A -S\09provide symbolic output\0A\00"
@stderr = global i32 0
define i32 @_umask_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xce() {
  Assert_real((islower(206) == 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_islower.c",
              1035, ("islower should be 0 for 0xce"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xce>:
push   %rax
mov    $0xce,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x40b,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xce\00"
define void @t_islower_0xce() {
%1 = call i64 @islower(i32 206)
%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 1035, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xce\00"
define void @t_islower_0xce() {
%1 = tail call i64 @islower(i32 206)
%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 1035, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void clean_cache_dir(char *dir) {
  char cmd[7 + 18];
  sprintf(cmd, "rm -rf %s", dir);
  system(cmd);
  free(dir);
}


x86 assembly (clang, -O0):
<clean_cache_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1050 <sprintf@plt>
lea    -0x30(%rbp),%rdi
call   1040 <system@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_cache_dir>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
lea    0xebf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <system@plt>
mov    %rbx,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"rm -rf %s\00"
define void @clean_cache_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca [25 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%8 = call i32 @system(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"rm -rf %s\00"
define void @clean_cache_dir(i8* %0) {
%2 = alloca [25 x i8]
%3 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
%6 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetAnalogGainAndOffset(char byBoardNum, char byChannel, short wAnalogGain,
                             short wAnalogOffset) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetAnalogGainAndOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cx,%ax
mov    %dx,%cx
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define i32 @pvSetAnalogGainAndOffset(i8 signext %0, i8 signext %1, i16 signext %2, i16 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i16
%8 = alloca i16
store i8 %0, i8* %5
store i8 %1, i8* %6
store i16 %2, i16* %7
store i16 %3, i16* %8
%9 = call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetAnalogGainAndOffset(i8 signext %0, i8 signext %1, i16 signext %2, i16 signext %3) {
%5 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgldinc(void) { gen("mov\tbx,ax"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"mov\09bx,ax\00"
define void @cgldinc() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"mov\09bx,ax\00"
define void @cgldinc() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long compress(int /*<<< orphan*/, short);
int /*<<< orphan*/ hash_string(char const *);
unsigned long hash_sym_constant_raw_info(const char *name, short num_bits) {
  return compress(hash_string(name), num_bits);
}


x86 assembly (clang, -O0):
<hash_sym_constant_raw_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hash_string@plt>
mov    %eax,%edi
movswl -0xa(%rbp),%esi
call   1030 <compress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sym_constant_raw_info>:
push   %rbx
mov    %esi,%ebx
call   1040 <hash_string@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <compress@plt>

LLVM IR (-O0):
define i64 @hash_sym_constant_raw_info(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = call i32 @hash_string(i8* %5)
%7 = load i16, i16* %4
%8 = call i64 @compress(i32 %6, i16 signext %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @hash_sym_constant_raw_info(i8* %0, i16 signext %1) {
%3 = tail call i32 @hash_string(i8* %0)
%4 = tail call i64 @compress(i32 %3, i16 signext %1)
ret i64 %4
}
/* Variables and functions */
scalar_t__ isupper(char);
unsigned short tolower(char c) { return isupper(c) ? (c + 0x20) : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     1140 <tolower+0x30>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1147 <tolower+0x37>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define zeroext i16 @tolower(i8 signext %0) {
%2 = tail call i64 @isupper(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, 32
%6 = select i1 %3, i32 %4, i32 %5
%7 = trunc i32 %6 to i16
ret i16 %7
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void put16(uint8_t *data_buf, int *pidx, uint16_t c) {
  int idx;
  idx = *pidx;
  data_buf[idx++] = c;
  data_buf[idx++] = c >> 8;
  *pidx = idx;
}


x86 assembly (clang, -O0):
<put16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
sar    $0x8,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x18(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put16>:
movslq (%rsi),%rax
mov    %edx,(%rdi,%rax,4)
sar    $0x8,%edx
lea    0x2(%rax),%ecx
mov    %edx,0x4(%rdi,%rax,4)
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define void @put16(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32, i32* %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %7
%13 = add nsw i32 %12, 1
store i32 %13, i32* %7
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
store i32 %10, i32* %15
%16 = load i32, i32* %6
%17 = ashr i32 %16, 8
%18 = load i32*, i32** %4
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i32, i32* %18, i64 %21
store i32 %17, i32* %22
%23 = load i32, i32* %7
%24 = load i32*, i32** %5
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @put16(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %2, i32* %7
%8 = ashr i32 %2, 8
%9 = add nsw i32 %4, 2
%10 = sext i32 %5 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 %8, i32* %11
store i32 %9, i32* %1
ret void
}
int __ev_ri6_changed() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__ev_ri6_changed() {
ret i32 0
}
/* Variables and functions */
void glmSub3fs_(float x[3], float y) {
  for (size_t i = 0; i < 3; ++i)
    x[i] -= y;
}


x86 assembly (clang, -O0):
<glmSub3fs_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    114c <glmSub3fs_+0x4c>
movss  -0xc(%rbp),%xmm1
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1115 <glmSub3fs_+0x15>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmSub3fs_>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm2
subss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
subss  %xmm0,%xmm2
movss  %xmm2,0x4(%rdi)
movss  0x8(%rdi),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmSub3fs_(float* %0, float %1) {
%3 = alloca float*
%4 = alloca float
%5 = alloca i64
store float* %0, float** %3
store float %1, float* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load float, float* %4
%11 = load float*, float** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds float, float* %11, i64 %12
%14 = load float, float* %13
%15 = fsub float %14, %10
store float %15, float* %13
br label %16
16: ; preds = %9
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmSub3fs_(float* nocapture %0, float %1) {
%3 = load float, float* %0
%4 = fsub float %3, %1
store float %4, float* %0
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = fsub float %6, %1
store float %7, float* %5
%8 = getelementptr inbounds float, float* %0, i64 2
%9 = load float, float* %8
%10 = fsub float %9, %1
store float %10, float* %8
ret void
}
unsigned getval_264() { return 3286272328U; }


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

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

LLVM IR (-O0):
define i32 @getval_264() {
ret i32 -1008694968
}

LLVM IR (-O2):
define i32 @getval_264() {
ret i32 -1008694968
}
/* Variables and functions */
long strtoll(char const *, char **, int);
long int strtol(const char *nptr, char **endptr, int base) {
  return strtoll(nptr, endptr, base);
}


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

x86 assembly (clang, -O2):
<strtol>:
jmp    1030 <strtoll@plt>

LLVM IR (-O0):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i64 @strtoll(i8* %7, i8** %8, i32 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtoll(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int, int);
void b_pad(char *str, int len) {
  memset(str, ((int)' '), len);
  return;
}


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

x86 assembly (clang, -O2):
<b_pad>:
mov    %esi,%edx
mov    $0x20,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @b_pad(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @memset(i8* %5, i32 32, i32 %6)
ret void
}

LLVM IR (-O2):
define void @b_pad(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 32, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *get_workdir();
int /*<<< orphan*/ make_dir(char *);
void init(void) {
  char *workdir = get_workdir();
  make_dir(workdir);
  free(workdir);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_workdir@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <make_dir@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbx
xor    %eax,%eax
call   1040 <get_workdir@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <make_dir@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @init() {
%1 = alloca i8*
%2 = call i8* (...) @get_workdir()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @make_dir(i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i8* (...) @get_workdir()
%2 = tail call i32 @make_dir(i8* %1)
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_license_intro() {
  printf("Croatian chess - console application\n"
         "Copyright (c) 2021 Mario Mlačak, mmlacak@gmail.com.\n");
}


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

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

LLVM IR (-O0):
@.str = [91 x i8] c"Croatian chess - console application\0ACopyright (c) 2021 Mario Mla\C4\8Dak, mmlacak@gmail.com.\0A\00"
define void @print_license_intro() {
%1 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [90 x i8] c"Croatian chess - console application\0ACopyright (c) 2021 Mario Mla\C4\8Dak, mmlacak@gmail.com.\00"
define void @print_license_intro() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([90 x i8], [90 x i8]* @str, i64 0, i64 0))
ret void
}
int foo_hello(void) { return 10; }


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

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

LLVM IR (-O0):
define i32 @foo_hello() {
ret i32 10
}

LLVM IR (-O2):
define i32 @foo_hello() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ puts0(char *);
void help(void) {
  puts0("Proolix-l shell command\r\n\r\ntest - test\r\nhelp - help\r\nascii - "
        "write ascii table\r\ncls - clearscreen\r\npalette - print color "
        "palette\r\nsystem - print system parameters\r\nmemd - memory "
        "dump\r\nmemmap - print memory map\r\nbasic - call ROM BASIC (if "
        "exist)\r\ndiskd0 - disk dump #1\r\ndiskd - disk dump #2\r\nls - "
        "ls\r\nexit, quit - exit\r\n");
}


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

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

LLVM IR (-O0):
@.str = [320 x i8] c"Proolix-l shell command\0D\0A\0D\0Atest - test\0D\0Ahelp - help\0D\0Aascii - write ascii table\0D\0Acls - clearscreen\0D\0Apalette - print color palette\0D\0Asystem - print system parameters\0D\0Amemd - memory dump\0D\0Amemmap - print memory map\0D\0Abasic - call ROM BASIC (if exist)\0D\0Adiskd0 - disk dump\0D\0Adiskd - disk dump\0D\0Als - ls\0D\0Aexit, quit - exit\0D\0A\00"
define void @help() {
%1 = call i32 @puts0(i8* getelementptr inbounds ([320 x i8], [320 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [320 x i8] c"Proolix-l shell command\0D\0A\0D\0Atest - test\0D\0Ahelp - help\0D\0Aascii - write ascii table\0D\0Acls - clearscreen\0D\0Apalette - print color palette\0D\0Asystem - print system parameters\0D\0Amemd - memory dump\0D\0Amemmap - print memory map\0D\0Abasic - call ROM BASIC (if exist)\0D\0Adiskd0 - disk dump\0D\0Adiskd - disk dump\0D\0Als - ls\0D\0Aexit, quit - exit\0D\0A\00"
define void @help() {
%1 = tail call i32 @puts0(i8* getelementptr inbounds ([320 x i8], [320 x i8]* @.str, i64 0, i64 0))
ret void
}
int main() {
  int x$1 = 0;
  int z$1;
  int z$2 = 0;
  (z$2 = 20);
  int y$1 = z$2;
  (y$1 += 1);
  (y$1 = ((y$1 *= 2) + 4));
  {
    __label__ break$1;
    __label__ continue$1;
    ;
  loop$$1:;
    if ((!1))
      goto break$1;
    (x$1 + 1);
  continue$1:;
    ;
    goto loop$$1;
  break$1:;
  }
  if (x$1) {
    (x$1 *= 20);
    (y$1 *= 30);
  } else
    (y$1 *= 2);
  (z$1 = (5 + 5));
  (z$1 = ((2 + 3) * (2 + 3)));
  ((y$1 * y$1) + (y$1 * y$1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x14,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    113e <main+0x3e>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
int in_bounds(int y, int x, int height, int width, int median) {
  return y - median >= 0 && x - median >= 0 && y + median <= height - 1 &&
         x + median <= width - 1;
}


x86 assembly (clang, -O0):
<in_bounds>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%ecx
sub    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jl     1169 <in_bounds+0x69>
mov    -0x8(%rbp),%ecx
sub    -0x14(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x15(%rbp)
jl     1169 <in_bounds+0x69>
mov    -0x4(%rbp),%ecx
add    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x15(%rbp)
jg     1169 <in_bounds+0x69>
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setle  %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_bounds>:
cmp    %r8d,%edi
setge  %r9b
cmp    %r8d,%esi
setge  %al
and    %r9b,%al
add    %r8d,%edi
cmp    %edx,%edi
setl   %dl
and    %al,%dl
add    %esi,%r8d
cmp    %ecx,%r8d
setl   %al
and    %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @in_bounds(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sge i32 %0, %4
%7 = icmp sge i32 %1, %4
%8 = and i1 %6, %7
%9 = add nsw i32 %4, %0
%10 = icmp slt i32 %9, %2
%11 = select i1 %8, i1 %10, i1 false
%12 = add nsw i32 %4, %1
%13 = icmp slt i32 %12, %3
%14 = select i1 %11, i1 %13, i1 false
%15 = zext i1 %14 to i32
ret i32 %15
}
void Vector_Scale(float vectorOut[3], float vectorIn[3], float scale2) {
  int c = 0;
  while (c < 3) {
    vectorOut[c] = vectorIn[c] * scale2;
    c++;
  }
}


x86 assembly (clang, -O0):
<Vector_Scale>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    114f <Vector_Scale+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mulss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <Vector_Scale+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector_Scale>:
movss  (%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,(%rdi)
movss  0x4(%rsi),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0x4(%rdi)
mulss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @Vector_Scale(float* nocapture writeonly %0, float* nocapture %1, float %2) {
%4 = load float, float* %1
%5 = fmul float %4, %2
store float %5, float* %0
%6 = getelementptr inbounds float, float* %1, i64 1
%7 = load float, float* %6
%8 = fmul float %7, %2
%9 = getelementptr inbounds float, float* %0, i64 1
store float %8, float* %9
%10 = getelementptr inbounds float, float* %1, i64 2
%11 = load float, float* %10
%12 = fmul float %11, %2
%13 = getelementptr inbounds float, float* %0, i64 2
store float %12, float* %13
ret void
}
/* Variables and functions */
int close(int);
int closeSocket(int h) { return close(h); }


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

x86 assembly (clang, -O2):
<closeSocket>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @closeSocket(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
void *FETCH_STORE(void **ptr, void *val) {
  void *out;
  asm volatile("lock xchg %0, (%1)" : "=r"(out) : "r"(ptr), "0"(val));
  return out;
}


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

x86 assembly (clang, -O2):
<FETCH_STORE>:
mov    %rsi,%rax
lock xchg %rax,(%rdi)
ret

LLVM IR (-O0):
define i8* @FETCH_STORE(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %4
%8 = call i8* asm sideeffect "lock xchg $0, ($1)", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i8** %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define i8* @FETCH_STORE(i8** %0, i8* %1) {
%3 = tail call i8* asm sideeffect "lock xchg $0, ($1)", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i8** %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
void cgiMakeIntVar(char *varName, int initialVal, int maxDigits) {
  if (maxDigits == 0)
    maxDigits = 4;
  printf("<INPUT TYPE=TEXT NAME=\"%s\" SIZE=%d VALUE=%d>", varName, maxDigits,
         initialVal);
}


x86 assembly (clang, -O0):
<cgiMakeIntVar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1133 <cgiMakeIntVar+0x23>
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgiMakeIntVar>:
mov    %esi,%ecx
mov    %rdi,%rsi
test   %edx,%edx
mov    $0x4,%eax
cmove  %eax,%edx
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"<INPUT TYPE=TEXT NAME=\22%s\22 SIZE=%d VALUE=%d>\00"
define void @cgiMakeIntVar(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3
store i32 4, i32* %6
br label %10
10: ; preds = %9, %3
%11 = load i8*, i8** %4
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"<INPUT TYPE=TEXT NAME=\22%s\22 SIZE=%d VALUE=%d>\00"
define void @cgiMakeIntVar(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 0
%5 = select i1 %4, i32 4, i32 %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %5, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RCFileReadWrite(int /*<<< orphan*/, int);
int /*<<< orphan*/ RCgenerator(char *);
int CreateRC(char source[]) {
  RCFileReadWrite(RCgenerator(source), 1);
  return 0;
}


x86 assembly (clang, -O0):
<CreateRC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <RCgenerator@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <RCFileReadWrite@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateRC>:
push   %rax
call   1040 <RCgenerator@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <RCFileReadWrite@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CreateRC(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @RCgenerator(i8* %3)
%5 = call i32 @RCFileReadWrite(i32 %4, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @CreateRC(i8* %0) {
%2 = tail call i32 @RCgenerator(i8* %0)
%3 = tail call i32 @RCFileReadWrite(i32 %2, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x55() {
  Assert_real((isupper(85)),
              "/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_isupper.c",
              430, ("isupper should be 1 for U"));
}


x86 assembly (clang, -O0):
<t_isupper_0x55>:
push   %rbp
mov    %rsp,%rbp
mov    $0x55,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1ae,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x55>:
push   %rax
mov    $0x55,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1ae,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for U\00"
define void @t_isupper_0x55() {
%1 = call i32 @isupper(i32 85)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 430, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for U\00"
define void @t_isupper_0x55() {
%1 = tail call i32 @isupper(i32 85)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 430, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int cairo_code_draw_envMidiLabel_get_height() { return 9; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envMidiLabel_get_height() {
ret i32 9
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envMidiLabel_get_height() {
ret i32 9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void *malloc(int /*<<< orphan*/);
void *xBuffer_alloc(uint32_t u32Size) {
  void *pvAlloc = NULL;
  if ((pvAlloc = malloc(u32Size)) == NULL) {
    return NULL;
  };
  return pvAlloc;
}


x86 assembly (clang, -O0):
<xBuffer_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1146 <xBuffer_alloc+0x36>
movq   $0x0,-0x8(%rbp)
jmp    114e <xBuffer_alloc+0x3e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xBuffer_alloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @xBuffer_alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
ret i8* %2
}
void DetectTlsJa3SHashRegisterTests(void) {}


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

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

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

LLVM IR (-O2):
define void @DetectTlsJa3SHashRegisterTests() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ lrand48();
int /*<<< orphan*/ srand48(int);
void fill_random(int64_t *dst, const int size) {
  srand48(123);
  int i;
  for (i = 0; i < size; i++) {
    dst[i] = lrand48();
  }
}


x86 assembly (clang, -O0):
<fill_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x7b,%edi
call   1040 <srand48@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116e <fill_random+0x4e>
mov    $0x0,%al
call   1030 <lrand48@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1140 <fill_random+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_random>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x7b,%edi
call   1040 <srand48@plt>
test   %ebp,%ebp
jle    1154 <fill_random+0x34>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <lrand48@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <fill_random+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @fill_random(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @srand48(i32 123)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = tail call i32 (...) @lrand48()
%10 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %9, i32* %10
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %2
ret void
}
short int shortint_ignoring_longlong(short int x, long long y) { return x; }


x86 assembly (clang, -O0):
<shortint_ignoring_longlong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @shortint_ignoring_longlong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @shortint_ignoring_longlong(i16 returned signext %0, i64 %1) {
ret i16 %0
}