xunge/DecIR huggingface dataset:
char const *pubnub_uname(void) {
  return "FreeRTOS"
         "%2F"
         "3.1.0";
}


x86 assembly (clang, -O0):
<pubnub_uname>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pubnub_uname>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"FreeRTOS%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [17 x i8] c"FreeRTOS%2F3.1.0\00"
define i8* @pubnub_uname() {
ret i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__6__IO__set();
void CC2420ControlP__RSTN__set(void) { HplAtm128GeneralIOPinP__6__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__RSTN__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__6__IO__set()
ret void
}
/* Variables and functions */
unsigned char *aes192cbc_encrypt(unsigned char *, size_t *,
                                 unsigned char const *, size_t,
                                 unsigned char const *, unsigned char const *);
unsigned char *crypt_encrypt_aes192cbc(unsigned char *out, size_t *out_len,
                                       const unsigned char *in, size_t in_len,
                                       const unsigned char *nonce,
                                       const unsigned char *key) {
  return aes192cbc_encrypt(out, out_len, in, in_len, nonce, key);
}


x86 assembly (clang, -O0):
<crypt_encrypt_aes192cbc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <aes192cbc_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypt_encrypt_aes192cbc>:
jmp    1030 <aes192cbc_encrypt@plt>

LLVM IR (-O0):
define i8* @crypt_encrypt_aes192cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i64*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
store i8* %0, i8** %7
store i64* %1, i64** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i8* %5, i8** %12
%13 = load i8*, i8** %7
%14 = load i64*, i64** %8
%15 = load i8*, i8** %9
%16 = load i64, i64* %10
%17 = load i8*, i8** %11
%18 = load i8*, i8** %12
%19 = call i8* @aes192cbc_encrypt(i8* %13, i64* %14, i8* %15, i64 %16, i8* %17, i8* %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @crypt_encrypt_aes192cbc(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5) {
%7 = tail call i8* @aes192cbc_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i8* %5)
ret i8* %7
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int mstrlen(char const *);
char *mstrdup(const char *str) {
  size_t siz;
  char *copy;
  siz = mstrlen(str) + 1;
  if ((copy = malloc(siz)) == NULL)
    return (NULL);
  (void)memcpy(copy, str, siz);
  return (copy);
}


x86 assembly (clang, -O0):
<mstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <mstrlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1172 <mstrdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    118b <mstrdup+0x5b>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1050 <mstrlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <mstrdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @mstrlen(i8* %6)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = call i8* @malloc(i64 %10)
store i8* %11, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %1
store i8* null, i8** %2
br label %20
14: ; preds = %1
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
store i8* %19, i8** %2
br label %20
20: ; preds = %14, %13
%21 = load i8*, i8** %2
ret i8* %21
}

LLVM IR (-O2):
define i8* @mstrdup(i8* %0) {
%2 = tail call i32 @mstrlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ pic_send_EOI_normal(int);
void isr_irq_6() { pic_send_EOI_normal(6); }


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

x86 assembly (clang, -O2):
<isr_irq_6>:
mov    $0x6,%edi
jmp    1030 <pic_send_EOI_normal@plt>

LLVM IR (-O0):
define void @isr_irq_6() {
%1 = call i32 @pic_send_EOI_normal(i32 6)
ret void
}

LLVM IR (-O2):
define void @isr_irq_6() {
%1 = tail call i32 @pic_send_EOI_normal(i32 6)
ret void
}
void RTRandAdvU64(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandAdvU64() {
ret void
}
int test_imm_01int8_mem(signed char *val) {
  return ((*val) & (0x01 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_01int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) { printf("Hello World!"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World!\00"
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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_slist_delete_all_elements();
int /*<<< orphan*/ test_slist_get_set_user_data();
int /*<<< orphan*/ test_slist_new_delete_get();
void test_lfds611_slist(void) {
  printf("\n"
         "SList Tests\n"
         "===========\n");
  test_slist_new_delete_get();
  test_slist_get_set_user_data();
  test_slist_delete_all_elements();
  return;
}


x86 assembly (clang, -O0):
<test_lfds611_slist>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <test_slist_new_delete_get@plt>
mov    $0x0,%al
call   1050 <test_slist_get_set_user_data@plt>
mov    $0x0,%al
call   1030 <test_slist_delete_all_elements@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_lfds611_slist>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <test_slist_new_delete_get@plt>
xor    %eax,%eax
call   1050 <test_slist_get_set_user_data@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_slist_delete_all_elements@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"\0ASList Tests\0A===========\0A\00"
define void @test_lfds611_slist() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @test_slist_new_delete_get()
%3 = call i32 (...) @test_slist_get_set_user_data()
%4 = call i32 (...) @test_slist_delete_all_elements()
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"\0ASList Tests\0A===========\00"
define void @test_lfds611_slist() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @test_slist_new_delete_get()
%3 = tail call i32 (...) @test_slist_get_set_user_data()
%4 = tail call i32 (...) @test_slist_delete_all_elements()
ret void
}
/* Variables and functions */
int getHeight(unsigned char *);
int getWidth(unsigned char *);
int getMaxPayloadSize(unsigned char *ppm) {
  char *ptr = ppm;
  int w = getWidth(ppm);
  int h = getHeight(ppm);
  return ((w * h * 3) / 8) - 4;
}


x86 assembly (clang, -O0):
<getMaxPayloadSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getWidth@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getHeight@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   $0x3,%eax,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
sub    $0x4,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMaxPayloadSize>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <getWidth@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <getHeight@plt>
imul   %ebp,%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rax,2),%eax
add    $0x7,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x3,%eax
add    $0xfffffffc,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getMaxPayloadSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
store i8* %6, i8** %3
%7 = load i8*, i8** %2
%8 = call i32 @getWidth(i8* %7)
store i32 %8, i32* %4
%9 = load i8*, i8** %2
%10 = call i32 @getHeight(i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = mul nsw i32 %11, %12
%14 = mul nsw i32 %13, 3
%15 = sdiv i32 %14, 8
%16 = sub nsw i32 %15, 4
ret i32 %16
}

LLVM IR (-O2):
define i32 @getMaxPayloadSize(i8* %0) {
%2 = tail call i32 @getWidth(i8* %0)
%3 = tail call i32 @getHeight(i8* %0)
%4 = mul i32 %2, 3
%5 = mul i32 %4, %3
%6 = sdiv i32 %5, 8
%7 = add nsw i32 %6, -4
ret i32 %7
}
/* Variables and functions */
unsigned int crc32boithonl(char *, int);
int strlen(char *);
unsigned int crc32boitho(char *c) {
  int len = strlen(c);
  return crc32boithonl(c, len);
}


x86 assembly (clang, -O0):
<crc32boitho>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <crc32boithonl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc32boitho>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <crc32boithonl@plt>

LLVM IR (-O0):
define i32 @crc32boitho(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i32 @crc32boithonl(i8* %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @crc32boitho(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @crc32boithonl(i8* %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void c() {
  printf("c"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"c\00"
define void @c() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int M_PI_2;
int pow(int, int);
int sin(int);
double elasticEaseOutd(double p) {
  return sin(-13 * M_PI_2 * (p + 1)) * pow(2, -10 * p) + 1;
}


x86 assembly (clang, -O0):
<elasticEaseOutd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    0x2eb4(%rip),%rax
imul   $0xfffffff3,(%rax),%eax
cvtsi2sd %eax,%xmm0
movsd  0xec2(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,-0xc(%rbp)
movsd  0xe9d(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elasticEaseOutd>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
imul   $0xfffffff3,(%rax),%eax
movsd  %xmm0,0x8(%rsp)
cvtsi2sd %eax,%xmm2
movsd  0xebf(%rip),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mulsd  0xea6(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    $0x2,%edi
call   1040 <pow@plt>
imul   %ebx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@M_PI_2 = global i32 0
define double @elasticEaseOutd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_PI_2
%4 = mul nsw i32 -13, %3
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = fadd double %6, 1.000000e+00
%8 = fmul double %5, %7
%9 = fptosi double %8 to i32
%10 = call i32 @sin(i32 %9)
%11 = load double, double* %2
%12 = fmul double -1.000000e+01, %11
%13 = fptosi double %12 to i32
%14 = call i32 @pow(i32 2, i32 %13)
%15 = mul nsw i32 %10, %14
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
ret double %17
}

LLVM IR (-O2):
@M_PI_2 = global i32 0
define double @elasticEaseOutd(double %0) {
%2 = load i32, i32* @M_PI_2
%3 = mul nsw i32 %2, -13
%4 = sitofp i32 %3 to double
%5 = fadd double %0, 1.000000e+00
%6 = fmul double %5, %4
%7 = fptosi double %6 to i32
%8 = tail call i32 @sin(i32 %7)
%9 = fmul double %0, -1.000000e+01
%10 = fptosi double %9 to i32
%11 = tail call i32 @pow(i32 2, i32 %10)
%12 = mul nsw i32 %11, %8
%13 = add nsw i32 %12, 1
%14 = sitofp i32 %13 to double
ret double %14
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void exN_init(void) {
  if (0)
    fprintf(stderr,
            "[DEBUG file:%s line:%d]: "
            "exN_init()"
            "\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/drbeco/githubin/refs/heads/master/"
            "newrepo-template/general/c/exN.c",
            279);
  else {
    ;
  };
  return;
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
define void @exN_init() {
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @exN_init() {
ret void
}
void imp(void) {}


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

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

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

LLVM IR (-O2):
define void @imp() {
ret void
}
/* Variables and functions */
int M_PI;
double rad(double number) { return ((M_PI / 180) * number); }


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
mov    (%rax),%eax
mov    $0xb4,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad>:
mov    0x2ee1(%rip),%rax
movslq (%rax),%rax
imul   $0xffffffffb60b60b7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x7,%ecx
add    %eax,%ecx
cvtsi2sd %ecx,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load i32, i32* @M_PI
%4 = sdiv i32 %3, 180
%5 = sitofp i32 %4 to double
%6 = load double, double* %2
%7 = fmul double %5, %6
ret double %7
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @rad(double %0) {
%2 = load i32, i32* @M_PI
%3 = sdiv i32 %2, 180
%4 = sitofp i32 %3 to double
%5 = fmul double %4, %0
ret double %5
}
int test_imm_ACuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xAC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_ACuint64_midword_reg>:
test   $0xac0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_ACuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 11272192
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
pa(struct A *p) {}


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

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

LLVM IR (-O0):
%struct.A = type opaque
define i32 @pa(%struct.A* %0) {
%2 = alloca i32
%3 = alloca %struct.A*
store %struct.A* %0, %struct.A** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.A = type opaque
define i32 @pa(%struct.A* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ InitPin(int);
int /*<<< orphan*/ SetPinDirt(int, char *);
int /*<<< orphan*/ SetPinValue(int, int);
int LEDOn(int GPIO_num) {
  InitPin(GPIO_num);
  SetPinDirt(GPIO_num, "out");
  SetPinValue(GPIO_num, 1);
  return 1;
}


x86 assembly (clang, -O0):
<LEDOn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <InitPin@plt>
mov    -0x4(%rbp),%edi
lea    0xeb3(%rip),%rsi
call   1050 <SetPinDirt@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <SetPinValue@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEDOn>:
push   %rbx
mov    %edi,%ebx
call   1030 <InitPin@plt>
lea    0xec1(%rip),%rsi
mov    %ebx,%edi
call   1050 <SetPinDirt@plt>
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <SetPinValue@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"out\00"
define i32 @LEDOn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @InitPin(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @SetPinDirt(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = call i32 @SetPinValue(i32 %7, i32 1)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"out\00"
define i32 @LEDOn(i32 %0) {
%2 = tail call i32 @InitPin(i32 %0)
%3 = tail call i32 @SetPinDirt(i32 %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @SetPinValue(i32 %0, i32 1)
ret i32 1
}
void Swap(double *front[], int i, int j) {
  double *temp;
  temp = front[i];
  front[i] = front[j];
  front[j] = temp;
}


x86 assembly (clang, -O0):
<Swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @Swap(double** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds double*, double** %0, i64 %4
%6 = load double*, double** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double*, double** %0, i64 %7
%9 = load double*, double** %8
store double* %9, double** %5
store double* %6, double** %8
ret void
}
void callee(int **ptr1, int **ptr2) { *ptr1 = *ptr2; }


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

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

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

LLVM IR (-O2):
define void @callee(i32** nocapture writeonly %0, i32** nocapture %1) {
%3 = load i32*, i32** %1
store i32* %3, i32** %0
ret void
}
void endprotoent() {
  anvil_syslog(0, "%s unimplemented\n", __FUNCTION__);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<endprotoent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
jmp    112b <endprotoent+0x1b>

x86 assembly (clang, -O2):
<endprotoent>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0xef3(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
call   1030 <anvil_syslog@plt>
nopl   0x0(%rax,%rax,1)
jmp    1130 <endprotoent+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endprotoent = [12 x i8] c"endprotoent\00"
define void @endprotoent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.endprotoent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endprotoent = [12 x i8] c"endprotoent\00"
define void @endprotoent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.endprotoent, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
__float128 from_uns_int_load(unsigned int *a) { return (__float128)*a; }


x86 assembly (clang, -O0):
<from_uns_int_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1120 <__floatunsitf>
add    $0x10,%rsp
pop    %rbp
ret
nopl   (%rax)

x86 assembly (clang, -O2):
<from_uns_int_load>:
push   %rax
mov    (%rdi),%edi
call   1110 <__floatunsitf>
pop    %rax
ret
nopw   0x0(%rax,%rax,1)

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

LLVM IR (-O2):
define fp128 @from_uns_int_load(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = uitofp i32 %2 to fp128
ret fp128 %3
}
void neural_layer_noise_update(const struct Layer *l) { (void)l; }


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

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

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

LLVM IR (-O2):
%struct.Layer = type opaque
define void @neural_layer_noise_update(%struct.Layer* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  char buf[10] = "";
  read(0, buf, 9);
  fprintf(stdout, "%s\n", buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <memset@plt>
lea    -0x1a(%rbp),%rsi
xor    %edi,%edi
mov    $0x9,%edx
call   1040 <read@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
lea    -0x1a(%rbp),%rdx
lea    0xe86(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x9,%edx
call   1030 <read@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 9)
%6 = load i32, i32* @stdout
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
/* Variables and functions */
scalar_t__ in_set(unsigned char, char const);
int match_set(char const **str, char const *end, unsigned char set) {
  if (*str < end && in_set(set, **str)) {
    ++*str;
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<match_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
jae    116f <match_set+0x5f>
mov    -0x19(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movzbl %cl,%edi
movsbl (%rax),%esi
call   1030 <in_set@plt>
cmp    $0x0,%rax
je     116f <match_set+0x5f>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1176 <match_set+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_set>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%rax
xor    %ebp,%ebp
cmp    %rsi,%rax
jae    1139 <match_set+0x29>
mov    %rdi,%rbx
movsbl (%rax),%esi
movzbl %dl,%edi
call   1030 <in_set@plt>
test   %rax,%rax
je     1139 <match_set+0x29>
addq   $0x1,(%rbx)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @match_set(i8** nocapture %0, i8* readnone %1, i8 zeroext %2) {
%4 = load i8*, i8** %0
%5 = icmp ult i8* %4, %1
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i8, i8* %4
%8 = tail call i64 @in_set(i8 zeroext %2, i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = load i8*, i8** %0
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8* %12, i8** %0
br label %13
13: ; preds = %3, %6, %10
%14 = phi i32 [ 1, %10 ], [ 0, %6 ], [ 0, %3 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, size_t, int, int /*<<< orphan*/ *);
size_t write_file(char *file_name, char *contents, size_t size) {
  FILE *file = fopen(file_name, "w");
  fwrite(contents, size, 1, file);
  fclose(file);
  return size;
}


x86 assembly (clang, -O0):
<write_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1050 <fwrite@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_file>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
lea    0xebe(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i64 @write_file(i8* nocapture %0, i8* nocapture %1, i64 returned %2) {
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @fwrite(i8* %1, i64 %2, i32 1, i32* %4)
%6 = tail call i32 @fclose(i32* %4)
ret i64 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read_16u(const uint8_t *src) {
  uint16_t b0 = ((uint16_t)src[0]) << 8;
  uint16_t b1 = ((uint16_t)src[1]);
  return (b0 | b1);
}


x86 assembly (clang, -O0):
<read_16u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_16u>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x8(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read_16u(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i32
store i64* %0, i64** %2
%5 = load i64*, i64** %2
%6 = getelementptr inbounds i64, i64* %5, i64 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 8
store i32 %9, i32* %3
%10 = load i64*, i64** %2
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = or i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @read_16u(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 8
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main(void) {
  volatile int x = 5;
  f((int *)&x);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 5, i32* %1
%3 = call i32 @f(i32* %1)
ret i32 0
}
void vla_typedef(int x) { typedef int VLA[x]; }


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

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

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

LLVM IR (-O2):
define void @vla_typedef(i32 %0) {
ret void
}
float sqrt_f(float x) {
  float s;
  __asm__ __volatile__("sqrtss %1, %0" : "=x"(s) : "x"(x));
  return s;
}


x86 assembly (clang, -O0):
<sqrt_f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
sqrtss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt_f>:
sqrtss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sqrt_f(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = call float asm sideeffect "sqrtss $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(float %4)
store float %5, float* %3
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @sqrt_f(float %0) {
%2 = tail call float asm sideeffect "sqrtss $1, $0", "=x,x,~{dirflag},~{fpsr},~{flags}"(float %0)
ret float %2
}
int XX_finslib_wsa_errorcode_to_fins_retval(int errorcode) {
  switch (errorcode) {
  default:
    return 0x8A00;
  }
}


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

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

LLVM IR (-O0):
define i32 @XX_finslib_wsa_errorcode_to_fins_retval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i32 35328
}

LLVM IR (-O2):
define i32 @XX_finslib_wsa_errorcode_to_fins_retval(i32 %0) {
ret i32 35328
}
int nsock_win32_init(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @nsock_win32_init() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage() {
  fprintf(stderr, "r [-b|-s] <address> [<value>]\n");
  return -1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"r [-b|-s] <address> [<value>]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"r [-b|-s] <address> [<value>]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
int va_int(__builtin_va_list l) { return __builtin_va_arg(l, int); }


x86 assembly (clang, -O0):
<va_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x28,%eax
ja     113a <va_int+0x3a>
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%edx
movslq %edx,%rax
add    0x10(%rcx),%rax
add    $0x8,%edx
mov    %edx,(%rcx)
mov    %rax,-0x20(%rbp)
jmp    1151 <va_int+0x51>
mov    -0x18(%rbp),%rcx
mov    0x8(%rcx),%rdx
mov    %rdx,%rax
add    $0x8,%rdx
mov    %rdx,0x8(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<va_int>:
mov    (%rdi),%ecx
cmp    $0x28,%rcx
ja     1117 <va_int+0x17>
mov    %rcx,%rax
add    0x10(%rdi),%rax
add    $0x8,%ecx
mov    %ecx,(%rdi)
mov    (%rax),%eax
ret
mov    0x8(%rdi),%rax
lea    0x8(%rax),%rcx
mov    %rcx,0x8(%rdi)
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @va_int(%struct.__va_list_tag* %0) {
%2 = alloca %struct.__va_list_tag*
store %struct.__va_list_tag* %0, %struct.__va_list_tag** %2
%3 = load %struct.__va_list_tag*, %struct.__va_list_tag** %2
%4 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = icmp ule i32 %5, 40
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 3
%9 = load i8*, i8** %8
%10 = getelementptr i8, i8* %9, i32 %5
%11 = bitcast i8* %10 to i32*
%12 = add i32 %5, 8
store i32 %12, i32* %4
br label %18
13: ; preds = %1
%14 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %3, i32 0, i32 2
%15 = load i8*, i8** %14
%16 = bitcast i8* %15 to i32*
%17 = getelementptr i8, i8* %15, i32 8
store i8* %17, i8** %14
br label %18
18: ; preds = %13, %7
%19 = phi i32* [ %11, %7 ], [ %16, %13 ]
%20 = load i32, i32* %19
ret i32 %20
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @va_int(%struct.__va_list_tag* nocapture %0) {
%2 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp ult i32 %3, 41
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 3
%7 = load i8*, i8** %6
%8 = zext i32 %3 to i64
%9 = getelementptr i8, i8* %7, i64 %8
%10 = add nuw nsw i32 %3, 8
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = getelementptr inbounds %struct.__va_list_tag, %struct.__va_list_tag* %0, i64 0, i32 2
%13 = load i8*, i8** %12
%14 = getelementptr i8, i8* %13, i64 8
store i8* %14, i8** %12
br label %15
15: ; preds = %11, %5
%16 = phi i8* [ %9, %5 ], [ %13, %11 ]
%17 = bitcast i8* %16 to i32*
%18 = load i32, i32* %17
ret i32 %18
}
int hundredth(int a[]) { return a[100]; }


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

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

LLVM IR (-O0):
define i32 @hundredth(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 100
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hundredth(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 100
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ putenv(char *);
void nullPointer_putenv(char *envstr) {
  (void)putenv(envstr);
  char *p = NULL;
  (void)putenv(p);
}


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

x86 assembly (clang, -O2):
<nullPointer_putenv>:
push   %rax
call   1030 <putenv@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <putenv@plt>

LLVM IR (-O0):
define void @nullPointer_putenv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @putenv(i8* %4)
store i8* null, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @putenv(i8* %6)
ret void
}

LLVM IR (-O2):
define void @nullPointer_putenv(i8* %0) {
%2 = tail call i32 @putenv(i8* %0)
%3 = tail call i32 @putenv(i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ finish_up();
void hcf(void) {
  finish_up();
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<hcf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <finish_up@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<hcf>:
push   %rax
xor    %eax,%eax
call   1030 <finish_up@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @hcf() {
%1 = call i32 (...) @finish_up()
%2 = load i32, i32* @EXIT_FAILURE
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @hcf() {
%1 = tail call i32 (...) @finish_up()
%2 = load i32, i32* @EXIT_FAILURE
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Type definitions */
struct wl_region {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
void *wl_proxy_get_user_data(struct wl_proxy *);
void *wl_region_get_user_data(struct wl_region *wl_region) {
  return wl_proxy_get_user_data((struct wl_proxy *)wl_region);
}


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

x86 assembly (clang, -O2):
<wl_region_get_user_data>:
jmp    1030 <wl_proxy_get_user_data@plt>

LLVM IR (-O0):
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_region_get_user_data(%struct.wl_region* %0) {
%2 = alloca %struct.wl_region*
store %struct.wl_region* %0, %struct.wl_region** %2
%3 = load %struct.wl_region*, %struct.wl_region** %2
%4 = bitcast %struct.wl_region* %3 to %struct.wl_proxy*
%5 = call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %4)
ret i8* %5
}

LLVM IR (-O2):
%struct.wl_region = type { i32 }
%struct.wl_proxy = type { i32 }
define i8* @wl_region_get_user_data(%struct.wl_region* %0) {
%2 = bitcast %struct.wl_region* %0 to %struct.wl_proxy*
%3 = tail call i8* @wl_proxy_get_user_data(%struct.wl_proxy* %2)
ret i8* %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void fiat_secp256k1_nonzero(uint64_t *out1, const uint64_t arg1[4]) {
  uint64_t x1;
  x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | (arg1[3]))));
  *out1 = x1;
}


x86 assembly (clang, -O0):
<fiat_secp256k1_nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
mov    0x8(%rdx),%edx
mov    -0x10(%rbp),%rsi
or     0xc(%rsi),%edx
or     %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_secp256k1_nonzero>:
mov    0x4(%rsi),%eax
or     (%rsi),%eax
or     0x8(%rsi),%eax
or     0xc(%rsi),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @fiat_secp256k1_nonzero(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 3
%9 = load i32, i32* %8
%10 = or i32 %5, %3
%11 = or i32 %10, %7
%12 = or i32 %11, %9
store i32 %12, i32* %0
ret void
}
/* Variables and functions */
int u8isgreeki(int /*<<< orphan*/);
int /*<<< orphan*/ u8tointc(char *);
int u8isgreekc(char *c) { return u8isgreeki(u8tointc(c)); }


x86 assembly (clang, -O0):
<u8isgreekc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <u8tointc@plt>
mov    %eax,%edi
call   1040 <u8isgreeki@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u8isgreekc>:
push   %rax
call   1030 <u8tointc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <u8isgreeki@plt>

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

LLVM IR (-O2):
define i32 @u8isgreekc(i8* %0) {
%2 = tail call i32 @u8tointc(i8* %0)
%3 = tail call i32 @u8isgreeki(i32 %2)
ret i32 %3
}