xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xb9() {
  Assert_real((isbdigit(185) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              930, ("isbdigit should be 0 for 0xb9"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xb9>:
push   %rax
mov    $0xb9,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3a2,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb9\00"
define void @t_isbdigit_0xb9() {
%1 = call i64 @isbdigit(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb9\00"
define void @t_isbdigit_0xb9() {
%1 = tail call i64 @isbdigit(i32 185)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 930, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int daemon(int nochdir, int noclose) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @daemon(i32 %0, i32 %1) {
ret i32 -1
}
void EVP_CIPHER_CTX_block_size(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_CIPHER_CTX_block_size() {
ret void
}
/* Variables and functions */
int f255(int *);
int f256(int *p) { return f255(p); }


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

x86 assembly (clang, -O2):
<f256>:
jmp    1030 <f255@plt>

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

LLVM IR (-O2):
define i32 @f256(i32* %0) {
%2 = tail call i32 @f255(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128InterruptPinP__6__Irq__disable();
void Atm128GpioInterruptC__0__Atm128Interrupt__disable(void) {
  HplAtm128InterruptPinP__6__Irq__disable();
}


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

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

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

LLVM IR (-O2):
define void @Atm128GpioInterruptC__0__Atm128Interrupt__disable() {
%1 = tail call i32 (...) @HplAtm128InterruptPinP__6__Irq__disable()
ret void
}
/* Variables and functions */
scalar_t__ isalpha(char);
int end_word(char ch) {
  if (isalpha(ch))
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<end_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     113d <end_word+0x2d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <end_word+0x34>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_word>:
push   %rax
call   1030 <isalpha@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @end_word(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalpha(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @end_word(i8 signext %0) {
%2 = tail call i64 @isalpha(i8 signext %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
char SwapBytesLE_(char value) { return value; }


x86 assembly (clang, -O0):
<SwapBytesLE_>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @SwapBytesLE_(i8 returned signext %0) {
ret i8 %0
}
/* Variables and functions */
int /*<<< orphan*/ fprint_columns(int /*<<< orphan*/, char const *,
                                  char const *);
int /*<<< orphan*/ stdout;
void print_columns(const char *text1, const char *text2) {
  fprint_columns(stdout, text1, text2);
}


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

x86 assembly (clang, -O2):
<print_columns>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprint_columns@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_columns(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprint_columns(i32 %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_columns(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprint_columns(i32 %3, i8* %0, i8* %1)
ret void
}
/* Variables and functions */
float fmaxf(int /*<<< orphan*/, float);
int /*<<< orphan*/ fminf(float, float);
float clamp(float v, float low, float high) {
  return fmaxf(fminf(v, high), low);
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <fminf@plt>
mov    %eax,%edi
movss  -0x8(%rbp),%xmm0
call   1040 <fmaxf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
push   %rax
movss  %xmm1,0x4(%rsp)
movaps %xmm2,%xmm1
call   1030 <fminf@plt>
mov    %eax,%edi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1040 <fmaxf@plt>

LLVM IR (-O0):
define float @clamp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %6
%9 = call i32 @fminf(float %7, float %8)
%10 = load float, float* %5
%11 = call float @fmaxf(i32 %9, float %10)
ret float %11
}

LLVM IR (-O2):
define float @clamp(float %0, float %1, float %2) {
%4 = tail call i32 @fminf(float %0, float %2)
%5 = tail call float @fmaxf(i32 %4, float %1)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void f2(int size) {
  char src[12] = "helloworld";
  char dest[12];
  memcpy(dest, src, size);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
sub    $0x18,%rsp
mov    %edi,%edx
movabs $0x726f776f6c6c6568,%rax
77 6f 72
mov    %rax,(%rsp)
movl   $0x646c,0x8(%rsp)
lea    0xc(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <memcpy@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.f2.src = [12 x i8] c"helloworld\00\00"
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
%4 = alloca [12 x i8]
store i32 %0, i32* %2
%5 = bitcast [12 x i8]* %3 to i8*
%6 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @memcpy(i8* %6, i8* %7, i32 %8)
ret void
}

LLVM IR (-O2):
@__const.f2.src = [12 x i8] c"helloworld\00\00"
define void @f2(i32 %0) {
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = call i32 @memcpy(i8* %5, i8* %4, i32 %0)
ret void
}
void GPIOADCTriggerEnable(unsigned long ulPort, unsigned char ucPins) {
  ;
  (*((volatile unsigned long *)(ulPort + 0x00000530))) |= ucPins;
}


x86 assembly (clang, -O0):
<GPIOADCTriggerEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    0x530(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x530(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOADCTriggerEnable>:
mov    %esi,%eax
or     %rax,0x530(%rdi)
ret

LLVM IR (-O0):
define void @GPIOADCTriggerEnable(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = load i64, i64* %3
%8 = add i64 %7, 1328
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = or i64 %10, %6
store volatile i64 %11, i64* %9
ret void
}

LLVM IR (-O2):
define void @GPIOADCTriggerEnable(i64 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i64
%4 = add i64 %0, 1328
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, %3
store volatile i64 %7, i64* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, char *);
int /*<<< orphan*/ stderr;
bool test_equality_int(int expected, int value, char *msg) {
  if (expected != value) {
    fprintf(stderr, "ERR: valeur attendue %d ; valeur calculee %d. %s\n",
            expected, value, msg);
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<test_equality_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1159 <test_equality_int+0x49>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1160 <test_equality_int+0x50>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_equality_int>:
mov    $0x1,%eax
cmp    %esi,%edi
je     113c <test_equality_int+0x2c>
push   %rax
mov    %rdx,%r8
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"ERR: valeur attendue %d ; valeur calculee %d. %s\0A\00"
define i32 @test_equality_int(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i32, i32* @stderr
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = load i8*, i8** %7
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14, i8* %15)
store i32 0, i32* %4
br label %18
17: ; preds = %3
store i32 1, i32* %4
br label %18
18: ; preds = %17, %11
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"ERR: valeur attendue %d ; valeur calculee %d. %s\0A\00"
define i32 @test_equality_int(i32 %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %0, %1
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %2)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ 0, %5 ], [ 1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    exit(fprintf(stderr, "out of memory\n"));
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <xmalloc+0x40>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    %eax,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @xmalloc(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 ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret i8* %2
}
int cin_com_set_int(int val, int def) {
  if (val == 0) {
    return def;
  }
  return val;
}


x86 assembly (clang, -O0):
<cin_com_set_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <cin_com_set_int+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1125 <cin_com_set_int+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cin_com_set_int>:
mov    %esi,%eax
test   %edi,%edi
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cin_com_set_int(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _s2priv_funab(float (*)(float *, float *), int, int, float,
                                 float, float, float, int /*<<< orphan*/, int,
                                 int, double, double);
void s2funxy(float (*fxy)(float *, float *), int nx, int ny, float xmin,
             float xmax, float ymin, float ymax, int ctl) {
  _s2priv_funab(fxy, nx, ny, xmin, xmax, ymin, ymax, 0, 1, ctl, 0.0, -1.0);
}


x86 assembly (clang, -O0):
<s2funxy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  %xmm1,-0x18(%rbp)
movss  %xmm2,-0x1c(%rbp)
movss  %xmm3,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm2
movss  -0x20(%rbp),%xmm3
mov    -0x24(%rbp),%r9d
xor    %ecx,%ecx
mov    $0x1,%r8d
xorps  %xmm4,%xmm4
movsd  0xe92(%rip),%xmm5
call   1030 <_s2priv_funab@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2funxy>:
mov    %ecx,%r9d
movsd  0xee5(%rip),%xmm5
xorps  %xmm4,%xmm4
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <_s2priv_funab@plt>

LLVM IR (-O0):
define void @s2funxy(float (float*, float*)* %0, i32 %1, i32 %2, float %3, float %4, float %5, float %6, i32 %7) {
%9 = alloca float (float*, float*)*
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca i32
store float (float*, float*)* %0, float (float*, float*)** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store float %3, float* %12
store float %4, float* %13
store float %5, float* %14
store float %6, float* %15
store i32 %7, i32* %16
%17 = load float (float*, float*)*, float (float*, float*)** %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load float, float* %12
%21 = load float, float* %13
%22 = load float, float* %14
%23 = load float, float* %15
%24 = load i32, i32* %16
%25 = call i32 @_s2priv_funab(float (float*, float*)* %17, i32 %18, i32 %19, float %20, float %21, float %22, float %23, i32 0, i32 1, i32 %24, double 0.000000e+00, double -1.000000e+00)
ret void
}

LLVM IR (-O2):
define void @s2funxy(float (float*, float*)* %0, i32 %1, i32 %2, float %3, float %4, float %5, float %6, i32 %7) {
%9 = tail call i32 @_s2priv_funab(float (float*, float*)* %0, i32 %1, i32 %2, float %3, float %4, float %5, float %6, i32 0, i32 1, i32 %7, double 0.000000e+00, double -1.000000e+00)
ret void
}
/* Variables and functions */
int getchar();
void dumptitle(char *title) {
  int c, i = 0;
  while ((c = getchar()) != '\n')
    title[i++] = c;
  title[i] = '\0';
}


x86 assembly (clang, -O0):
<dumptitle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
cmp    $0xa,%eax
je     1155 <dumptitle+0x45>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1123 <dumptitle+0x13>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumptitle>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1146 <dumptitle+0x36>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
jne    1130 <dumptitle+0x20>
mov    %ebx,%ebx
movb   $0x0,(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @dumptitle(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @getchar()
%3 = icmp eq i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i32 [ %10, %4 ], [ %2, %1 ]
%7 = trunc i32 %6 to i8
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %7, i8* %9
%10 = tail call i32 (...) @getchar()
%11 = icmp eq i32 %10, 10
br i1 %11, label %12, label %4
12: ; preds = %4
%13 = and i64 %8, 4294967295
br label %14
14: ; preds = %12, %1
%15 = phi i64 [ 0, %1 ], [ %13, %12 ]
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 0, i8* %16
ret void
}
double adjPoints(int score) {
  double newscore;
  newscore = (double)score - (double)(score * score) / 400;
  return (newscore);
}


x86 assembly (clang, -O0):
<adjPoints>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xee1(%rip),%xmm2
divsd  %xmm2,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjPoints>:
cvtsi2sd %edi,%xmm1
imul   %edi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @adjPoints(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 4.000000e+02
%11 = fsub double %5, %10
store double %11, double* %3
%12 = load double, double* %3
ret double %12
}

LLVM IR (-O2):
define double @adjPoints(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = mul nsw i32 %0, %0
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 4.000000e+02
%6 = fsub double %2, %5
ret double %6
}
unsigned int IWM_SCD_QUEUE_RDPTR(unsigned int chnl) {
  if (chnl < 20)
    return ((0x00000) + 0xa02c00) + 0x68 + chnl * 4;
  return ((0x00000) + 0xa02c00) + 0x2B4 + (chnl - 20) * 4;
}


x86 assembly (clang, -O0):
<IWM_SCD_QUEUE_RDPTR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jae    1124 <IWM_SCD_QUEUE_RDPTR+0x24>
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
add    $0xa02c68,%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <IWM_SCD_QUEUE_RDPTR+0x35>
mov    -0x8(%rbp),%eax
sub    $0x14,%eax
shl    $0x2,%eax
add    $0xa02eb4,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IWM_SCD_QUEUE_RDPTR>:
cmp    $0x14,%edi
lea    0xa02c68(,%rdi,4),%ecx
lea    0xa02e64(,%rdi,4),%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @IWM_SCD_QUEUE_RDPTR(i32 %0) {
%2 = icmp ult i32 %0, 20
%3 = shl i32 %0, 2
%4 = select i1 %2, i32 10497128, i32 10497636
%5 = add i32 %4, %3
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *dict_strdup(char *s) {
  char *p;
  p = (char *)malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<dict_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <dict_strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dict_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <dict_strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dict_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8*, i8** %2
%14 = call i32 @strcpy(i8* %12, i8* %13)
br label %15
15: ; preds = %11, %1
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @dict_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
void ff_hevc_put_hevc_uni_epel_v48_10_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v48_10_avx2() {
ret void
}
void fail_stop_trace(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ send(int, void *, size_t, int /*<<< orphan*/);
ssize_t mywrite_swift(int fd, void *buf, size_t len) {
  return send(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<mywrite_swift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mywrite_swift>:
xor    %ecx,%ecx
jmp    1030 <send@plt>

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

LLVM IR (-O2):
define i32 @mywrite_swift(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
void _ZNK7android11MediaBuffer8refcountEv() {}


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

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

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

LLVM IR (-O2):
define void @_ZNK7android11MediaBuffer8refcountEv() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
void free_null(int *p) {
  free(p);
  p = NULL;
}


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

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

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

LLVM IR (-O2):
define void @free_null(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
/* Variables and functions */
int flag_table_3_3(unsigned char **);
int /*<<< orphan*/ set_flag_table_3_3(unsigned char **, int);
int fix_ncep_4(unsigned char **sec) {
  int i;
  i = flag_table_3_3(sec);
  if (i >= 0) {
    i = i | 48;
    set_flag_table_3_3(sec, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<fix_ncep_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <flag_table_3_3@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1157 <fix_ncep_4+0x37>
mov    -0xc(%rbp),%eax
or     $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <set_flag_table_3_3@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fix_ncep_4>:
push   %rbx
mov    %rdi,%rbx
call   1040 <flag_table_3_3@plt>
test   %eax,%eax
js     113a <fix_ncep_4+0x1a>
or     $0x30,%eax
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <set_flag_table_3_3@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @fix_ncep_4(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i32 @flag_table_3_3(i8** %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i32, i32* %3
%10 = or i32 %9, 48
store i32 %10, i32* %3
%11 = load i8**, i8*** %2
%12 = load i32, i32* %3
%13 = call i32 @set_flag_table_3_3(i8** %11, i32 %12)
br label %14
14: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @fix_ncep_4(i8** %0) {
%2 = tail call i32 @flag_table_3_3(i8** %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = or i32 %2, 48
%6 = tail call i32 @set_flag_table_3_3(i8** %0, i32 %5)
br label %7
7: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void exerciseD() {
  int looper;
  int sum;
  printf("\n\nExercise D running....");
  for (sum = 0, looper = 15; looper <= 45; looper += 2) {
    sum += looper;
  }
  printf("\nSum of the odd numbers 15-45: %d", sum);
  printf("\nExercise D complete.");
  return;
}


x86 assembly (clang, -O0):
<exerciseD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0xf,-0x4(%rbp)
cmpl   $0x2d,-0x4(%rbp)
jg     1155 <exerciseD+0x45>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <exerciseD+0x24>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exerciseD>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x1e0,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0AExercise D running....\00"
@.str.1 = [34 x i8] c"\0ASum of the odd numbers 15-45: %d\00"
@.str.2 = [22 x i8] c"\0AExercise D complete.\00"
define void @exerciseD() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
store i32 15, i32* %1
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 45
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = add nsw i32 %9, %8
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 2
store i32 %13, i32* %1
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\0AExercise D running....\00"
@.str.1 = [34 x i8] c"\0ASum of the odd numbers 15-45: %d\00"
@.str.2 = [22 x i8] c"\0AExercise D complete.\00"
define void @exerciseD() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 480)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void f(void) {
  _Complex double c;
  int a[sizeof(c)];
}


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

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

LLVM IR (-O0):
define void @f() {
%1 = alloca { double, double }
%2 = alloca [16 x i32]
ret void
}

LLVM IR (-O2):
define void @f() {
ret void
}
/* Type definitions */
struct ip6_ext {
  int dummy;
};

/* Variables and functions */
int CMSG_SPACE(int /*<<< orphan*/);
int /*<<< orphan*/ roundup(int, int);
int inet6_option_space(int nbytes) {
  nbytes += sizeof(struct ip6_ext);
  return CMSG_SPACE(roundup(nbytes, 8));
}


x86 assembly (clang, -O0):
<inet6_option_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
add    $0x4,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <roundup@plt>
mov    %eax,%edi
call   1040 <CMSG_SPACE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet6_option_space>:
push   %rax
add    $0x4,%edi
mov    $0x8,%esi
call   1030 <roundup@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <CMSG_SPACE@plt>

LLVM IR (-O0):
define i32 @inet6_option_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = add i64 %4, 4
%6 = trunc i64 %5 to i32
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @roundup(i32 %7, i32 8)
%9 = call i32 @CMSG_SPACE(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @inet6_option_space(i32 %0) {
%2 = add i32 %0, 4
%3 = tail call i32 @roundup(i32 %2, i32 8)
%4 = tail call i32 @CMSG_SPACE(i32 %3)
ret i32 %4
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ pdie(char *);
void *alloc(int size) {
  void *this;
  if ((this = malloc(size)))
    return this;
  pdie("malloc");
  return NULL;
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114e <alloc+0x2e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1162 <alloc+0x42>
lea    0xeab(%rip),%rdi
call   1030 <pdie@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <pdie@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @alloc(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i8* @malloc(i32 %5)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %4
store i8* %9, i8** %2
br label %12
10: ; preds = %1
%11 = call i32 @pdie(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i8* null, i8** %2
br label %12
12: ; preds = %10, %8
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @alloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pdie(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
ret i8* %2
}
/* Variables and functions */
int write_to_database(char *, char *, int);
int write_keepalive_to_database(char *insert, int cycle) {
  return write_to_database("keepalives", insert, cycle);
}


x86 assembly (clang, -O0):
<write_keepalive_to_database>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rdi
call   1030 <write_to_database@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_keepalive_to_database>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <write_to_database@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"keepalives\00"
define i32 @write_keepalive_to_database(i8* %0, i32 %1) {
%3 = tail call i32 @write_to_database(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int time_t;
struct timeval {
  int tv_sec;
};

/* Variables and functions */
int get_monotonic(struct timeval *);
time_t uptime(void) {
  struct timeval tv;
  if (get_monotonic(&tv) == -1)
    return -1;
  return tv.tv_sec;
}


x86 assembly (clang, -O0):
<uptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <get_monotonic@plt>
cmp    $0xffffffff,%eax
jne    1136 <uptime+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <uptime+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptime>:
push   %rax
mov    %rsp,%rdi
call   1030 <get_monotonic@plt>
cmp    $0xffffffff,%eax
je     1121 <uptime+0x11>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @uptime() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = call i32 @get_monotonic(%struct.timeval* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 -1, i32* %1
br label %9
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load i32, i32* %7
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @uptime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @get_monotonic(%struct.timeval* %1)
%4 = icmp eq i32 %3, -1
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = select i1 %4, i32 -1, i32 %6
ret i32 %7
}
double dmdelay(float f1, float f2, double dm) {
  return (4148.741601 * ((1.0 / f1 / f1) - (1.0 / f2 / f2)) * dm);
}


x86 assembly (clang, -O0):
<dmdelay>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movsd  %xmm2,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee4(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xec2(%rip),%xmm0
divsd  %xmm2,%xmm0
movss  -0x8(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  0xe9d(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmdelay>:
unpcklps %xmm1,%xmm0
cvtps2pd %xmm0,%xmm1
movapd 0xef2(%rip),%xmm0
divpd  %xmm1,%xmm0
divpd  %xmm1,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xee6(%rip),%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dmdelay(float %0, float %1, double %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca double
store float %0, float* %4
store float %1, float* %5
store double %2, double* %6
%7 = load float, float* %4
%8 = fpext float %7 to double
%9 = fdiv double 1.000000e+00, %8
%10 = load float, float* %4
%11 = fpext float %10 to double
%12 = fdiv double %9, %11
%13 = load float, float* %5
%14 = fpext float %13 to double
%15 = fdiv double 1.000000e+00, %14
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = fdiv double %15, %17
%19 = fsub double %12, %18
%20 = fmul double 0x40B034BDD99029AE, %19
%21 = load double, double* %6
%22 = fmul double %20, %21
ret double %22
}

LLVM IR (-O2):
define double @dmdelay(float %0, float %1, double %2) {
%4 = insertelement <2 x float> poison, float %0, i64 0
%5 = insertelement <2 x float> %4, float %1, i64 1
%6 = fpext <2 x float> %5 to <2 x double>
%7 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %6
%8 = fdiv <2 x double> %7, %6
%9 = shufflevector <2 x double> %8, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%10 = fsub <2 x double> %8, %9
%11 = extractelement <2 x double> %10, i64 0
%12 = fmul double %11, 0x40B034BDD99029AE
%13 = fmul double %12, %2
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int read(int /*<<< orphan*/, char *, int);
int main(void) {
  char t[510];
  int len;
  len = read(0, t, 501);
  printf("%s\n", (len <= 140 ? "TWEET" : "MUTE"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x210(%rbp),%rsi
xor    %edi,%edi
mov    $0x1f5,%edx
call   1040 <read@plt>
mov    %eax,-0x214(%rbp)
mov    -0x214(%rbp),%ecx
lea    0xeb2(%rip),%rsi
lea    0xea5(%rip),%rax
cmp    $0x8c,%ecx
cmovle %rax,%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x208,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x1f5,%edx
call   1040 <read@plt>
cmp    $0x8d,%eax
lea    0xec2(%rip),%rax
lea    0xec1(%rip),%rsi
cmovl  %rax,%rsi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x208,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"TWEET\00"
@.str.2 = [5 x i8] c"MUTE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [510 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [510 x i8], [510 x i8]* %2, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 501)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 140
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [6 x i8] c"TWEET\00"
@.str.2 = [5 x i8] c"MUTE\00"
define i32 @main() {
%1 = alloca [510 x i8]
%2 = getelementptr inbounds [510 x i8], [510 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 501)
%4 = icmp slt i32 %3, 141
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void PrintHelloWorldArchive(void) { fprintf(stderr, "Hello World Static!\n"); }


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

x86 assembly (clang, -O2):
<PrintHelloWorldArchive>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Hello World Static!\0A\00"
define void @PrintHelloWorldArchive() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Hello World Static!\0A\00"
define void @PrintHelloWorldArchive() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex32array(char *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 32));
}


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

x86 assembly (clang, -O2):
<lookcomplex32array>:
shl    $0x5,%esi
jmp    1030 <lookNarray@plt>

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

LLVM IR (-O2):
define void @lookcomplex32array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 5
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ linear_search(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_array();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int key;
  read_array();
  printf("\nEnter number to be searched: ");
  scanf("%d", &key);
  linear_search(key);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <read_array@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <linear_search@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <read_array@plt>
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <linear_search@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0AEnter number to be searched: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @read_array()
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @linear_search(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0AEnter number to be searched: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @read_array()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @linear_search(i32 %6)
ret i32 0
}