xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int int32_t;
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int);
int main(void) {
  int32_t a, b, c, d;
  a = (int32_t)(7.5 * (1 << 16));
  b = (int32_t)(10.5 * (1 << 16));
  c = (((int32_t)a * (int32_t)b) >> 16);
  d = (int16_t)(0.00022 * (1 << 16));
  printf("a = %d, b=%d, c=%d, d=%d\n", a, b, c, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x78000,-0x8(%rbp)
movl   $0xa8000,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x10(%rbp)
movl   $0xe,-0x14(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x78000,%esi
mov    $0xa8000,%edx
mov    $0xffffc000,%ecx
mov    $0xe,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"a = %d, b=%d, c=%d, d=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 491520, i32* %2
store i32 688128, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = mul nsw i32 %6, %7
%9 = ashr i32 %8, 16
store i32 %9, i32* %4
store i32 14, i32* %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"a = %d, b=%d, c=%d, d=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 491520, i32 688128, i32 -16384, i32 14)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int syntax(void) {
  printf("syntax:\n");
  printf("  pad padnum filename\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"syntax:\0A\00"
@.str.1 = [23 x i8] c" pad padnum filename\0A\00"
define i32 @syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"syntax:\00"
@str.2 = [22 x i8] c" pad padnum filename\00"
define i32 @syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ t();
void function_declaration_both_before(void) { t(); }


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

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

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

LLVM IR (-O2):
define void @function_declaration_both_before() {
%1 = tail call i32 (...) @t()
ret void
}
/* Variables and functions */
char *ltoa_wp(long, char *, int, int, char);
char *ltoa_w(long val, char *buffer, int base, int width) {
  return ltoa_wp(val, buffer, base, width, ' ');
}


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

x86 assembly (clang, -O2):
<ltoa_w>:
mov    $0x20,%r8d
jmp    1030 <ltoa_wp@plt>

LLVM IR (-O0):
define i8* @ltoa_w(i64 %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i64 %0, i64* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i64, i64* %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i8* @ltoa_wp(i64 %9, i8* %10, i32 %11, i32 %12, i8 signext 32)
ret i8* %13
}

LLVM IR (-O2):
define i8* @ltoa_w(i64 %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i8* @ltoa_wp(i64 %0, i8* %1, i32 %2, i32 %3, i8 signext 32)
ret i8* %5
}
/* Type definitions */
struct mypacket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ send_fake_SYN(struct mypacket *, unsigned int);
int /*<<< orphan*/ usleep(int);
int x11_process_syn(struct mypacket *packet) {
  unsigned int sflags = 1;
  if (1) {
    sflags |= (1 << 1);
  }
  send_fake_SYN(packet, sflags);
  usleep(20000);
  send_fake_SYN(packet, sflags);
  usleep(20000);
  return 1;
}


x86 assembly (clang, -O0):
<x11_process_syn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <send_fake_SYN@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <send_fake_SYN@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x11_process_syn>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3,%esi
call   1030 <send_fake_SYN@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <send_fake_SYN@plt>
mov    $0x4e20,%edi
call   1040 <usleep@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mypacket = type { i32 }
define i32 @x11_process_syn(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
%3 = alloca i32
store %struct.mypacket* %0, %struct.mypacket** %2
store i32 1, i32* %3
%4 = load i32, i32* %3
%5 = or i32 %4, 2
store i32 %5, i32* %3
%6 = load %struct.mypacket*, %struct.mypacket** %2
%7 = load i32, i32* %3
%8 = call i32 @send_fake_SYN(%struct.mypacket* %6, i32 %7)
%9 = call i32 @usleep(i32 20000)
%10 = load %struct.mypacket*, %struct.mypacket** %2
%11 = load i32, i32* %3
%12 = call i32 @send_fake_SYN(%struct.mypacket* %10, i32 %11)
%13 = call i32 @usleep(i32 20000)
ret i32 1
}

LLVM IR (-O2):
%struct.mypacket = type { i32 }
define i32 @x11_process_syn(%struct.mypacket* %0) {
%2 = tail call i32 @send_fake_SYN(%struct.mypacket* %0, i32 3)
%3 = tail call i32 @usleep(i32 20000)
%4 = tail call i32 @send_fake_SYN(%struct.mypacket* %0, i32 3)
%5 = tail call i32 @usleep(i32 20000)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void print(void *el) { printf("%c", *((char *)el)); }


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

x86 assembly (clang, -O2):
<print>:
movsbl (%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %4)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @print(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char buf[64];
  printf("%p\n", buf);
  gets(buf);
  printf("You entered: %s\n", buf);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [17 x i8] c"You entered: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%p\0A\00"
@.str.1 = [17 x i8] c"You entered: %s\0A\00"
define i32 @main() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @gets(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
int main() {
  unsigned char arg = 0x55;
  unsigned char out = 0;
  __asm__("movb $3, %%cl; rorb %%cl, %%al;" : "=a"(out) : "a"(arg) : "%cl");
  return (out == 0xAA);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
movb   $0x0,-0x6(%rbp)
mov    -0x5(%rbp),%al
mov    $0x3,%cl
ror    %cl,%al
mov    %al,-0x6(%rbp)
movzbl -0x6(%rbp),%eax
cmp    $0xaa,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x55,%al
mov    $0x3,%cl
ror    %cl,%al
xor    %ecx,%ecx
cmp    $0xaa,%al
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %2
%5 = call i8 asm "movb $$3, %cl; rorb %cl, %al;", "={ax},{ax},~{cl},~{dirflag},~{fpsr},~{flags}"(i8 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 170
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "movb $$3, %cl; rorb %cl, %al;", "={ax},{ax},~{cl},~{dirflag},~{fpsr},~{flags}"(i8 85)
%2 = icmp eq i8 %1, -86
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello World.");
  return 0;
}


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    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca 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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ atof(char const *);
int /*<<< orphan*/ c_plsdidev(int, int /*<<< orphan*/, int, int);
int opt_a(const char *opt, const char *myoptarg, void *client_data) {
  (void)opt;
  (void)client_data;
  c_plsdidev((-42), atof(myoptarg), (-42), (-42));
  return 0;
}


x86 assembly (clang, -O0):
<opt_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%esi
mov    $0xffffffd6,%ecx
mov    %ecx,%edi
mov    %ecx,%edx
call   1040 <c_plsdidev@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_a>:
push   %rax
mov    %rsi,%rdi
call   1030 <atof@plt>
mov    $0xffffffd6,%edi
mov    %eax,%esi
mov    $0xffffffd6,%edx
mov    $0xffffffd6,%ecx
call   1040 <c_plsdidev@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @opt_a(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = tail call i32 @atof(i8* %1)
%5 = tail call i32 @c_plsdidev(i32 -42, i32 %4, i32 -42, i32 -42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteData(int);
void createWinLogo() {
  LCD_WriteData(0x0);
  LCD_WriteData(0x1);
  LCD_WriteData(0x3);
  LCD_WriteData(0x16);
  LCD_WriteData(0x1c);
  LCD_WriteData(0x8);
  LCD_WriteData(0x0);
  LCD_WriteData(0x0);
}


x86 assembly (clang, -O0):
<createWinLogo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x1,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x3,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x16,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x1c,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x8,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<createWinLogo>:
push   %rax
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x1,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x3,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x16,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x1c,%edi
call   1030 <LCD_WriteData@plt>
mov    $0x8,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
call   1030 <LCD_WriteData@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <LCD_WriteData@plt>

LLVM IR (-O0):
define void @createWinLogo() {
%1 = call i32 @LCD_WriteData(i32 0)
%2 = call i32 @LCD_WriteData(i32 1)
%3 = call i32 @LCD_WriteData(i32 3)
%4 = call i32 @LCD_WriteData(i32 22)
%5 = call i32 @LCD_WriteData(i32 28)
%6 = call i32 @LCD_WriteData(i32 8)
%7 = call i32 @LCD_WriteData(i32 0)
%8 = call i32 @LCD_WriteData(i32 0)
ret void
}

LLVM IR (-O2):
define void @createWinLogo() {
%1 = tail call i32 @LCD_WriteData(i32 0)
%2 = tail call i32 @LCD_WriteData(i32 1)
%3 = tail call i32 @LCD_WriteData(i32 3)
%4 = tail call i32 @LCD_WriteData(i32 22)
%5 = tail call i32 @LCD_WriteData(i32 28)
%6 = tail call i32 @LCD_WriteData(i32 8)
%7 = tail call i32 @LCD_WriteData(i32 0)
%8 = tail call i32 @LCD_WriteData(i32 0)
ret void
}
int otp_Module_Information_copy(const unsigned char *ov8865_data_ptr,
                                const int ov8865_size,
                                unsigned char *otp_data_ptr, int *otp_size) {
  return 0;
}


x86 assembly (clang, -O0):
<otp_Module_Information_copy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<otp_Module_Information_copy>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @otp_Module_Information_copy(i8* %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @otp_Module_Information_copy(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 0
}
void setFrameParams(struct domain *theDomain) {}


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

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

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

LLVM IR (-O2):
%struct.domain = type opaque
define void @setFrameParams(%struct.domain* nocapture %0) {
ret void
}
/* Type definitions */
typedef int volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ delay_us(int);
void delay_ms(uint32_t ms) {
  for (volatile int i = 0; i < ms; i++)
    delay_us(1000);
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
cmp    %ecx,%eax
jge    1148 <delay_ms+0x38>
mov    $0x3e8,%edi
call   1030 <delay_us@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <delay_ms+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
push   %rax
mov    %edi,0x4(%rsp)
movl   $0x0,(%rsp)
nopl   0x0(%rax)
mov    (%rsp),%eax
cmp    0x4(%rsp),%eax
jge    1139 <delay_ms+0x29>
mov    $0x3e8,%edi
call   1030 <delay_us@plt>
addl   $0x1,(%rsp)
jmp    1120 <delay_ms+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store volatile i32 %0, i32* %2
store volatile i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load volatile i32, i32* %3
%6 = load volatile i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @delay_us(i32 1000)
br label %10
10: ; preds = %8
%11 = load volatile i32, i32* %3
%12 = add nsw i32 %11, 1
store volatile i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store volatile i32 %0, i32* %2
%4 = bitcast i32* %3 to i8*
store volatile i32 0, i32* %3
%5 = load volatile i32, i32* %3
%6 = load volatile i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %9, %1
ret void
9: ; preds = %1, %9
%10 = tail call i32 @delay_us(i32 1000)
%11 = load volatile i32, i32* %3
%12 = add nsw i32 %11, 1
store volatile i32 %12, i32* %3
%13 = load volatile i32, i32* %3
%14 = load volatile i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %9, label %8
}
void RTMpGetDescription(void) {}


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

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

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

LLVM IR (-O2):
define void @RTMpGetDescription() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int create_dobldobl_homotopy_with_given_gamma(double gamma_re,
                                              double gamma_im) {
  int *a, *b, fail;
  double c[2];
  c[0] = gamma_re;
  c[1] = gamma_im;
  fail = _ada_use_c2phc(173, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<create_dobldobl_homotopy_with_given_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0xad,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dobldobl_homotopy_with_given_gamma>:
sub    $0x18,%rsp
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
mov    %rsp,%rcx
mov    $0xad,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @create_dobldobl_homotopy_with_given_gamma(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca [2 x double]
store double %0, double* %3
store double %1, double* %4
%9 = load double, double* %3
%10 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
store double %9, double* %10
%11 = load double, double* %4
%12 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
store double %11, double* %12
%13 = load i32*, i32** %5
%14 = load i32*, i32** %6
%15 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%16 = call i32 @_ada_use_c2phc(i32 173, i32* %13, i32* %14, double* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @create_dobldobl_homotopy_with_given_gamma(double %0, double %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
store double %0, double* %5
%6 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
store double %1, double* %6
%7 = call i32 @_ada_use_c2phc(i32 173, i32* undef, i32* undef, double* %5)
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pem_password_cb;
typedef int /*<<< orphan*/ EVP_PKEY;
typedef int /*<<< orphan*/ EVP_CIPHER;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int do_pk8pkey(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int /*<<< orphan*/,
               int, int /*<<< orphan*/ const *, char *, int,
               int /*<<< orphan*/ *, void *);
int PEM_write_bio_PKCS8PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc,
                                  char *kstr, int klen, pem_password_cb *cb,
                                  void *u) {
  return do_pk8pkey(bp, x, 0, -1, enc, kstr, klen, cb, u);
}


x86 assembly (clang, -O0):
<PEM_write_bio_PKCS8PrivateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%r11d
mov    -0x30(%rbp),%r10
mov    0x10(%rbp),%rax
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <do_pk8pkey@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_PKCS8PrivateKey>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %rcx,%r9
mov    %rdx,%r8
sub    $0x8,%rsp
xor    %edx,%edx
mov    $0xffffffff,%ecx
push   0x18(%rsp)
push   %rax
push   %r10
call   1030 <do_pk8pkey@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PEM_write_bio_PKCS8PrivateKey(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i8*
store i32* %0, i32** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i8* %3, i8** %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i8* %6, i8** %14
%15 = load i32*, i32** %8
%16 = load i32*, i32** %9
%17 = load i32*, i32** %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = load i32*, i32** %13
%21 = load i8*, i8** %14
%22 = call i32 @do_pk8pkey(i32* %15, i32* %16, i32 0, i32 -1, i32* %17, i8* %18, i32 %19, i32* %20, i8* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @PEM_write_bio_PKCS8PrivateKey(i32* %0, i32* %1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6) {
%8 = tail call i32 @do_pk8pkey(i32* %0, i32* %1, i32 0, i32 -1, i32* %2, i8* %3, i32 %4, i32* %5, i8* %6)
ret i32 %8
}
void ADCIntEnable(unsigned long ulBase, unsigned long ulSequenceNum) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) = 1 << ulSequenceNum;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 1 << ulSequenceNum;
}


x86 assembly (clang, -O0):
<ADCIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0xc(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCIntEnable>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0xc(%rdi)
or     %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ADCIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = add i64 %9, 12
%11 = inttoptr i64 %10 to i64*
store volatile i64 %8, i64* %11
%12 = load i64, i64* %4
%13 = trunc i64 %12 to i32
%14 = shl i32 1, %13
%15 = sext i32 %14 to i64
%16 = load i64, i64* %3
%17 = add i64 %16, 8
%18 = inttoptr i64 %17 to i64*
%19 = load volatile i64, i64* %18
%20 = or i64 %19, %15
store volatile i64 %20, i64* %18
ret void
}

LLVM IR (-O2):
define void @ADCIntEnable(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = add i64 %0, 12
%7 = inttoptr i64 %6 to i64*
store volatile i64 %5, i64* %7
%8 = add i64 %0, 8
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = or i64 %10, %5
store volatile i64 %11, i64* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned int, int /*<<< orphan*/ *);
void srec_set_hex4(FILE *fp, unsigned val) {
  val &= 0x0f;
  val += (val <= 9) ? '0' : ('A' - 10);
  fputc(val, fp);
}


x86 assembly (clang, -O0):
<srec_set_hex4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x37,%eax
mov    $0x30,%ecx
cmp    $0x9,%edx
cmovbe %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srec_set_hex4>:
mov    %rdi,%rax
and    $0xf,%esi
lea    0x37(%rsi),%ecx
lea    0x30(%rsi),%edi
cmp    $0xa,%esi
cmovae %ecx,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @srec_set_hex4(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 = and i32 %5, 15
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ule i32 %7, 9
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 48, i32 55
%11 = load i32, i32* %4
%12 = add i32 %11, %10
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = load i32*, i32** %3
%15 = call i32 @fputc(i32 %13, i32* %14)
ret void
}

LLVM IR (-O2):
define void @srec_set_hex4(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 15
%4 = icmp ult i32 %3, 10
%5 = select i1 %4, i32 48, i32 55
%6 = add nuw nsw i32 %5, %3
%7 = tail call i32 @fputc(i32 %6, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned short *, unsigned char *, int);
unsigned short U2(unsigned char *p) {
  unsigned short u = 0;
  memcpy(&u, p, 2);
  return u;
}


x86 assembly (clang, -O0):
<U2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movw   $0x0,-0xa(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xa(%rbp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U2>:
push   %rax
mov    %rdi,%rsi
movw   $0x0,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <memcpy@plt>
movzwl 0x6(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @U2(i8* %0) {
%2 = alloca i8*
%3 = alloca i16
store i8* %0, i8** %2
store i16 0, i16* %3
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i16* %3, i8* %4, i32 2)
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @U2(i8* %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
store i16 0, i16* %2
%4 = call i32 @memcpy(i16* %2, i8* %0, i32 2)
%5 = load i16, i16* %2
ret i16 %5
}
int rl_vi_eof_maybe(count, c)
int count __attribute__((unused)), c __attribute__((unused));
{ return (rl_newline(1, '\n')); }


x86 assembly (clang, -O0):
<rl_vi_eof_maybe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <rl_newline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_eof_maybe>:
mov    $0x1,%edi
mov    $0xa,%esi
xor    %eax,%eax
jmp    1030 <rl_newline@plt>

LLVM IR (-O0):
define i32 @rl_vi_eof_maybe(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_newline to i32 (i32, i32, ...)*)(i32 1, i32 10)
ret i32 %5
}

LLVM IR (-O2):
define i32 @rl_vi_eof_maybe(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_newline to i32 (i32, i32, ...)*)(i32 1, i32 10)
ret i32 %3
}
int test_imm_96uint16_mem(unsigned short *val) {
  return ((*val) & (0x96 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_96uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 150
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char tolower(char);
char *strlower(char *str) {
  char *ss;
  if (str) {
    for (ss = str; *ss; ++ss)
      *ss = tolower(*ss);
  }
  return str;
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <strlower+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <strlower+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <strlower+0x1f>
jmp    1166 <strlower+0x56>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <strlower+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <strlower+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlower(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %11, %6 ], [ %4, %3 ]
%8 = phi i8* [ %10, %6 ], [ %0, %3 ]
%9 = tail call signext i8 @tolower(i8 signext %7)
store i8 %9, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
ret i8* %0
}
int uint32_to_uint8(unsigned int x) {
  unsigned char y = x;
  int z = y;
  return z;
}


x86 assembly (clang, -O0):
<uint32_to_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32_to_uint8>:
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @uint32_to_uint8(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @uint32_to_uint8(i32 %0) {
%2 = and i32 %0, 255
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ DymosimMessageDoubleSev(int /*<<< orphan*/, char const *,
                                           double);
void DymosimMessageDouble(const char *message, double d) {
  DymosimMessageDoubleSev(0, message, d);
}


x86 assembly (clang, -O0):
<DymosimMessageDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
movsd  -0x10(%rbp),%xmm0
xor    %edi,%edi
call   1030 <DymosimMessageDoubleSev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DymosimMessageDouble>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <DymosimMessageDoubleSev@plt>

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

LLVM IR (-O2):
define void @DymosimMessageDouble(i8* %0, double %1) {
%3 = tail call i32 @DymosimMessageDoubleSev(i32 0, i8* %0, double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void test20_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @test20_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned long toi_get_nonconflicting_page(void) { return 0; }


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

x86 assembly (clang, -O2):
<toi_get_nonconflicting_page>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @toi_get_nonconflicting_page() {
ret i64 0
}

LLVM IR (-O2):
define i64 @toi_get_nonconflicting_page() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ Cyc_Port_var();
void *Cyc_Port_new_var(void *x) {
  return ({ Cyc_Port_var(); });
}


x86 assembly (clang, -O0):
<Cyc_Port_new_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Cyc_Port_var@plt>
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @Cyc_Port_new_var(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @Cyc_Port_var()
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @Cyc_Port_new_var(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @Cyc_Port_var()
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ htonb4(scalar_t__, int /*<<< orphan*/ *);
uint32_t htonl(uint32_t host) {
  uint32_t result = 0;
  htonb4(host, (uint8_t *)&result);
  return result;
}


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

x86 assembly (clang, -O2):
<htonl>:
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <htonb4@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @htonl(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = bitcast i64* %3 to i32*
%6 = call i32 @htonb4(i64 %4, i32* %5)
%7 = load i64, i64* %3
ret i64 %7
}

LLVM IR (-O2):
define i64 @htonl(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = bitcast i64* %2 to i32*
%5 = call i32 @htonb4(i64 %0, i32* %4)
%6 = load i64, i64* %2
ret i64 %6
}
unsigned load1(void) { return 17; }


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

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

LLVM IR (-O0):
define i32 @load1() {
ret i32 17
}

LLVM IR (-O2):
define i32 @load1() {
ret i32 17
}
int jumpNumber(char *line, int iter) {
  while (*(line + iter) > 47 && *(line + iter) < 58) {
    ++iter;
  }
  return iter;
}


x86 assembly (clang, -O0):
<jumpNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0xd(%rbp)
jle    113a <jumpNumber+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <jumpNumber+0x4a>
jmp    1158 <jumpNumber+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <jumpNumber+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jumpNumber>:
movslq %esi,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%ecx
add    $0xd0,%cl
add    $0x1,%eax
add    $0x1,%rdi
cmp    $0xa,%cl
jb     1110 <jumpNumber+0x10>
ret

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

LLVM IR (-O2):
define i32 @jumpNumber(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %10, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = add i8 %7, -48
%9 = icmp ult i8 %8, 10
%10 = add i64 %5, 1
br i1 %9, label %4, label %11
11: ; preds = %4
%12 = trunc i64 %5 to i32
ret i32 %12
}
void olpc_capture_close(struct snd_ac97 *ac97) {}


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

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

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

LLVM IR (-O2):
%struct.snd_ac97 = type opaque
define void @olpc_capture_close(%struct.snd_ac97* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, size_t);
void *malloc(size_t);
void *emalloc(size_t n) {
  void *m = malloc(n);
  if (!m)
    die("emalloc(%z):", n);
  return m;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <emalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <emalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"emalloc(%z):\00"
define i8* @emalloc(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 %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"emalloc(%z):\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Initialize_Data();
int /*<<< orphan*/ Main_Menu();
int /*<<< orphan*/ input_pause();
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ welcome_message();
int Initialize_App() {
  welcome_message();
  input_pause();
  puts("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  Initialize_Data();
  input_pause();
  Main_Menu();
  return 1;
}


x86 assembly (clang, -O0):
<Initialize_App>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <welcome_message@plt>
mov    $0x0,%al
call   1070 <input_pause@plt>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <Initialize_Data@plt>
mov    $0x0,%al
call   1070 <input_pause@plt>
mov    $0x0,%al
call   1050 <Main_Menu@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Initialize_App>:
push   %rax
xor    %eax,%eax
call   1060 <welcome_message@plt>
xor    %eax,%eax
call   1070 <input_pause@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <Initialize_Data@plt>
xor    %eax,%eax
call   1070 <input_pause@plt>
xor    %eax,%eax
call   1050 <Main_Menu@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define i32 @Initialize_App() {
%1 = call i32 (...) @welcome_message()
%2 = call i32 (...) @input_pause()
%3 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @Initialize_Data()
%5 = call i32 (...) @input_pause()
%6 = call i32 (...) @Main_Menu()
ret i32 1
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\0A\00"
define i32 @Initialize_App() {
%1 = tail call i32 (...) @welcome_message()
%2 = tail call i32 (...) @input_pause()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @Initialize_Data()
%5 = tail call i32 (...) @input_pause()
%6 = tail call i32 (...) @Main_Menu()
ret i32 1
}
int myMax(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<myMax>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <myMax+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <myMax+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myMax>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @myMax(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 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @myMax(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int test_imm_3Eint8_reg(signed char val) {
  return ((val) & (0x3E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_3Eint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x3e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_3Eint8_reg(i8 signext %0) {
%2 = and i8 %0, 62
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void set_pin_as_output(void) {
  unsigned tmp;
  tmp = (*(volatile unsigned long *)0xE0200C20);
  tmp = (tmp & ~(0XF << 8)) | (1 << 8);
  (*(volatile unsigned long *)0xE0200C20) = tmp;
}


x86 assembly (clang, -O0):
<set_pin_as_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200c20,%eax
mov    (%rax),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffff0ff,%eax
or     $0x100,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    $0xe0200c20,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pin_as_output>:
mov    $0xe0200c20,%eax
mov    (%rax),%rcx
and    $0xfffff0ff,%ecx
or     $0x100,%rcx
mov    %rcx,(%rax)
ret

LLVM IR (-O0):
define void @set_pin_as_output() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 3760196640 to i64*)
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = and i32 %4, -3841
%6 = or i32 %5, 256
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = zext i32 %7 to i64
store volatile i64 %8, i64* inttoptr (i64 3760196640 to i64*)
ret void
}

LLVM IR (-O2):
define void @set_pin_as_output() {
%1 = load volatile i64, i64* inttoptr (i64 3760196640 to i64*)
%2 = and i64 %1, 4294963455
%3 = or i64 %2, 256
store volatile i64 %3, i64* inttoptr (i64 3760196640 to i64*)
ret void
}
void close_ltcjack(void) { ; }


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

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

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

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