xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ session_send(void *, int, unsigned char *);
void send_handshake(void *channel, unsigned int result) {
  unsigned char hdr = result;
  session_send(channel, 1, &hdr);
}


x86 assembly (clang, -O0):
<send_handshake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
lea    -0xd(%rbp),%rdx
call   1030 <session_send@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_handshake>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%esi
call   1030 <session_send@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @send_handshake(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = load i8*, i8** %3
%9 = call i32 @session_send(i8* %8, i32 1, i8* %5)
ret void
}

LLVM IR (-O2):
define void @send_handshake(i8* %0, i32 %1) {
%3 = alloca i8
%4 = trunc i32 %1 to i8
store i8 %4, i8* %3
%5 = call i32 @session_send(i8* %0, i32 1, i8* %3)
ret void
}
void set_sdramc_weights(unsigned int mpweight_0_4, unsigned int mpweight_1_4) {
  *((unsigned int *)(0xFFC20000 + 0x50B0)) = mpweight_0_4;
  *((unsigned int *)(0xFFC20000 + 0x50B4)) = mpweight_1_4;
  return;
}


x86 assembly (clang, -O0):
<set_sdramc_weights>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xffc250b0,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    $0xffc250b4,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sdramc_weights>:
mov    $0xffc250b0,%eax
mov    %edi,(%rax)
mov    %esi,0x4(%rax)
ret

LLVM IR (-O0):
define void @set_sdramc_weights(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
store i32 %5, i32* inttoptr (i64 4290924720 to i32*)
%6 = load i32, i32* %4
store i32 %6, i32* inttoptr (i64 4290924724 to i32*)
ret void
}

LLVM IR (-O2):
define void @set_sdramc_weights(i32 %0, i32 %1) {
store i32 %0, i32* inttoptr (i64 4290924720 to i32*)
store i32 %1, i32* inttoptr (i64 4290924724 to i32*)
ret void
}
int cmd_cycle(struct robot *robot, int *args) { return 1; }


x86 assembly (clang, -O0):
<cmd_cycle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.robot = type opaque
define i32 @cmd_cycle(%struct.robot* %0, i32* %1) {
%3 = alloca %struct.robot*
%4 = alloca i32*
store %struct.robot* %0, %struct.robot** %3
store i32* %1, i32** %4
ret i32 1
}

LLVM IR (-O2):
%struct.robot = type opaque
define i32 @cmd_cycle(%struct.robot* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned int);
void xor_reg32_m32(unsigned int reg32, unsigned int *m32) {
  put8(0x33);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<xor_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x33,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x33,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @xor_reg32_m32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @put8(i32 51)
%6 = load i32, i32* %3
%7 = shl i32 %6, 3
%8 = or i32 %7, 5
%9 = call i32 @put8(i32 %8)
%10 = load i32*, i32** %4
%11 = ptrtoint i32* %10 to i32
%12 = call i32 @put32(i32 %11)
ret void
}

LLVM IR (-O2):
define void @xor_reg32_m32(i32 %0, i32* %1) {
%3 = tail call i32 @put8(i32 51)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
int isDotDot(const char *s) {
  return s[0] == '.' && s[1] == '.' && (s[2] == '/' || s[2] == '\0');
}


x86 assembly (clang, -O0):
<isDotDot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1160 <isDotDot+0x60>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1160 <isDotDot+0x60>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
mov    $0x1,%al
cmp    $0x2f,%ecx
mov    %al,-0xa(%rbp)
je     115a <isDotDot+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDotDot>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    1121 <isDotDot+0x21>
cmpb   $0x2e,0x1(%rdi)
jne    1121 <isDotDot+0x21>
mov    0x2(%rdi),%cl
mov    $0x1,%eax
cmp    $0x2f,%cl
je     1121 <isDotDot+0x21>
xor    %eax,%eax
test   %cl,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @isDotDot(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %15
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 46
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 47
br i1 %11, label %15, label %12
12: ; preds = %8
%13 = icmp eq i8 %10, 0
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %8, %12, %4, %1
%16 = phi i32 [ 0, %4 ], [ 0, %1 ], [ 1, %8 ], [ %14, %12 ]
ret i32 %16
}
void trap_myself(void) { __asm("int3"); }


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

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

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

LLVM IR (-O2):
define void @trap_myself() {
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void showMacroWithCode() {
  printf("SQUARE is defined\n");
  int var = 5;
  printf("Macro function result %d\n", var * var);
}


x86 assembly (clang, -O0):
<showMacroWithCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%esi
imul   -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showMacroWithCode>:
push   %rax
lea    0xef2(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x19,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"SQUARE is defined\0A\00"
@.str.1 = [26 x i8] c"Macro function result %d\0A\00"
define void @showMacroWithCode() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 5, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* %1
%5 = mul nsw i32 %3, %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"Macro function result %d\0A\00"
@str = [18 x i8] c"SQUARE is defined\00"
define void @showMacroWithCode() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 25)
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t QEIPositionGet(uint32_t ui32Base) {
  ;
  return ((*((volatile unsigned long *)(ui32Base + 0x00000008))));
}


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

x86 assembly (clang, -O2):
<QEIPositionGet>:
mov    %rdi,-0x8(%rsp)
mov    -0x8(%rsp),%rax
mov    0x8(%rax),%rax
ret

LLVM IR (-O0):
define i64 @QEIPositionGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @QEIPositionGet(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = add i64 %3, 8
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
ret i64 %6
}
adr0reg1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((*((unsigned char *)10000000)) <= r1)
    return 1;
  else
    return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @adr0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = load i8, i8* inttoptr (i64 10000000 to i8*)
%8 = zext i8 %7 to i32
%9 = and i32 %1, 255
%10 = icmp uge i32 %9, %8
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int A();
int /*<<< orphan*/ puts(char *);
int main(int argc, const char *argv[]) {
  puts("-- main() return A()");
  return A();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <A@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <A@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"-- main() return A()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @A()
ret i32 %4
}
void flush_registers() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ __wcstoll_internal(int /*<<< orphan*/ const *,
                                      int /*<<< orphan*/ **, int,
                                      int /*<<< orphan*/);
intmax_t wcstoimax(const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
                   int base) {
  return __wcstoll_internal(nptr, endptr, base, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @wcstoimax(i32* noalias %0, i32** noalias %1, i32 %2) {
%4 = tail call i32 @__wcstoll_internal(i32* %0, i32** %1, i32 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ COLS;
int /*<<< orphan*/ LINES;
int /*<<< orphan*/ clip(int, int /*<<< orphan*/);
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
void redisplay(int cursor_x, int cursor_y) {
  move(clip(cursor_y, LINES), clip(cursor_x, COLS));
  refresh();
}


x86 assembly (clang, -O0):
<redisplay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
call   1030 <clip@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
call   1030 <clip@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1050 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redisplay>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %edi,%ebx
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1030 <clip@plt>
mov    %eax,%ebp
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1030 <clip@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1050 <move@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@LINES = global i32 0
@COLS = global i32 0
define void @redisplay(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* @LINES
%7 = call i32 @clip(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* @COLS
%10 = call i32 @clip(i32 %8, i32 %9)
%11 = call i32 @move(i32 %7, i32 %10)
%12 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@LINES = global i32 0
@COLS = global i32 0
define void @redisplay(i32 %0, i32 %1) {
%3 = load i32, i32* @LINES
%4 = tail call i32 @clip(i32 %1, i32 %3)
%5 = load i32, i32* @COLS
%6 = tail call i32 @clip(i32 %0, i32 %5)
%7 = tail call i32 @move(i32 %4, i32 %6)
%8 = tail call i32 (...) @refresh()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PrintErrorCode();
int /*<<< orphan*/ dxl_write_byte(int, int, int);
void changeI(int Id, int iValue) {
  dxl_write_byte(Id, 27, iValue);
  PrintErrorCode();
}


x86 assembly (clang, -O0):
<changeI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1b,%esi
call   1030 <dxl_write_byte@plt>
mov    $0x0,%al
call   1040 <PrintErrorCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<changeI>:
push   %rax
mov    %esi,%edx
mov    $0x1b,%esi
call   1030 <dxl_write_byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <PrintErrorCode@plt>

LLVM IR (-O0):
define void @changeI(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @dxl_write_byte(i32 %5, i32 27, i32 %6)
%8 = call i32 (...) @PrintErrorCode()
ret void
}

LLVM IR (-O2):
define void @changeI(i32 %0, i32 %1) {
%3 = tail call i32 @dxl_write_byte(i32 %0, i32 27, i32 %1)
%4 = tail call i32 (...) @PrintErrorCode()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mnistTest();
int main() {
  mnistTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mnistTest()
ret i32 0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ set_rounding();
void cvt_s_l(const int64_t *source, float *dest) {
  set_rounding();
  *dest = (float)*source;
}


x86 assembly (clang, -O0):
<cvt_s_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <set_rounding@plt>
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_s_l>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <set_rounding@plt>
cvtsi2ssq (%rbx),%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @cvt_s_l(i64* %0, float* %1) {
%3 = alloca i64*
%4 = alloca float*
store i64* %0, i64** %3
store float* %1, float** %4
%5 = call i32 (...) @set_rounding()
%6 = load i64*, i64** %3
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to float
%9 = load float*, float** %4
store float %8, float* %9
ret void
}

LLVM IR (-O2):
define void @cvt_s_l(i64* nocapture %0, float* nocapture writeonly %1) {
%3 = tail call i32 (...) @set_rounding()
%4 = load i64, i64* %0
%5 = sitofp i64 %4 to float
store float %5, float* %1
ret void
}
/* Variables and functions */
unsigned int GET32(int);
unsigned int timer_tick(void) { return (GET32(0x2000B420)); }


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

x86 assembly (clang, -O2):
<timer_tick>:
mov    $0x2000b420,%edi
jmp    1030 <GET32@plt>

LLVM IR (-O0):
define i32 @timer_tick() {
%1 = call i32 @GET32(i32 536917024)
ret i32 %1
}

LLVM IR (-O2):
define i32 @timer_tick() {
%1 = tail call i32 @GET32(i32 536917024)
ret i32 %1
}
char *ntlibc_strchr(const char *s, int c) {
  char *p = (char *)s;
  while (*p) {
    if (*p == c) {
      return p;
    }
    p++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ntlibc_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <ntlibc_strchr+0x4e>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    113d <ntlibc_strchr+0x3d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <ntlibc_strchr+0x56>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1113 <ntlibc_strchr+0x13>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntlibc_strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <ntlibc_strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <ntlibc_strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <ntlibc_strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @ntlibc_strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char const *, char *);
main() {
  char str[] = "DESIS India pvt. ltd.";
  const char *str1 = str;
  strcpy(str1, "DESHAW");
  printf("str is %s", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
mov    0xec6(%rip),%ax
mov    %ax,-0xc(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x20(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x2e64746c202e74,%rax
mov    %rax,0xe(%rsp)
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [22 x i8] c"DESIS India pvt. ltd.\00"
@.str = [7 x i8] c"DESHAW\00"
@.str.1 = [10 x i8] c"str is %s\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = alloca i8*
%3 = bitcast [22 x i8]* %1 to i8*
%4 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [22 x i8] c"DESIS India pvt. ltd.\00"
@.str = [7 x i8] c"DESHAW\00"
@.str.1 = [10 x i8] c"str is %s\00"
define i32 @main() {
%1 = alloca [22 x i8]
%2 = getelementptr inbounds [22 x i8], [22 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ x86CpuID(int *, int, int /*<<< orphan*/);
int cpuSupportsAVX() {
  int32_t reg[4];
  x86CpuID(reg, 1, 0);
  return (reg[2] & (1 << 28)) != 0;
}


x86 assembly (clang, -O0):
<cpuSupportsAVX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <x86CpuID@plt>
mov    -0x8(%rbp),%eax
and    $0x10000000,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuSupportsAVX>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1030 <x86CpuID@plt>
mov    0x8(%rsp),%eax
shr    $0x1c,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @cpuSupportsAVX() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @x86CpuID(i32* %2, i32 1, i32 0)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%5 = load i32, i32* %4
%6 = and i32 %5, 268435456
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cpuSupportsAVX() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @x86CpuID(i32* %3, i32 1, i32 0)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 2
%6 = load i32, i32* %5
%7 = lshr i32 %6, 28
%8 = and i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ foo1();
int /*<<< orphan*/ foo2();
void baz() {
  foo1();
  foo2();
}


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

x86 assembly (clang, -O2):
<baz>:
push   %rax
xor    %eax,%eax
call   1040 <foo1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <foo2@plt>

LLVM IR (-O0):
define void @baz() {
%1 = call i32 (...) @foo1()
%2 = call i32 (...) @foo2()
ret void
}

LLVM IR (-O2):
define void @baz() {
%1 = tail call i32 (...) @foo1()
%2 = tail call i32 (...) @foo2()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ output;

/* Variables and functions */
int /*<<< orphan*/ basename_r(char *, char *, int);
int /*<<< orphan*/ printf(char *, ...);
void test(char *input, int size) {
  char output[100] = {0};
  basename_r(input, output, sizeof(output));
  printf("-----------------------------------------\n");
  printf("input is: [%s]\noutput is : [%s]\n", input, output);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    $0x64,%edx
call   1050 <basename_r@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%r14
mov    %r14,%rsi
mov    $0x64,%edx
call   1050 <basename_r@plt>
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7b(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [43 x i8] c"-----------------------------------------\0A\00"
@.str.1 = [33 x i8] c"input is: [%s]\0Aoutput is : [%s]\0A\00"
define void @test(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [100 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast [100 x i8]* %5 to i8*
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%9 = call i32 @basename_r(i8* %7, i8* %8, i32 100)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %3
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"input is: [%s]\0Aoutput is : [%s]\0A\00"
@str = [42 x i8] c"-----------------------------------------\00"
define void @test(i8* %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%5 = call i32 @basename_r(i8* %0, i8* %4, i32 100)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
void nv_free_strtoks(char **s, int n) {
  int i;
  for (i = 0; i < n; i++)
    free(s[i]);
  free(s);
}


x86 assembly (clang, -O0):
<nv_free_strtoks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <nv_free_strtoks+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <nv_free_strtoks+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nv_free_strtoks>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <nv_free_strtoks+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <nv_free_strtoks+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @nv_free_strtoks(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
bool safe_streq(const char *s1, const char *s2) {
  if ((s1 == NULL) != (s2 == NULL))
    return false;
  if (s1)
    return !strcmp(s1, s2);
  return true;
}


x86 assembly (clang, -O0):
<safe_streq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpq   $0x0,-0x18(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     114f <safe_streq+0x3f>
movl   $0x0,-0x4(%rbp)
jmp    1183 <safe_streq+0x73>
cmpq   $0x0,-0x10(%rbp)
je     117c <safe_streq+0x6c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1183 <safe_streq+0x73>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_streq>:
test   %rdi,%rdi
setne  %cl
test   %rsi,%rsi
sete   %dl
xor    %eax,%eax
cmp    %dl,%cl
je     113a <safe_streq+0x2a>
test   %rdi,%rdi
je     113b <safe_streq+0x2b>
push   %rax
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @safe_streq(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
%8 = zext i1 %7 to i32
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
%11 = zext i1 %10 to i32
%12 = icmp ne i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %25
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = call i32 @strcmp(i8* %18, i8* %19)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
store i32 %23, i32* %3
br label %25
24: ; preds = %14
store i32 1, i32* %3
br label %25
25: ; preds = %24, %17, %13
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @safe_streq(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp eq i8* %1, null
%5 = xor i1 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %2
%7 = icmp eq i8* %0, null
br i1 %7, label %12, label %8
8: ; preds = %6
%9 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(1) %1)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %2, %8
%13 = phi i32 [ %11, %8 ], [ 0, %2 ], [ 1, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ core6_swap(char *, int);
void U_EMRPOLYBEZIERTO16_swap(char *record, int torev) {
  core6_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_EMRPOLYBEZIERTO16_swap>:
jmp    1030 <core6_swap@plt>

LLVM IR (-O0):
define void @U_EMRPOLYBEZIERTO16_swap(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 @core6_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_EMRPOLYBEZIERTO16_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core6_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
size_t nOutputChannels(const char *computation, size_t nInputChannels) {
  size_t result = 0;
  if (strcmp(computation, "compute") == 0) {
    result = nInputChannels;
  }
  return result;
}


x86 assembly (clang, -O0):
<nOutputChannels>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    114a <nOutputChannels+0x3a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nOutputChannels>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"compute\00"
define i64 @nOutputChannels(i8* %0, i64 %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i64 %1, i64 0
ret i64 %5
}
double statistics_weighted_compute_average(long weighted_count,
                                           double weighted_sum) {
  return (!weighted_count) ? 0.0 : weighted_sum / (double)weighted_count;
}


x86 assembly (clang, -O0):
<statistics_weighted_compute_average>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1125 <statistics_weighted_compute_average+0x25>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1139 <statistics_weighted_compute_average+0x39>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdq -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<statistics_weighted_compute_average>:
test   %rdi,%rdi
je     110f <statistics_weighted_compute_average+0xf>
cvtsi2sd %rdi,%xmm1
divsd  %xmm1,%xmm0
ret
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @statistics_weighted_compute_average(i64 %0, double %1) {
%3 = alloca i64
%4 = alloca double
store i64 %0, i64* %3
store double %1, double* %4
%5 = load i64, i64* %3
%6 = icmp ne i64 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load double, double* %4
%10 = load i64, i64* %3
%11 = sitofp i64 %10 to double
%12 = fdiv double %9, %11
br label %13
13: ; preds = %8, %7
%14 = phi double [ 0.000000e+00, %7 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @statistics_weighted_compute_average(i64 %0, double %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sitofp i64 %0 to double
%6 = fdiv double %1, %5
br label %7
7: ; preds = %2, %4
%8 = phi double [ %6, %4 ], [ 0.000000e+00, %2 ]
ret double %8
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_inverse(float *, float *);
__attribute__((always_)) struct mat3 *psmat3_inverse(struct mat3 *result,
                                                     struct mat3 *m) {
  mat3_inverse((float *)result, (float *)m);
  return result;
}


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

x86 assembly (clang, -O2):
<psmat3_inverse>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3_inverse@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_inverse(%struct.mat3* %0, %struct.mat3* %1) {
%3 = alloca %struct.mat3*
%4 = alloca %struct.mat3*
store %struct.mat3* %0, %struct.mat3** %3
store %struct.mat3* %1, %struct.mat3** %4
%5 = load %struct.mat3*, %struct.mat3** %3
%6 = bitcast %struct.mat3* %5 to float*
%7 = load %struct.mat3*, %struct.mat3** %4
%8 = bitcast %struct.mat3* %7 to float*
%9 = call i32 @mat3_inverse(float* %6, float* %8)
%10 = load %struct.mat3*, %struct.mat3** %3
ret %struct.mat3* %10
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_inverse(%struct.mat3* returned %0, %struct.mat3* %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = bitcast %struct.mat3* %1 to float*
%5 = tail call i32 @mat3_inverse(float* %3, float* %4)
ret %struct.mat3* %0
}
float servoEaseOutQuad(float t, float b, float c, float d) {
  return -c * (t /= d) * (t - 2) + b;
}


x86 assembly (clang, -O0):
<servoEaseOutQuad>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  -0x10(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
divss  %xmm2,%xmm1
movss  %xmm1,-0x4(%rbp)
mulss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm2
movss  0xeb2(%rip),%xmm1
subss  %xmm1,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<servoEaseOutQuad>:
divss  %xmm3,%xmm0
mulss  %xmm0,%xmm2
addss  0xef0(%rip),%xmm0
mulss  %xmm2,%xmm0
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @servoEaseOutQuad(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = fneg float %9
%11 = load float, float* %8
%12 = load float, float* %5
%13 = fdiv float %12, %11
store float %13, float* %5
%14 = fmul float %10, %13
%15 = load float, float* %5
%16 = fsub float %15, 2.000000e+00
%17 = load float, float* %6
%18 = call float @llvm.fmuladd.f32(float %14, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
define float @servoEaseOutQuad(float %0, float %1, float %2, float %3) {
%5 = fneg float %2
%6 = fdiv float %0, %3
%7 = fmul float %6, %5
%8 = fadd float %6, -2.000000e+00
%9 = tail call float @llvm.fmuladd.f32(float %7, float %8, float %1)
ret float %9
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int buffer_addstring(struct buffer *, unsigned char const *);
int /*<<< orphan*/ buffer_truncate(struct buffer *);
int buffer_setstring(struct buffer *b, const unsigned char *s) {
  buffer_truncate(b);
  return buffer_addstring(b, s);
}


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

x86 assembly (clang, -O2):
<buffer_setstring>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <buffer_truncate@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <buffer_addstring@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define i32 @buffer_setstring(%struct.buffer* %0, i8* %1) {
%3 = alloca %struct.buffer*
%4 = alloca i8*
store %struct.buffer* %0, %struct.buffer** %3
store i8* %1, i8** %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = call i32 @buffer_truncate(%struct.buffer* %5)
%7 = load %struct.buffer*, %struct.buffer** %3
%8 = load i8*, i8** %4
%9 = call i32 @buffer_addstring(%struct.buffer* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define i32 @buffer_setstring(%struct.buffer* %0, i8* %1) {
%3 = tail call i32 @buffer_truncate(%struct.buffer* %0)
%4 = tail call i32 @buffer_addstring(%struct.buffer* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void invalidFunctionArg_close(int fd) {
  if (fd < 0) {
    (void)close(fd);
  }
}


x86 assembly (clang, -O0):
<invalidFunctionArg_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112d <invalidFunctionArg_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalidFunctionArg_close>:
test   %edi,%edi
js     1115 <invalidFunctionArg_close+0x5>
ret
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @invalidFunctionArg_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @invalidFunctionArg_close(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int wsexit_fun(int code) {
  exit(code);
  return 0;
}


x86 assembly (clang, -O0):
<wsexit_fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<wsexit_fun>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @wsexit_fun(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ send(int /*<<< orphan*/);
void send_str(const char *str) {
  while (*str)
    send(*(str++));
}


x86 assembly (clang, -O0):
<send_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <send_str+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <send@plt>
jmp    111c <send_str+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <send_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <send@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <send_str+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @send_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @send(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void SumSquareError_SSE2() {}


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

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

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

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