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

/* Variables and functions */
uint8_t peek8(const uint8_t *address) { return (*address); }


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

x86 assembly (clang, -O2):
<peek8>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @peek8(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
void foo497() {}


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

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

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

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

/* Variables and functions */
unsigned char *generate_command_packet(int, unsigned char, int /*<<< orphan*/,
                                       unsigned char *, size_t);
unsigned char *op_raw_write(unsigned char zone_config, unsigned char address,
                            size_t cnt, unsigned char *data) {
  return generate_command_packet(0x12, zone_config, (uint16_t)address, data,
                                 cnt);
}


x86 assembly (clang, -O0):
<op_raw_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x1(%rbp),%al
movzbl -0x2(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    $0x12,%edi
movzbl %al,%esi
call   1030 <generate_command_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_raw_write>:
mov    %rdx,%r8
mov    %esi,%edx
mov    %edi,%esi
mov    $0x12,%edi
jmp    1030 <generate_command_packet@plt>

LLVM IR (-O0):
define i8* @op_raw_write(i8 zeroext %0, i8 zeroext %1, i64 %2, i8* %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i64
%8 = alloca i8*
store i8 %0, i8* %5
store i8 %1, i8* %6
store i64 %2, i64* %7
store i8* %3, i8** %8
%9 = load i8, i8* %5
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %8
%13 = load i64, i64* %7
%14 = call i8* @generate_command_packet(i32 18, i8 zeroext %9, i32 %11, i8* %12, i64 %13)
ret i8* %14
}

LLVM IR (-O2):
define i8* @op_raw_write(i8 zeroext %0, i8 zeroext %1, i64 %2, i8* %3) {
%5 = zext i8 %1 to i32
%6 = tail call i8* @generate_command_packet(i32 18, i8 zeroext %0, i32 %5, i8* %3, i64 %2)
ret i8* %6
}
void fill(char board[]) {
  int i;
  for (i = 0; i < 9; ++i) {
    board[i] = 0;
  }
  return;
}


x86 assembly (clang, -O0):
<fill>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    1133 <fill+0x33>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <fill+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill>:
movb   $0x0,0x8(%rdi)
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @fill(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
struct kupyna512_ctx_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ kupyna512_init(struct kupyna512_ctx_t *);
void kupyna384_init(struct kupyna512_ctx_t *ctx) { kupyna512_init(ctx); }


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

x86 assembly (clang, -O2):
<kupyna384_init>:
jmp    1030 <kupyna512_init@plt>

LLVM IR (-O0):
%struct.kupyna512_ctx_t = type { i32 }
define void @kupyna384_init(%struct.kupyna512_ctx_t* %0) {
%2 = alloca %struct.kupyna512_ctx_t*
store %struct.kupyna512_ctx_t* %0, %struct.kupyna512_ctx_t** %2
%3 = load %struct.kupyna512_ctx_t*, %struct.kupyna512_ctx_t** %2
%4 = call i32 @kupyna512_init(%struct.kupyna512_ctx_t* %3)
ret void
}

LLVM IR (-O2):
%struct.kupyna512_ctx_t = type { i32 }
define void @kupyna384_init(%struct.kupyna512_ctx_t* %0) {
%2 = tail call i32 @kupyna512_init(%struct.kupyna512_ctx_t* %0)
ret void
}
/* Type definitions */
struct chunk {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_object(int, short *);
void free_chunk(struct chunk *chk) { free_object(18, (short *)chk); }


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

x86 assembly (clang, -O2):
<free_chunk>:
mov    %rdi,%rsi
mov    $0x12,%edi
jmp    1030 <free_object@plt>

LLVM IR (-O0):
%struct.chunk = type { i32 }
define void @free_chunk(%struct.chunk* %0) {
%2 = alloca %struct.chunk*
store %struct.chunk* %0, %struct.chunk** %2
%3 = load %struct.chunk*, %struct.chunk** %2
%4 = bitcast %struct.chunk* %3 to i16*
%5 = call i32 @free_object(i32 18, i16* %4)
ret void
}

LLVM IR (-O2):
%struct.chunk = type { i32 }
define void @free_chunk(%struct.chunk* %0) {
%2 = bitcast %struct.chunk* %0 to i16*
%3 = tail call i32 @free_object(i32 18, i16* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
void zcallop(void) { ot("call\t"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"call\09\00"
define void @zcallop() {
%1 = call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"call\09\00"
define void @zcallop() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ out_of_memory_error();
void *_rb_safe_malloc(size_t x) {
  void *r = malloc(x);
  if (NULL == r)
    out_of_memory_error();
  return r;
}


x86 assembly (clang, -O0):
<_rb_safe_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)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    114c <_rb_safe_malloc+0x2c>
mov    $0x0,%al
call   1030 <out_of_memory_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rb_safe_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <_rb_safe_malloc+0x15>
xor    %eax,%eax
call   1030 <out_of_memory_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @_rb_safe_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 = icmp eq i8* null, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @out_of_memory_error()
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @_rb_safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @out_of_memory_error()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fortune_cookie(char msg[]) {
  printf("Message reads: %s\n", msg);
  printf("It occupies %i bytes.\n", sizeof(msg));
  printf("It is stored at %p.\n", msg);
}


x86 assembly (clang, -O0):
<fortune_cookie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fortune_cookie>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Message reads: %s\0A\00"
@.str.1 = [23 x i8] c"It occupies %i bytes.\0A\00"
@.str.2 = [21 x i8] c"It is stored at %p.\0A\00"
define void @fortune_cookie(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 8)
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Message reads: %s\0A\00"
@.str.1 = [23 x i8] c"It occupies %i bytes.\0A\00"
@.str.2 = [21 x i8] c"It is stored at %p.\0A\00"
define void @fortune_cookie(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 8)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct bladerf {
  int dummy;
};

/* Variables and functions */
int nios_8x8_read(struct bladerf *, int, int /*<<< orphan*/,
                  int /*<<< orphan*/ *);
int nios_si5338_read(struct bladerf *dev, uint8_t addr, uint8_t *data) {
  int status = nios_8x8_read(dev, 0x01, addr, data);
  if (status == 0) {
    do {
      do {
      } while (0);
    } while (0);
  }
  return status;
}


x86 assembly (clang, -O0):
<nios_si5338_read>:
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),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <nios_8x8_read@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    115e <nios_si5338_read+0x4e>
jmp    114a <nios_si5338_read+0x3a>
jmp    114f <nios_si5338_read+0x3f>
jmp    1154 <nios_si5338_read+0x44>
jmp    1159 <nios_si5338_read+0x49>
jmp    115e <nios_si5338_read+0x4e>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nios_si5338_read>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    $0x1,%esi
jmp    1030 <nios_8x8_read@plt>

LLVM IR (-O0):
%struct.bladerf = type { i32 }
define i32 @nios_si5338_read(%struct.bladerf* %0, i32 %1, i32* %2) {
%4 = alloca %struct.bladerf*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store %struct.bladerf* %0, %struct.bladerf** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load %struct.bladerf*, %struct.bladerf** %4
%9 = load i32, i32* %5
%10 = load i32*, i32** %6
%11 = call i32 @nios_8x8_read(%struct.bladerf* %8, i32 1, i32 %9, i32* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %3
br label %15
15: ; preds = %14
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17
br label %19
19: ; preds = %18, %3
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_si5338_read(%struct.bladerf* %0, i32 %1, i32* %2) {
%4 = tail call i32 @nios_8x8_read(%struct.bladerf* %0, i32 1, i32 %1, i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_CRL;
typedef int /*<<< orphan*/ PKCS12_SAFEBAG;

/* Variables and functions */
int /*<<< orphan*/ NID_crlBag;
int /*<<< orphan*/ NID_x509Crl;
int /*<<< orphan*/ *PKCS12_item_pack_safebag(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/ *,
                                             int /*<<< orphan*/,
                                             int /*<<< orphan*/);
int /*<<< orphan*/ X509_CRL_it;
PKCS12_SAFEBAG *PKCS12_x509crl2certbag(X509_CRL *crl) {
  return PKCS12_item_pack_safebag(crl, &X509_CRL_it, NID_x509Crl, NID_crlBag);
}


x86 assembly (clang, -O0):
<PKCS12_x509crl2certbag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
mov    0x2e9f(%rip),%rsi
call   1030 <PKCS12_item_pack_safebag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS12_x509crl2certbag>:
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    0x2ec0(%rip),%rax
mov    (%rax),%ecx
mov    0x2eaf(%rip),%rsi
jmp    1030 <PKCS12_item_pack_safebag@plt>

LLVM IR (-O0):
@X509_CRL_it = global i32 0
@NID_x509Crl = global i32 0
@NID_crlBag = global i32 0
define i32* @PKCS12_x509crl2certbag(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_x509Crl
%5 = load i32, i32* @NID_crlBag
%6 = call i32* @PKCS12_item_pack_safebag(i32* %3, i32* @X509_CRL_it, i32 %4, i32 %5)
ret i32* %6
}

LLVM IR (-O2):
@X509_CRL_it = global i32 0
@NID_x509Crl = global i32 0
@NID_crlBag = global i32 0
define i32* @PKCS12_x509crl2certbag(i32* %0) {
%2 = load i32, i32* @NID_x509Crl
%3 = load i32, i32* @NID_crlBag
%4 = tail call i32* @PKCS12_item_pack_safebag(i32* %0, i32* @X509_CRL_it, i32 %2, i32 %3)
ret i32* %4
}
/* Variables and functions */
double median(double *data, size_t elements) {
  if (elements % 2 == 1) {
    return data[((elements + 1) / 2) - 1];
  }
  return (data[((elements + 1) / 2) - 1] + data[((elements + 1) / 2)]) / 2;
}


x86 assembly (clang, -O0):
<median>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
and    $0x1,%rax
cmp    $0x1,%rax
jne    1141 <median+0x41>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
shr    $0x1,%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1180 <median+0x80>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
shr    $0x1,%rcx
sub    $0x1,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
add    $0x1,%rcx
shr    $0x1,%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xe89(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<median>:
mov    %rsi,%rax
add    $0x1,%rax
shr    %rax
movsd  -0x8(%rdi,%rax,8),%xmm0
test   $0x1,%sil
jne    1123 <median+0x23>
addsd  (%rdi,%rax,8),%xmm0
mulsd  0xedd(%rip),%xmm0
ret

LLVM IR (-O0):
define double @median(double* %0, i64 %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca i64
store double* %0, double** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = urem i64 %6, 2
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %17
9: ; preds = %2
%10 = load double*, double** %4
%11 = load i64, i64* %5
%12 = add i64 %11, 1
%13 = udiv i64 %12, 2
%14 = sub i64 %13, 1
%15 = getelementptr inbounds double, double* %10, i64 %14
%16 = load double, double* %15
store double %16, double* %3
br label %33
17: ; preds = %2
%18 = load double*, double** %4
%19 = load i64, i64* %5
%20 = add i64 %19, 1
%21 = udiv i64 %20, 2
%22 = sub i64 %21, 1
%23 = getelementptr inbounds double, double* %18, i64 %22
%24 = load double, double* %23
%25 = load double*, double** %4
%26 = load i64, i64* %5
%27 = add i64 %26, 1
%28 = udiv i64 %27, 2
%29 = getelementptr inbounds double, double* %25, i64 %28
%30 = load double, double* %29
%31 = fadd double %24, %30
%32 = fdiv double %31, 2.000000e+00
store double %32, double* %3
br label %33
33: ; preds = %17, %9
%34 = load double, double* %3
ret double %34
}

LLVM IR (-O2):
define double @median(double* nocapture %0, i64 %1) {
%3 = and i64 %1, 1
%4 = icmp eq i64 %3, 0
%5 = add i64 %1, 1
%6 = lshr i64 %5, 1
%7 = add nsw i64 %6, -1
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
br i1 %4, label %10, label %15
10: ; preds = %2
%11 = getelementptr inbounds double, double* %0, i64 %6
%12 = load double, double* %11
%13 = fadd double %9, %12
%14 = fmul double %13, 5.000000e-01
br label %15
15: ; preds = %2, %10
%16 = phi double [ %14, %10 ], [ %9, %2 ]
ret double %16
}
void gdk_display_manager_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_manager_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
int *func_19(signed char p_20, int *p_21) {
  step_hash(12);
  return p_21;
}


x86 assembly (clang, -O0):
<func_19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xc,%edi
call   1030 <step_hash@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_19>:
push   %rbx
mov    %rsi,%rbx
mov    $0xc,%edi
call   1030 <step_hash@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @func_19(i8 signext %0, i32* %1) {
%3 = alloca i8
%4 = alloca i32*
store i8 %0, i8* %3
store i32* %1, i32** %4
%5 = call i32 @step_hash(i32 12)
%6 = load i32*, i32** %4
ret i32* %6
}

LLVM IR (-O2):
define i32* @func_19(i8 signext %0, i32* readnone returned %1) {
%3 = tail call i32 @step_hash(i32 12)
ret i32* %1
}
void UARTSYNDisable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) &= ~0x00000800;
}


x86 assembly (clang, -O0):
<UARTSYNDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rcx
and    $0xfffffffffffff7ff,%rcx
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSYNDisable>:
andq   $0xfffffffffffff7ff,0x10(%rdi)
ff
ret

LLVM IR (-O0):
define void @UARTSYNDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 16
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, -2049
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @UARTSYNDisable(i64 %0) {
%2 = add i64 %0, 16
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -2049
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exoPal_getCik(char *);
void exosite_getCIK(char *cik) {
  exoPal_getCik((char *)cik);
  return;
}


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

x86 assembly (clang, -O2):
<exosite_getCIK>:
jmp    1030 <exoPal_getCik@plt>

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

LLVM IR (-O2):
define void @exosite_getCIK(i8* %0) {
%2 = tail call i32 @exoPal_getCik(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
time_t time___Tm_to_timet___impl(struct tm *recv) { return mktime(recv); }


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

x86 assembly (clang, -O2):
<time___Tm_to_timet___impl>:
jmp    1030 <mktime@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @time___Tm_to_timet___impl(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i32 @mktime(%struct.tm* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @time___Tm_to_timet___impl(%struct.tm* nocapture %0) {
%2 = tail call i32 @mktime(%struct.tm* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *mensaje = "Hola a todos";
  printf("%s\n", mensaje);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"Hola a todos\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void tegra_bpmp_init_early(void) {}


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

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

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

LLVM IR (-O2):
define void @tegra_bpmp_init_early() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_manager();
void dwc_alloc_notification_manager(void) { create_manager(); }


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

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

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

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

/* Variables and functions */
int sys_get_be16(int /*<<< orphan*/ const *);
uint32_t sys_get_be32(const uint8_t src[4]) {
  return ((uint32_t)sys_get_be16(&src[0]) << 16) | sys_get_be16(&src[2]);
}


x86 assembly (clang, -O0):
<sys_get_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sys_get_be16@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <sys_get_be16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_get_be32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <sys_get_be16@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
add    $0x8,%rbx
mov    %rbx,%rdi
call   1030 <sys_get_be16@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sys_get_be32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = call i32 @sys_get_be16(i32* %4)
%6 = shl i32 %5, 16
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 2
%9 = call i32 @sys_get_be16(i32* %8)
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_get_be32(i32* %0) {
%2 = tail call i32 @sys_get_be16(i32* %0)
%3 = shl i32 %2, 16
%4 = getelementptr inbounds i32, i32* %0, i64 2
%5 = tail call i32 @sys_get_be16(i32* %4)
%6 = or i32 %3, %5
ret i32 %6
}
/* Variables and functions */
int do_connect();
int /*<<< orphan*/ exec_program(int);
int /*<<< orphan*/ parse_options(int, char **);
int main(int argc, char *argv[]) {
  int fd;
  parse_options(argc, argv);
  fd = do_connect();
  exec_program(fd);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_options@plt>
mov    $0x0,%al
call   1030 <do_connect@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <exec_program@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <parse_options@plt>
xor    %eax,%eax
call   1030 <do_connect@plt>
mov    %eax,%edi
call   1050 <exec_program@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @parse_options(i32 %7, i8** %8)
%10 = call i32 (...) @do_connect()
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = call i32 @exec_program(i32 %11)
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_options(i32 %0, i8** %1)
%4 = tail call i32 (...) @do_connect()
%5 = tail call i32 @exec_program(i32 %4)
ret i32 1
}
extern void extern_extern_undeclared(void) {}


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

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

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

LLVM IR (-O2):
define void @extern_extern_undeclared() {
ret void
}
void aeGetSetSize(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               34, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<aeGetSetSize>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x22,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeGetSetSize>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x22,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aeGetSetSize = [13 x i8] c"aeGetSetSize\00"
define void @aeGetSetSize() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.aeGetSetSize, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.aeGetSetSize = [13 x i8] c"aeGetSetSize\00"
define void @aeGetSetSize() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.aeGetSetSize, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char, char);
void end_of_sector_marker(char *mastboot, FILE *output) {
  fprintf(output, "\nTwo byte signature word:  %02X%02X (End of MBR)\n",
          mastboot[510] & 0xff, mastboot[511] & 0xff);
  return;
}


x86 assembly (clang, -O0):
<end_of_sector_marker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rax
movsbl 0x1fe(%rax),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
movsbl 0x1ff(%rax),%eax
and    $0xff,%eax
lea    0xeb3(%rip),%rsi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_of_sector_marker>:
mov    %rsi,%rax
movsbl 0x1fe(%rdi),%edx
movsbl 0x1ff(%rdi),%ecx
lea    0xed8(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"\0ATwo byte signature word: %02X%02X (End of MBR)\0A\00"
define void @end_of_sector_marker(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 510
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, 255
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 511
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %11, i8 signext %17)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"\0ATwo byte signature word: %02X%02X (End of MBR)\0A\00"
define void @end_of_sector_marker(i8* nocapture %0, i32* nocapture %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 510
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 511
%6 = load i8, i8* %5
%7 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8 signext %4, i8 signext %6)
ret void
}
void foo11(p, p2) int p;
int p2;
{}


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

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

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

LLVM IR (-O2):
define void @foo11(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char txt[100];
  scanf("%[^\n]s", txt);
  create_letter_distribution_diagram(txt);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x70(%rbp),%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @create_letter_distribution_diagram(i8* %2)
ret i32 0
}
void test_hiding() {
  struct hiding_1 *hiding_1();
  extern struct hiding_2 *hiding_2;
  struct hiding_1 *p = hiding_1();
  struct hiding_2 *q = hiding_2;
}


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

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

LLVM IR (-O0):
%struct.hiding_2 = type opaque
%struct.hiding_1 = type opaque
@hiding_2 = external global %struct.hiding_2*
define void @test_hiding() {
%1 = alloca %struct.hiding_1*
%2 = alloca %struct.hiding_2*
%3 = call %struct.hiding_1* (...) @hiding_1()
store %struct.hiding_1* %3, %struct.hiding_1** %1
%4 = load %struct.hiding_2*, %struct.hiding_2** @hiding_2
store %struct.hiding_2* %4, %struct.hiding_2** %2
ret void
}

LLVM IR (-O2):
%struct.hiding_1 = type opaque
%struct.hiding_2 = type opaque
define void @test_hiding() {
%1 = tail call %struct.hiding_1* (...) @hiding_1()
ret void
}
int gfun(y, per)
double y;
int per;
{
  if (y > .666666)
    return (0);
  return ((int)(3. * 255 * sqrt((.6666667 - y) * (y))));
}


x86 assembly (clang, -O0):
<gfun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <gfun+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1170 <gfun+0x60>
movsd  0xec5(%rip),%xmm0
subsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xea3(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfun>:
push   %rax
xor    %eax,%eax
ucomisd 0xee5(%rip),%xmm0
ja     1152 <gfun+0x42>
movapd %xmm0,%xmm1
movsd  0xedf(%rip),%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1141 <gfun+0x31>
sqrtsd %xmm0,%xmm0
jmp    1146 <gfun+0x36>
call   1030 <sqrt@plt>
mulsd  0xec2(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gfun(double %0, i32 %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%6 = load double, double* %4
%7 = fcmp ogt double %6, 0x3FE55553EF6B5D46
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %17
9: ; preds = %2
%10 = load double, double* %4
%11 = fsub double 0x3FE55555673AA1BC, %10
%12 = load double, double* %4
%13 = fmul double %11, %12
%14 = call double @sqrt(double %13)
%15 = fmul double 7.650000e+02, %14
%16 = fptosi double %15 to i32
store i32 %16, i32* %3
br label %17
17: ; preds = %9, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @gfun(double %0, i32 %1) {
%3 = fcmp ogt double %0, 0x3FE55553EF6B5D46
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = fsub double 0x3FE55555673AA1BC, %0
%6 = fmul double %5, %0
%7 = tail call double @sqrt(double %6)
%8 = fmul double %7, 7.650000e+02
%9 = fptosi double %8 to i32
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
adrreg0reg1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((p0[10000000]) <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzbl 0x989680(%rax),%eax
movzbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jg     1141 <adrreg0reg1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <adrreg0reg1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0reg1>:
movzbl 0x989680(%r8),%ecx
movzbl %sil,%edx
xor    %eax,%eax
cmp    %ecx,%edx
setae  %al
ret

LLVM IR (-O0):
define i32 @adrreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = getelementptr inbounds i8, i8* %16, i64 10000000
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = load i8, i8* %9
%21 = zext i8 %20 to i32
%22 = icmp sle i32 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %6
store i32 1, i32* %7
br label %25
24: ; preds = %6
store i32 0, i32* %7
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %7
ret i32 %26
}

LLVM IR (-O2):
define i32 @adrreg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture %4, i8* nocapture readnone %5) {
%7 = getelementptr inbounds i8, i8* %4, i64 10000000
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = and i32 %1, 255
%11 = icmp uge i32 %10, %9
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Enter the number to check odd or even: ");
  scanf("%d", &a);
  if (a % 2 == 0) {
    printf("\n It is even number.");
  } else {
    printf("\n It is odd number.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <main+0x50>
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
jmp    117c <main+0x5c>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
testb  $0x1,0x4(%rsp)
lea    0xee1(%rip),%rax
lea    0xeef(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Enter the number to check odd or even: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"\0A It is even number.\00"
@.str.3 = [20 x i8] c"\0A It is odd number.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = srem i32 %5, 2
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [40 x i8] c"Enter the number to check odd or even: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"\0A It is even number.\00"
@.str.3 = [20 x i8] c"\0A It is odd number.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0)
%9 = call i32 @printf(i8* dereferenceable(1) %8)
ret i32 0
}
long long int llabs(long long int j) { return (j < 0) ? (-j) : j; }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @llabs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ D();
void B() { D(); }


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

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

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

LLVM IR (-O2):
define void @B() {
%1 = tail call i32 (...) @D()
ret void
}
void bumpref_restore(void) {}


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

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

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

LLVM IR (-O2):
define void @bumpref_restore() {
ret void
}
int abs(int j) { return (j > 0) ? (j) : (-j); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111c <abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int usleep_ibex(unsigned long);
int usleep(unsigned long usec) { return usleep_ibex(usec); }


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

x86 assembly (clang, -O2):
<usleep>:
jmp    1030 <usleep_ibex@plt>

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

LLVM IR (-O2):
define i32 @usleep(i64 %0) {
%2 = tail call i32 @usleep_ibex(i64 %0)
ret i32 %2
}
int main() {
  int a = 3;
  int b = 4;
  int c = a + b;
  if (c > 0) {
    c = c + 4;
  } else
    c = c + 4;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    113a <main+0x3a>
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
jmp    1143 <main+0x43>
mov    -0x10(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

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

/* Variables and functions */
struct _lock *lock_initial();
struct _lock *directory_make_lock(struct _directory *_dir, char *name) {
  struct _lock *lk = lock_initial();
  return lk;
}


x86 assembly (clang, -O0):
<directory_make_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <lock_initial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._lock = type { i32 }
%struct._directory = type { i32 }
define %struct._lock* @directory_make_lock(%struct._directory* %0, i8* %1) {
%3 = alloca %struct._directory*
%4 = alloca i8*
%5 = alloca %struct._lock*
store %struct._directory* %0, %struct._directory** %3
store i8* %1, i8** %4
%6 = call %struct._lock* (...) @lock_initial()
store %struct._lock* %6, %struct._lock** %5
%7 = load %struct._lock*, %struct._lock** %5
ret %struct._lock* %7
}

LLVM IR (-O2):
%struct._lock = type { i32 }
%struct._directory = type { i32 }
define %struct._lock* @directory_make_lock(%struct._directory* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call %struct._lock* (...) @lock_initial()
ret %struct._lock* %3
}
/* Variables and functions */
int html_tablecontents(char *, int, int, int, int, char *);
int html_tableheader(int align, int colspan, int rowspan, int nowrap,
                     char *text) {
  return html_tablecontents("TH", align, colspan, rowspan, nowrap, text);
}


x86 assembly (clang, -O0):
<html_tableheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0x18(%rbp),%r9
lea    0xec0(%rip),%rdi
call   1030 <html_tablecontents@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<html_tableheader>:
mov    %r8,%r9
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xedd(%rip),%rdi
jmp    1030 <html_tablecontents@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"TH\00"
define i32 @html_tableheader(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i8*, i8** %10
%16 = call i32 @html_tablecontents(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13, i32 %14, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [3 x i8] c"TH\00"
define i32 @html_tableheader(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4) {
%6 = tail call i32 @html_tablecontents(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2, i32 %3, i8* %4)
ret i32 %6
}