xunge/DecIR huggingface dataset:
void CL_ClientDamageCommand(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ geteuid();
uid_t Sys_Geteuid(void) { return geteuid(); }


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

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

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

LLVM IR (-O2):
define i32 @Sys_Geteuid() {
%1 = tail call i32 (...) @geteuid()
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg32setBank0(int);
void m34setParams7FFD(uint16_t addr, uint8_t val) {
  (void)addr;
  prg32setBank0((val & 0xF) << 15);
}


x86 assembly (clang, -O0):
<m34setParams7FFD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xf,%edi
shl    $0xf,%edi
call   1030 <prg32setBank0@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m34setParams7FFD>:
mov    %esi,%edi
and    $0xf,%edi
shl    $0xf,%edi
jmp    1030 <prg32setBank0@plt>

LLVM IR (-O0):
define void @m34setParams7FFD(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 = load i32, i32* %4
%7 = and i32 %6, 15
%8 = shl i32 %7, 15
%9 = call i32 @prg32setBank0(i32 %8)
ret void
}

LLVM IR (-O2):
define void @m34setParams7FFD(i32 %0, i32 %1) {
%3 = shl i32 %1, 15
%4 = and i32 %3, 491520
%5 = tail call i32 @prg32setBank0(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLint;
typedef int /*<<< orphan*/ GLenum;

/* Variables and functions */
int /*<<< orphan*/ glTexGeni(int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
void TexGeni(GLenum coord, GLenum pname, GLint param) {
  glTexGeni(coord, pname, param);
}


x86 assembly (clang, -O0):
<TexGeni>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <glTexGeni@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TexGeni>:
jmp    1030 <glTexGeni@plt>

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

LLVM IR (-O2):
define void @TexGeni(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glTexGeni(i32 %0, i32 %1, i32 %2)
ret void
}
int ErrMax() { return (30); }


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

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

LLVM IR (-O0):
define i32 @ErrMax() {
ret i32 30
}

LLVM IR (-O2):
define i32 @ErrMax() {
ret i32 30
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void msleep(int ms) {
  while (ms--) {
    usleep(1000);
  }
}


x86 assembly (clang, -O0):
<msleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <msleep+0x2e>
mov    $0x3e8,%edi
call   1030 <usleep@plt>
jmp    111b <msleep+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msleep>:
push   %rbx
test   %edi,%edi
je     112f <msleep+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <usleep@plt>
add    $0xffffffff,%ebx
jne    1120 <msleep+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @msleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %7, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, -1
store i32 %5, i32* %2
%6 = icmp ne i32 %4, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 @usleep(i32 1000)
br label %3
9: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @msleep(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 @usleep(i32 1000)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int get_customize_color() { return 23; }


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

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

LLVM IR (-O0):
define i32 @get_customize_color() {
ret i32 23
}

LLVM IR (-O2):
define i32 @get_customize_color() {
ret i32 23
}
/* Variables and functions */
int /*<<< orphan*/ function();
int /*<<< orphan*/ printf(char *, int (*)());
int main(void) {
  printf("main() code starts at address %p\n", main);
  function();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    0x2eab(%rip),%rsi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <function@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [34 x i8] c"main() code starts at address %p\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
%3 = call i32 (...) @function()
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"main() code starts at address %p\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 (...)* bitcast (i32 ()* @main to i32 (...)*))
%2 = tail call i32 (...) @function()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int dir_is_empty_at(int /*<<< orphan*/, char const *);
int dir_is_empty(const char *path) { return dir_is_empty_at(AT_FDCWD, path); }


x86 assembly (clang, -O0):
<dir_is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <dir_is_empty_at@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dir_is_empty>:
mov    %rdi,%rsi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
jmp    1030 <dir_is_empty_at@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @dir_is_empty(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @AT_FDCWD
%4 = load i8*, i8** %2
%5 = call i32 @dir_is_empty_at(i32 %3, i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @dir_is_empty(i8* %0) {
%2 = load i32, i32* @AT_FDCWD
%3 = tail call i32 @dir_is_empty_at(i32 %2, i8* %0)
ret i32 %3
}
void ASN1_UTCTIME_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_UTCTIME_free() {
ret void
}
int test_imm_AEuint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xAE << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AEuint64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 174
%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_AEuint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 174
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int function(void) {
  printf("Hello, world!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, world!\00"
define i32 @function() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float cross_sectional_area(int base, int height) { return base * height * 1.0; }


x86 assembly (clang, -O0):
<cross_sectional_area>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cross_sectional_area>:
imul   %esi,%edi
cvtsi2ss %edi,%xmm0
ret

LLVM IR (-O0):
define float @cross_sectional_area(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 = load i32, i32* %4
%7 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 1.000000e+00
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @cross_sectional_area(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to float
ret float %4
}
int ft_toupper(int c) {
  if (c >= 'a' && c <= 'z')
    return (c - ('m' - 'M'));
  return (c);
}


x86 assembly (clang, -O0):
<ft_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1129 <ft_toupper+0x29>
cmpl   $0x7a,-0x8(%rbp)
jg     1129 <ft_toupper+0x29>
mov    -0x8(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_toupper+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
unsigned kol_key_control() { asm("int $0x40" ::"a"(66), "b"(3)); }


x86 assembly (clang, -O0):
<kol_key_control>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x42,%eax
mov    $0x3,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_key_control>:
push   %rbx
mov    $0x42,%eax
mov    $0x3,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_key_control() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 66, i32 3)
ret i32 undef
}
unsigned char right_rotation(unsigned char val, int n) {
  return (val >> n) | (val << 8 - n);
}


x86 assembly (clang, -O0):
<right_rotation>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_rotation>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @right_rotation(i8 zeroext %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 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = ashr i32 %6, %7
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = load i32, i32* %4
%12 = sub nsw i32 8, %11
%13 = shl i32 %10, %12
%14 = or i32 %8, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @right_rotation(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshr.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ RSA;

/* Variables and functions */
int /*<<< orphan*/ RSA_F_RSA_NULL;
int /*<<< orphan*/ RSA_R_RSA_OPERATIONS_NOT_SUPPORTED;
int /*<<< orphan*/ RSAerr(int /*<<< orphan*/, int /*<<< orphan*/);
int RSA_null_private_encrypt(int flen, unsigned char *from, unsigned char *to,
                             RSA *rsa, int padding) {
  RSAerr(RSA_F_RSA_NULL, RSA_R_RSA_OPERATIONS_NOT_SUPPORTED);
  return -1;
}


x86 assembly (clang, -O0):
<RSA_null_private_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
call   1030 <RSAerr@plt>
mov    $0xffffffff,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA_null_private_encrypt>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%esi
call   1030 <RSAerr@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RSA_F_RSA_NULL = global i32 0
@RSA_R_RSA_OPERATIONS_NOT_SUPPORTED = global i32 0
define i32 @RSA_null_private_encrypt(i32 %0, i8* %1, i8* %2, i32* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32* %3, i32** %9
store i32 %4, i32* %10
%11 = load i32, i32* @RSA_F_RSA_NULL
%12 = load i32, i32* @RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
%13 = call i32 @RSAerr(i32 %11, i32 %12)
ret i32 -1
}

LLVM IR (-O2):
@RSA_F_RSA_NULL = global i32 0
@RSA_R_RSA_OPERATIONS_NOT_SUPPORTED = global i32 0
define i32 @RSA_null_private_encrypt(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32* nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @RSA_F_RSA_NULL
%7 = load i32, i32* @RSA_R_RSA_OPERATIONS_NOT_SUPPORTED
%8 = tail call i32 @RSAerr(i32 %6, i32 %7)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M261_f(char *s) {
  debug("M261_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M261_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M261_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M261_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M261_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M261_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M261_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
int HashIndexForName16(char *s) {
  int j, h;
  j = (((int *)(s))[0]) + (((int *)(s))[1]) + (((int *)(s))[2]) +
      (((int *)(s))[3]);
  h = ((j * 0xF14A83) >> 24) & 63;
  return (h);
}


x86 assembly (clang, -O0):
<HashIndexForName16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0x8(%rcx),%eax
mov    -0x8(%rbp),%rcx
add    0xc(%rcx),%eax
mov    %eax,-0xc(%rbp)
imul   $0xf14a83,-0xc(%rbp),%eax
sar    $0x18,%eax
and    $0x3f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashIndexForName16>:
movdqu (%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
imul   $0xf14a83,%eax,%eax
shr    $0x18,%eax
and    $0x3f,%eax
ret

LLVM IR (-O0):
define i32 @HashIndexForName16(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i8*, i8** %2
%10 = bitcast i8* %9 to i32*
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = add nsw i32 %8, %12
%14 = load i8*, i8** %2
%15 = bitcast i8* %14 to i32*
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = add nsw i32 %13, %17
%19 = load i8*, i8** %2
%20 = bitcast i8* %19 to i32*
%21 = getelementptr inbounds i32, i32* %20, i64 3
%22 = load i32, i32* %21
%23 = add nsw i32 %18, %22
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = mul nsw i32 %24, 15813251
%26 = ashr i32 %25, 24
%27 = and i32 %26, 63
store i32 %27, i32* %4
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @HashIndexForName16(i8* nocapture %0) {
%2 = bitcast i8* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %3)
%5 = mul nsw i32 %4, 15813251
%6 = lshr i32 %5, 24
%7 = and i32 %6, 63
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void error_oom() {
  fprintf(stderr, "Error: out of memory.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<error_oom>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_oom>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Error: out of memory.\0A\00"
define void @error_oom() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Error: out of memory.\0A\00"
define void @error_oom() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long id_function(void) {
  unsigned long ret;
  ret = (unsigned long)pthread_self();
  return (ret);
}


x86 assembly (clang, -O0):
<id_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pthread_self@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @id_function() {
%1 = alloca i64
%2 = call i64 (...) @pthread_self()
store i64 %2, i64* %1
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @id_function() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ fail(char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncat(char *, char *, scalar_t__);
int /*<<< orphan*/ strncpy(char *, char *, int);
void expected(char *s) {
  char errbuf[1024];
  strncpy(errbuf, s, 1024);
  strncat(errbuf, " Expected", 1024 - strlen(" Expected"));
  fail(errbuf);
}


x86 assembly (clang, -O0):
<expected>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x400,%edx
call   1030 <strncpy@plt>
lea    -0x410(%rbp),%rax
mov    %rax,-0x418(%rbp)
lea    0xe87(%rip),%rdi
call   1050 <strlen@plt>
mov    -0x418(%rbp),%rdi
mov    $0x400,%edx
sub    %rax,%rdx
lea    0xe6c(%rip),%rsi
call   1060 <strncat@plt>
lea    -0x410(%rbp),%rdi
call   1040 <fail@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expected>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%edx
call   1030 <strncpy@plt>
lea    0xeae(%rip),%rsi
mov    $0x3f7,%edx
mov    %rbx,%rdi
call   1050 <strncat@plt>
mov    %rbx,%rdi
call   1040 <fail@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c" Expected\00"
define void @expected(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 1024)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i64 @strlen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = sub nsw i64 1024, %8
%10 = call i32 @strncat(i8* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = call i32 @fail(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" Expected\00"
define void @expected(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 1024)
%5 = call i32 @strncat(i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 1015)
%6 = call i32 @fail(i8* %3)
ret void
}
void ARGBToRGB24Row_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToRGB24Row_SSSE3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vulnerable();
int main(int argc, char **argv) { vulnerable(); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <vulnerable@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @vulnerable()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
int /*<<< orphan*/ output_line(char *);
void gen_put_indirect(char typeobj) {
  gen_pop();
  if (typeobj & (1 << 2)) {
    output_line("ld a,l");
    output_line("ld (de),a");
  } else {
    gen_call("ccpint");
  }
}


x86 assembly (clang, -O0):
<gen_put_indirect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <gen_pop@plt>
movsbl -0x1(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1172 <gen_put_indirect+0x42>
lea    0xea4(%rip),%rdi
call   1040 <output_line@plt>
lea    0xe9f(%rip),%rdi
call   1040 <output_line@plt>
jmp    117e <gen_put_indirect+0x4e>
lea    0xe98(%rip),%rdi
call   1050 <gen_call@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_put_indirect>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <gen_pop@plt>
test   $0x4,%bl
jne    114c <gen_put_indirect+0x1c>
lea    0xecb(%rip),%rdi
pop    %rbx
jmp    1050 <gen_call@plt>
lea    0xead(%rip),%rdi
call   1040 <output_line@plt>
lea    0xea8(%rip),%rdi
pop    %rbx
jmp    1040 <output_line@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"ld a,l\00"
@.str.1 = [10 x i8] c"ld (de),a\00"
@.str.2 = [7 x i8] c"ccpint\00"
define void @gen_put_indirect(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 (...) @gen_pop()
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = and i32 %5, 4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %1
%12 = call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ld a,l\00"
@.str.1 = [10 x i8] c"ld (de),a\00"
@.str.2 = [7 x i8] c"ccpint\00"
define void @gen_put_indirect(i8 signext %0) {
%2 = tail call i32 (...) @gen_pop()
%3 = and i8 %0, 4
%4 = icmp eq i8 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @output_line(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @output_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = tail call i32 @gen_call(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void uninitvar_free(void) {
  void *block;
  free(block);
}


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

x86 assembly (clang, -O2):
<uninitvar_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @uninitvar_free() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @free(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_free() {
%1 = tail call i32 @free(i8* undef)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_1692() {
  Assert_real((isqrt(1692) == 41),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              1300, ("Integer square root of 1692 should be 41"));
}


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

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

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 1692 should be 41\00"
define void @t_sqrt_1692() {
%1 = call i32 @isqrt(i32 1692)
%2 = icmp eq i32 %1, 41
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1300, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [41 x i8] c"Integer square root of 1692 should be 41\00"
define void @t_sqrt_1692() {
%1 = tail call i32 @isqrt(i32 1692)
%2 = icmp eq i32 %1, 41
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1300, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void save_arrays_boundary_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @save_arrays_boundary_adios_() {
ret void
}
/* Variables and functions */
int __WORDSIZE;
int /*<<< orphan*/ __bitmap_and(unsigned long *, unsigned long const *,
                                unsigned long const *, int);
void bitmap_and(unsigned long *dst, const unsigned long *src1,
                const unsigned long *src2, int nbits) {
  if (nbits <= __WORDSIZE)
    *dst = *src1 & *src2;
  else
    __bitmap_and(dst, src1, src2, nbits);
}


x86 assembly (clang, -O0):
<bitmap_and>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%eax
jg     1153 <bitmap_and+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
and    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1167 <bitmap_and+0x57>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__bitmap_and@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmap_and>:
mov    0x2ed1(%rip),%rax
cmp    %ecx,(%rax)
jge    1120 <bitmap_and+0x10>
jmp    1030 <__bitmap_and@plt>
mov    (%rdx),%rax
and    (%rsi),%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
@__WORDSIZE = global i32 0
define void @bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3) {
%5 = load i32, i32* @__WORDSIZE
%6 = icmp slt i32 %5, %3
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = load i64, i64* %1
%9 = load i64, i64* %2
%10 = and i64 %9, %8
store i64 %10, i64* %0
br label %13
11: ; preds = %4
%12 = tail call i32 @__bitmap_and(i64* %0, i64* %1, i64* %2, i32 %3)
br label %13
13: ; preds = %11, %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ A();
int *C(int /*<<< orphan*/ (*)(int /*<<< orphan*/), int /*<<< orphan*/);
int /*<<< orphan*/ func(int /*<<< orphan*/);
int *B() {
  func(A());
  return C(func, A());
}


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <A@plt>
mov    %eax,%edi
call   1050 <func@plt>
mov    $0x0,%al
call   1040 <A@plt>
mov    %eax,%esi
mov    0x2ea6(%rip),%rdi
call   1030 <C@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
push   %rbx
xor    %eax,%eax
call   1040 <A@plt>
mov    %eax,%edi
call   1050 <func@plt>
mov    0x2eb2(%rip),%rbx
xor    %eax,%eax
call   1040 <A@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <C@plt>

LLVM IR (-O0):
define i32* @B() {
%1 = call i32 (...) @A()
%2 = call i32 @func(i32 %1)
%3 = call i32 (...) @A()
%4 = call i32* @C(i32 (i32)* @func, i32 %3)
ret i32* %4
}

LLVM IR (-O2):
define i32* @B() {
%1 = tail call i32 (...) @A()
%2 = tail call i32 @func(i32 %1)
%3 = tail call i32 (...) @A()
%4 = tail call i32* @C(i32 (i32)* @func, i32 %3)
ret i32* %4
}
/* Type definitions */
typedef union cptable {
  int dummy;
} cptable;

/* Variables and functions */
union cptable const *wine_cp_get_table(unsigned int);
const union cptable *get_codepage_table(unsigned int codepage) {
  return wine_cp_get_table(codepage);
}


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

x86 assembly (clang, -O2):
<get_codepage_table>:
jmp    1030 <wine_cp_get_table@plt>

LLVM IR (-O0):
%union.cptable = type { i32 }
define %union.cptable* @get_codepage_table(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call %union.cptable* @wine_cp_get_table(i32 %3)
ret %union.cptable* %4
}

LLVM IR (-O2):
%union.cptable = type { i32 }
define %union.cptable* @get_codepage_table(i32 %0) {
%2 = tail call %union.cptable* @wine_cp_get_table(i32 %0)
ret %union.cptable* %2
}
void set(int *n, int *x) {
  if (!x) {
    x = n;
    set(n, x);
  } else
    *x = 13;
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1145 <set+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <set@plt>
jmp    114f <set+0x3f>
mov    -0x10(%rbp),%rax
movl   $0xd,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set>:
test   %rsi,%rsi
je     1110 <set+0x10>
movl   $0xd,(%rsi)
ret
nopl   0x0(%rax)
test   %rdi,%rdi
je     1110 <set+0x10>
mov    %rdi,%rsi
movl   $0xd,(%rsi)
ret

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

LLVM IR (-O2):
define void @set(i32* %0, i32* writeonly %1) {
%3 = icmp eq i32* %1, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i32* %0, null
br label %6
6: ; preds = %6, %4
br i1 %5, label %6, label %7
7: ; preds = %6, %2
%8 = phi i32* [ %1, %2 ], [ %0, %6 ]
store i32 13, i32* %8
ret void
}
/* Variables and functions */
scalar_t__ asinh(double);
float asinhf(float x) { return (float)asinh((double)x); }


x86 assembly (clang, -O0):
<asinhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <asinh@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinhf>:
push   %rax
cvtss2sd %xmm0,%xmm0
call   1030 <asinh@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define float @asinhf(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @asinh(double %2)
%4 = sitofp i64 %3 to float
ret float %4
}
int ocl_hw_atomic16_postinc(int index) {}


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

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

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

LLVM IR (-O2):
define i32 @ocl_hw_atomic16_postinc(i32 %0) {
ret i32 undef
}
int ShouldTerminate(double number) {
  if (number <= 0.0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ShouldTerminate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1123 <ShouldTerminate+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <ShouldTerminate+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShouldTerminate>:
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

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

LLVM IR (-O2):
define i32 @ShouldTerminate(double %0) {
%2 = fcmp ole double %0, 0.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
void close(void) {}


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

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

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

LLVM IR (-O2):
define void @close() {
ret void
}
int fun666() { return 666; }


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

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

LLVM IR (-O0):
define i32 @fun666() {
ret i32 666
}

LLVM IR (-O2):
define i32 @fun666() {
ret i32 666
}
/* Variables and functions */
int /*<<< orphan*/ log_part_end(char);
void log_struct_end() { log_part_end('}'); }


x86 assembly (clang, -O0):
<log_struct_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7d,%edi
call   1030 <log_part_end@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_struct_end>:
mov    $0x7d,%edi
jmp    1030 <log_part_end@plt>

LLVM IR (-O0):
define void @log_struct_end() {
%1 = call i32 @log_part_end(i8 signext 125)
ret void
}

LLVM IR (-O2):
define void @log_struct_end() {
%1 = tail call i32 @log_part_end(i8 signext 125)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXT_SYM_RENDER(void *, float, float, void *);
void gtxt_ext_sym_render(void *ext_sym, float x, float y, void *ud) {
  EXT_SYM_RENDER(ext_sym, x, y, ud);
}


x86 assembly (clang, -O0):
<gtxt_ext_sym_render>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
mov    -0x18(%rbp),%rsi
call   1030 <EXT_SYM_RENDER@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gtxt_ext_sym_render>:
jmp    1030 <EXT_SYM_RENDER@plt>

LLVM IR (-O0):
define void @gtxt_ext_sym_render(i8* %0, float %1, float %2, i8* %3) {
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
%8 = alloca i8*
store i8* %0, i8** %5
store float %1, float* %6
store float %2, float* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load i8*, i8** %8
%13 = call i32 @EXT_SYM_RENDER(i8* %9, float %10, float %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @gtxt_ext_sym_render(i8* %0, float %1, float %2, i8* %3) {
%5 = tail call i32 @EXT_SYM_RENDER(i8* %0, float %1, float %2, i8* %3)
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *sj_malloc(size_t size) {
  void *ptr;
  ptr = malloc(size);
  memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<sj_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sj_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @sj_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @sj_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ err(char const *, int, char const *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void die(const char *msg, int syserr, const char *id) {
  err(msg, syserr, id);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <err@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
call   1030 <err@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @err(i8* %7, i32 %8, i8* %9)
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die(i8* %0, i32 %1, i8* %2) {
%4 = tail call i32 @err(i8* %0, i32 %1, i8* %2)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
int isnumeric(pstr)
char *pstr;
{
  for (; ('0' <= *pstr) && (*pstr <= '9'); pstr++) {
  }
  if (*pstr != '\0')
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<isnumeric>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
jg     1131 <isnumeric+0x31>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1141 <isnumeric+0x41>
jmp    1157 <isnumeric+0x57>
jmp    1146 <isnumeric+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <isnumeric+0x8>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <isnumeric+0x73>
movl   $0x0,-0x4(%rbp)
jmp    117a <isnumeric+0x7a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnumeric>:
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%eax
add    $0x1,%rdi
cmp    $0xa,%al
jb     1100 <isnumeric>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @isnumeric(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %17, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp sle i32 48, %7
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 57
br label %14
14: ; preds = %9, %4
%15 = phi i1 [ false, %4 ], [ %13, %9 ]
br i1 %15, label %16, label %20
16: ; preds = %14
br label %17
17: ; preds = %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
br label %4
20: ; preds = %14
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %20
store i32 0, i32* %2
br label %27
26: ; preds = %20
store i32 1, i32* %2
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @isnumeric(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -48
%6 = icmp ult i8 %5, 10
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %2, label %8
8: ; preds = %2
%9 = icmp eq i8 %4, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetc(int /*<<< orphan*/ *);
void uninit_fgetc(void) {
  FILE *fp;
  (void)fgetc(fp);
}


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

x86 assembly (clang, -O2):
<uninit_fgetc>:
jmp    1030 <fgetc@plt>

LLVM IR (-O0):
define void @uninit_fgetc() {
%1 = alloca i32*
%2 = load i32*, i32** %1
%3 = call i32 @fgetc(i32* %2)
ret void
}

LLVM IR (-O2):
define void @uninit_fgetc() {
%1 = tail call i32 @fgetc(i32* undef)
ret void
}
/* Variables and functions */
scalar_t__ ft_isalpha(int);
scalar_t__ ft_isdigit(int);
int ft_isprint(int c) {
  if (ft_isdigit(c) || ft_isalpha(c) || (c >= 32 && c <= 126))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ft_isdigit@plt>
cmp    $0x0,%rax
jne    1163 <ft_isprint+0x43>
mov    -0x8(%rbp),%edi
call   1040 <ft_isalpha@plt>
cmp    $0x0,%rax
jne    1163 <ft_isprint+0x43>
cmpl   $0x20,-0x8(%rbp)
jl     116f <ft_isprint+0x4f>
cmpl   $0x7e,-0x8(%rbp)
jg     116f <ft_isprint+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <ft_isprint+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isprint>:
push   %rbx
mov    %edi,%ebx
call   1030 <ft_isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <ft_isprint+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1040 <ft_isalpha@plt>
test   %rax,%rax
setne  %al
add    $0xffffffe0,%ebx
cmp    $0x5f,%ebx
setb   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ft_isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @ft_isdigit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @ft_isalpha(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sge i32 %12, 32
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %3
%16 = icmp sle i32 %15, 126
br i1 %16, label %17, label %18
17: ; preds = %14, %7, %1
store i32 1, i32* %2
br label %19
18: ; preds = %14, %11
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @ft_isprint(i32 %0) {
%2 = tail call i64 @ft_isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @ft_isalpha(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = add i32 %0, -32
%8 = icmp ult i32 %7, 95
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %10, %4 ]
ret i32 %12
}