xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ tx_writes(unsigned long);
int tx_writel(unsigned long val) {
  return (tx_writes(val & 0xFFFF) == 0 && tx_writes(val >> 16) == 0) ? 0 : -7;
}


x86 assembly (clang, -O0):
<tx_writel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
and    $0xffff,%rdi
call   1030 <tx_writes@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1155 <tx_writel+0x45>
mov    -0x8(%rbp),%rdi
shr    $0x10,%rdi
call   1030 <tx_writes@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0xfffffff9,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx_writel>:
push   %rbx
mov    %rdi,%rbx
movzwl %bx,%edi
call   1030 <tx_writes@plt>
mov    %rax,%rcx
mov    $0xfffffff9,%eax
test   %rcx,%rcx
je     112b <tx_writel+0x1b>
pop    %rbx
ret
shr    $0x10,%rbx
mov    %rbx,%rdi
call   1030 <tx_writes@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0xfffffff9,%eax
cmove  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tx_writel(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 65535
%5 = call i64 @tx_writes(i64 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i64, i64* %2
%9 = lshr i64 %8, 16
%10 = call i64 @tx_writes(i64 %9)
%11 = icmp eq i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 0, i32 -7
ret i32 %15
}

LLVM IR (-O2):
define i32 @tx_writel(i64 %0) {
%2 = and i64 %0, 65535
%3 = tail call i64 @tx_writes(i64 %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = lshr i64 %0, 16
%7 = tail call i64 @tx_writes(i64 %6)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i32 0, i32 -7
br label %10
10: ; preds = %5, %1
%11 = phi i32 [ -7, %1 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testA(float a, float b, float c) { printf("testA float\n"); }


x86 assembly (clang, -O0):
<testA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"testA float\0A\00"
define void @testA(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"testA float\00"
define void @testA(float %0, float %1, float %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int SDL_imageFilterShiftLeftMMX(unsigned char *Src1, unsigned char *Dest,
                                unsigned int SrcLength, unsigned char N) {
  return (-1);
}


x86 assembly (clang, -O0):
<SDL_imageFilterShiftLeftMMX>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %al,-0x15(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SDL_imageFilterShiftLeftMMX(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8 zeroext %3) {
ret i32 -1
}
int setrgid(rgid)
int rgid;
{ return (setregid(rgid, -1)); }


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

x86 assembly (clang, -O2):
<setrgid>:
mov    $0xffffffff,%esi
xor    %eax,%eax
jmp    1030 <setregid@plt>

LLVM IR (-O0):
define i32 @setrgid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @setregid to i32 (i32, i32, ...)*)(i32 %3, i32 -1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @setrgid(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @setregid to i32 (i32, i32, ...)*)(i32 %0, i32 -1)
ret i32 %2
}
void destroyTokenList(char **tokenList) {
  int i;
  for (i = 0; tokenList[i]; i++)
    free(tokenList[i]);
  tokenList[0] = 0;
  free(tokenList);
}


x86 assembly (clang, -O0):
<destroyTokenList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <destroyTokenList+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <destroyTokenList+0x13>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroyTokenList>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <destroyTokenList+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <destroyTokenList+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroyTokenList(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ bcm2835_write(int, int);
int /*<<< orphan*/ console_insert_char(int);
int mini_uart_getc_noblock();
int32_t mini_uart_interrupt_handler(void) {
  uint32_t ascii;
  while (1) {
    ascii = mini_uart_getc_noblock();
    if (ascii == -1)
      break;
    console_insert_char(ascii);
  }
  bcm2835_write((0 + 0x201000 + 0x44), (1 << 6));
  return 0;
}


x86 assembly (clang, -O0):
<mini_uart_interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <mini_uart_getc_noblock@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1151 <mini_uart_interrupt_handler+0x21>
jmp    115e <mini_uart_interrupt_handler+0x2e>
mov    -0x4(%rbp),%edi
call   1030 <console_insert_char@plt>
jmp    1138 <mini_uart_interrupt_handler+0x8>
mov    $0x201044,%edi
mov    $0x40,%esi
call   1040 <bcm2835_write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mini_uart_interrupt_handler>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <mini_uart_getc_noblock@plt>
cmp    $0xffffffff,%eax
je     1155 <mini_uart_interrupt_handler+0x25>
mov    %eax,%edi
call   1030 <console_insert_char@plt>
jmp    1140 <mini_uart_interrupt_handler+0x10>
mov    $0x201044,%edi
mov    $0x40,%esi
call   1040 <bcm2835_write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mini_uart_interrupt_handler() {
%1 = alloca i32
br label %2
2: ; preds = %0, %7
%3 = call i32 (...) @mini_uart_getc_noblock()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %2
br label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @console_insert_char(i32 %8)
br label %2
10: ; preds = %6
%11 = call i32 @bcm2835_write(i32 2101316, i32 64)
ret i32 0
}

LLVM IR (-O2):
define i32 @mini_uart_interrupt_handler() {
%1 = tail call i32 (...) @mini_uart_getc_noblock()
%2 = icmp eq i32 %1, -1
br i1 %2, label %8, label %3
3: ; preds = %0, %3
%4 = phi i32 [ %6, %3 ], [ %1, %0 ]
%5 = tail call i32 @console_insert_char(i32 %4)
%6 = tail call i32 (...) @mini_uart_getc_noblock()
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %3
8: ; preds = %3, %0
%9 = tail call i32 @bcm2835_write(i32 2101316, i32 64)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void batadc_resetrelease() {
  mbus_remote_register_write(0x6, 0x3B,
                             ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) |
                              (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7) |
                              (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) |
                              (0 << 12) | (1 << 13) | (1 << 14) | (1 << 15) |
                              (1 << 16) | (1 << 17) | (1 << 18) | (1 << 19)));
  delay(100);
}


x86 assembly (clang, -O0):
<batadc_resetrelease>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0xfefff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<batadc_resetrelease>:
push   %rax
mov    $0x6,%edi
mov    $0x3b,%esi
mov    $0xfefff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @batadc_resetrelease() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 59, i32 1044479)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @batadc_resetrelease() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 59, i32 1044479)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ usage(char *);
void errorString(char *format, char *var) {
  char errorMsg[1000];
  sprintf(errorMsg, format, var);
  usage(errorMsg);
}


x86 assembly (clang, -O0):
<errorString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <sprintf@plt>
lea    -0x400(%rbp),%rdi
call   1030 <usage@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorString>:
push   %rbx
sub    $0x3f0,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <usage@plt>
add    $0x3f0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @errorString(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [1000 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @sprintf(i8* %6, i8* %7, i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%11 = call i32 @usage(i8* %10)
ret void
}

LLVM IR (-O2):
define void @errorString(i8* nocapture %0, i8* %1) {
%3 = alloca [1000 x i8]
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %0, i8* %1)
%6 = call i32 @usage(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, int, char const *, int /*<<< orphan*/);
signed int vsprintf(char *pString, const char *pFormat, va_list ap) {
  return (vsnprintf(pString, 128, pFormat, ap));
}


x86 assembly (clang, -O0):
<vsprintf>:
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),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x80,%esi
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    $0x80,%esi
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @vsnprintf(i8* %0, i32 128, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destroy_keepalive(void *msg) { free(msg); }


x86 assembly (clang, -O0):
<destroy_keepalive>:
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):
<destroy_keepalive>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @destroy_keepalive(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 @destroy_keepalive(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int inpd(int);
int /*<<< orphan*/ outpd(int, int);
void ahci_ctrl_clear_bits(uint16_t iobase, uint16_t reg, uint32_t mask) {
  outpd(iobase + 0, reg);
  outpd(iobase + 4, inpd(iobase + 4) & ~mask);
}


x86 assembly (clang, -O0):
<ahci_ctrl_clear_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0x0,%edi
mov    -0x8(%rbp),%esi
call   1030 <outpd@plt>
mov    -0x4(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
add    $0x4,%edi
call   1040 <inpd@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <outpd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ahci_ctrl_clear_bits>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
call   1030 <outpd@plt>
add    $0x4,%ebp
mov    %ebp,%edi
call   1040 <inpd@plt>
not    %ebx
and    %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outpd@plt>

LLVM IR (-O0):
define void @ahci_ctrl_clear_bits(i32 %0, i32 %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 = add nsw i32 %7, 0
%9 = load i32, i32* %5
%10 = call i32 @outpd(i32 %8, i32 %9)
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 4
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 4
%15 = call i32 @inpd(i32 %14)
%16 = load i32, i32* %6
%17 = xor i32 %16, -1
%18 = and i32 %15, %17
%19 = call i32 @outpd(i32 %12, i32 %18)
ret void
}

LLVM IR (-O2):
define void @ahci_ctrl_clear_bits(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @outpd(i32 %0, i32 %1)
%5 = add nsw i32 %0, 4
%6 = tail call i32 @inpd(i32 %5)
%7 = xor i32 %2, -1
%8 = and i32 %6, %7
%9 = tail call i32 @outpd(i32 %5, i32 %8)
ret void
}
char intlog10(long long n) {
  char val = 0;
  while (n > 9) {
    n /= 10;
    val++;
  }
  return val;
}


x86 assembly (clang, -O0):
<intlog10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
cmpq   $0x9,-0x8(%rbp)
jle    1136 <intlog10+0x36>
mov    -0x8(%rbp),%rax
mov    $0xa,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    110c <intlog10+0xc>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlog10>:
xor    %ecx,%ecx
cmp    $0xa,%rdi
jl     1136 <intlog10+0x36>
movabs $0xcccccccccccccccd,%rsi
cc cc cc
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rdi,%rax
mul    %rsi
shr    $0x3,%rdx
add    $0x1,%cl
cmp    $0x63,%rdi
mov    %rdx,%rdi
ja     1120 <intlog10+0x20>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @intlog10(i64 %0) {
%2 = alloca i64
%3 = alloca i8
store i64 %0, i64* %2
store i8 0, i8* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp sgt i64 %5, 9
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %2
%9 = sdiv i64 %8, 10
store i64 %9, i64* %2
%10 = load i8, i8* %3
%11 = add i8 %10, 1
store i8 %11, i8* %3
br label %4
12: ; preds = %4
%13 = load i8, i8* %3
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @intlog10(i64 %0) {
%2 = icmp sgt i64 %0, 9
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i8 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = udiv i64 %5, 10
%7 = add i8 %4, 1
%8 = icmp ugt i64 %5, 99
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i8 [ 0, %1 ], [ %7, %3 ]
ret i8 %10
}
void gtk_vpaned_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vpaned_get_type() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getgid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("uid: %d, gid: %d\n", getuid(), getgid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getgid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <getgid@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"uid: %d, gid: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @getgid()
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [18 x i8] c"uid: %d, gid: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @getgid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int cmp(const void *a, const void *b) { return *(int *)a < *(int *)b ? 0 : 1; }


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setge  %al
ret

LLVM IR (-O0):
define i32 @cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp slt i32 %7, %10
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 0, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sge i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
char *getDay() {}


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

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

LLVM IR (-O0):
define i8* @getDay() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @getDay() {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
void deletePid(char *file) { remove(file); }


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

x86 assembly (clang, -O2):
<deletePid>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define void @deletePid(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: alist-to-pchk [ -t ] alist-file pchk-file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: alist-to-pchk [ -t ] alist-file pchk-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"Usage: alist-to-pchk [ -t ] alist-file pchk-file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct typeExp {
  int dummy;
};

/* Variables and functions */
struct typeExp *CreateType(int, char *, struct typeExp *, struct typeExp *);
struct typeExp *SuccType(void) {
  return (CreateType(4, "", CreateType(2, "", 0, 0), CreateType(2, "", 0, 0)));
}


x86 assembly (clang, -O0):
<SuccType>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <CreateType@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2,%edi
lea    0xec0(%rip),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <CreateType@plt>
mov    -0x8(%rbp),%rdx
mov    %rax,%rcx
mov    $0x4,%edi
lea    0xea1(%rip),%rsi
call   1030 <CreateType@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SuccType>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
mov    $0x2,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <CreateType@plt>
mov    %rax,%rbx
mov    $0x2,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <CreateType@plt>
mov    $0x4,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <CreateType@plt>

LLVM IR (-O0):
%struct.typeExp = type { i32 }
@.str = [1 x i8] zeroinitializer
define %struct.typeExp* @SuccType() {
%1 = call %struct.typeExp* @CreateType(i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.typeExp* null, %struct.typeExp* null)
%2 = call %struct.typeExp* @CreateType(i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.typeExp* null, %struct.typeExp* null)
%3 = call %struct.typeExp* @CreateType(i32 4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.typeExp* %1, %struct.typeExp* %2)
ret %struct.typeExp* %3
}

LLVM IR (-O2):
%struct.typeExp = type { i32 }
@.str = [1 x i8] zeroinitializer
define %struct.typeExp* @SuccType() {
%1 = tail call %struct.typeExp* @CreateType(i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.typeExp* null, %struct.typeExp* null)
%2 = tail call %struct.typeExp* @CreateType(i32 2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.typeExp* null, %struct.typeExp* null)
%3 = tail call %struct.typeExp* @CreateType(i32 4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %struct.typeExp* %1, %struct.typeExp* %2)
ret %struct.typeExp* %3
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t a52_get_fscod(const uint8_t *p_a52) { return (p_a52[4] & 0xc0) >> 6; }


x86 assembly (clang, -O0):
<a52_get_fscod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0xc0,%eax
sar    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_get_fscod>:
mov    0x10(%rdi),%eax
shr    $0x6,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @a52_get_fscod(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = and i32 %5, 192
%7 = ashr i32 %6, 6
ret i32 %7
}

LLVM IR (-O2):
define i32 @a52_get_fscod(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
%4 = lshr i32 %3, 6
%5 = and i32 %4, 3
ret i32 %5
}
int test_imm_0Bint64_lowword_mem(long long *val) {
  return ((*val) & (0x0B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Bint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ft_nbrchar(char const *str, char c) {
  int i;
  i = 0;
  while (*str) {
    if (*str == c)
      ++i;
    ++str;
  }
  return (i);
}


x86 assembly (clang, -O0):
<ft_nbrchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <ft_nbrchar+0x4f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    113e <ft_nbrchar+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <ft_nbrchar+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrchar>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <ft_nbrchar+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ft_nbrchar+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_nbrchar(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ rot13(char *);
scalar_t__ scanf(char *, char *);
void encryption(char enc[1000]) {
  while (scanf("%1000s", enc)) {
    rot13(enc);
  }
}


x86 assembly (clang, -O0):
<encryption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x0,%rax
je     1154 <encryption+0x34>
mov    -0x8(%rbp),%rdi
call   1030 <rot13@plt>
jmp    112c <encryption+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encryption>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     1168 <encryption+0x48>
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <rot13@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
jne    1150 <encryption+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%1000s\00"
define void @encryption(i8* %0) {
%2 = tail call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 @rot13(i8* %0)
%6 = tail call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret void
}
int test_imm_7Cint64_highword_reg(long long val) {
  return ((val >> 32) & (0x7C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Cint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0x7c,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_7Cint64_highword_reg>:
movabs $0x7c00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Cint64_highword_reg(i64 %0) {
%2 = and i64 %0, 532575944704
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int sqrtn(int);
int main() {
  int d;
  scanf("%d", &d);
  printf("%d", sqrtn(d));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1040 <sqrtn@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @sqrtn(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *substring(char **, int /*<<< orphan*/, int);
int main() {
  char *str = "Escuela Superior de Computo";
  char **addr = &str;
  printf("%s\n", substring(addr, 0, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <substring@plt>
mov    %rax,%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <substring@plt>
lea    0xeda(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Escuela Superior de Computo\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8**
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %1
store i8** %1, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i8* @substring(i8** %3, i32 0, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Escuela Superior de Computo\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = call i8* @substring(i8** %1, i32 0, i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ frep(int, int *);
main() {
  int param[1000];
  frep(4, param);
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0xfa8,%rsp
mov    %rsp,%rsi
mov    $0x4,%edi
call   1030 <frep@plt>
xor    %eax,%eax
add    $0xfa8,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [1000 x i32]
%2 = getelementptr inbounds [1000 x i32], [1000 x i32]* %1, i64 0, i64 0
%3 = call i32 @frep(i32 4, i32* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1000 x i32]
%2 = bitcast [1000 x i32]* %1 to i8*
%3 = getelementptr inbounds [1000 x i32], [1000 x i32]* %1, i64 0, i64 0
%4 = call i32 @frep(i32 4, i32* %3)
ret i32 0
}
/* Variables and functions */
char *strlib_tok_r(char *, char const *, char **);
char *strlib_tok(char *s, const char *sep) {
  static char *lasts;
  return (strlib_tok_r(s, sep, &lasts));
}


x86 assembly (clang, -O0):
<strlib_tok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    0x2f01(%rip),%rdx
call   1030 <strlib_tok_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlib_tok>:
lea    0x2f19(%rip),%rdx
jmp    1030 <strlib_tok_r@plt>

LLVM IR (-O0):
@strlib_tok.lasts = internal global i8* null
define i8* @strlib_tok(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @strlib_tok_r(i8* %5, i8* %6, i8** @strlib_tok.lasts)
ret i8* %7
}

LLVM IR (-O2):
@strlib_tok.lasts = internal global i8* null
define i8* @strlib_tok(i8* %0, i8* %1) {
%3 = tail call i8* @strlib_tok_r(i8* %0, i8* %1, i8** @strlib_tok.lasts)
ret i8* %3
}
void armv7_cortex_r4_invalidate_data_cache(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @LPS25HB_IO_ITConfig() {
ret void
}
int STR2() { return 0; }


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

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

LLVM IR (-O0):
define i32 @STR2() {
ret i32 0
}

LLVM IR (-O2):
define i32 @STR2() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t getPumaBitmaskArraySize(const size_t numElements) {
  return ((numElements + 63) / 64) * sizeof(uint64_t);
}


x86 assembly (clang, -O0):
<getPumaBitmaskArraySize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3f,%rax
shr    $0x6,%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPumaBitmaskArraySize>:
lea    0x3f(%rdi),%rax
shr    $0x4,%rax
and    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @getPumaBitmaskArraySize(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 63
%5 = udiv i64 %4, 64
%6 = mul i64 %5, 4
ret i64 %6
}

LLVM IR (-O2):
define i64 @getPumaBitmaskArraySize(i64 %0) {
%2 = add i64 %0, 63
%3 = lshr i64 %2, 4
%4 = and i64 %3, 1152921504606846972
ret i64 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t __hash_function_int(uint32_t key) {
  uint32_t c2 = 0x27d4eb2d;
  key = (key ^ 61) ^ (key >> 16);
  key = key + (key << 3);
  key = key ^ (key >> 4);
  key = key * c2;
  key = key ^ (key >> 15);
  return key;
}


x86 assembly (clang, -O0):
<__hash_function_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x27d4eb2d,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x3d,%eax
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x4,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0xf,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hash_function_int>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
xor    $0x3d,%eax
lea    (%rax,%rax,8),%eax
mov    %eax,%ecx
sar    $0x4,%ecx
xor    %eax,%ecx
imul   $0x27d4eb2d,%ecx,%ecx
mov    %ecx,%eax
sar    $0xf,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__hash_function_int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 668265261, i32* %3
%4 = load i32, i32* %2
%5 = xor i32 %4, 61
%6 = load i32, i32* %2
%7 = ashr i32 %6, 16
%8 = xor i32 %5, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 3
%12 = add nsw i32 %9, %11
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = load i32, i32* %2
%15 = ashr i32 %14, 4
%16 = xor i32 %13, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = mul nsw i32 %17, %18
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 15
%23 = xor i32 %20, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @__hash_function_int(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = xor i32 %3, 61
%5 = mul i32 %4, 9
%6 = ashr i32 %5, 4
%7 = xor i32 %6, %5
%8 = mul nsw i32 %7, 668265261
%9 = ashr i32 %8, 15
%10 = xor i32 %9, %8
ret i32 %10
}
int move_relative_position(int motor, int speed, long delta_pos) {}


x86 assembly (clang, -O0):
<move_relative_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @move_relative_position(i32 %0, i32 %1, i64 %2) {
ret i32 undef
}
/* Variables and functions */
float add(int, int);
float div(int, int);
float mul(int, int);
float sub(int, int);
int main() {
  float x = add(2, 3);
  float y = sub(4, 3);
  float z = mul(3, 10);
  float v = div(6, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x4,%edi
mov    $0x3,%esi
call   1060 <sub@plt>
movss  %xmm0,-0xc(%rbp)
mov    $0x3,%edi
mov    $0xa,%esi
call   1050 <mul@plt>
movss  %xmm0,-0x10(%rbp)
mov    $0x6,%edi
mov    $0x2,%esi
call   1040 <div@plt>
movss  %xmm0,-0x14(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <add@plt>
mov    $0x4,%edi
mov    $0x3,%esi
call   1060 <sub@plt>
mov    $0x3,%edi
mov    $0xa,%esi
call   1050 <mul@plt>
mov    $0x6,%edi
mov    $0x2,%esi
call   1040 <div@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call float @add(i32 2, i32 3)
store float %6, float* %2
%7 = call float @sub(i32 4, i32 3)
store float %7, float* %3
%8 = call float @mul(i32 3, i32 10)
store float %8, float* %4
%9 = call float @div(i32 6, i32 2)
store float %9, float* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call float @add(i32 2, i32 3)
%2 = tail call float @sub(i32 4, i32 3)
%3 = tail call float @mul(i32 3, i32 10)
%4 = tail call float @div(i32 6, i32 2)
ret i32 0
}
void textcolor(int attr, int fg, int bg) {}


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

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

LLVM IR (-O0):
define void @textcolor(i32 %0, i32 %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
ret void
}

LLVM IR (-O2):
define void @textcolor(i32 %0, i32 %1, i32 %2) {
ret void
}
int *f(int **p) {
  int *ptrarray[10];
  return *p;
}


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

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

LLVM IR (-O0):
define i32* @f(i32** %0) {
%2 = alloca i32**
%3 = alloca [10 x i32*]
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = load i32*, i32** %4
ret i32* %5
}

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char const *, int);
uint64_t read_uint6(const char *buf) {
  uint64_t tmp = 0;
  memcpy(&tmp, buf, 6);
  return tmp;
}


x86 assembly (clang, -O0):
<read_uint6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x6,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @read_uint6(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 6)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ info(char *, char const *);
void run_test(const char *test_desc, void (*test_func)(void)) {
  info("Running %s", test_desc);
  test_func();
}


x86 assembly (clang, -O0):
<run_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
call   1030 <info@plt>
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_test>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <info@plt>
mov    %rbx,%rax
pop    %rbx
jmp    *%rax

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

LLVM IR (-O2):
@.str = [11 x i8] c"Running %s\00"
define void @run_test(i8* %0, void ()* nocapture %1) {
%3 = tail call i32 @info(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
tail call void %1()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_write_bit(int /*<<< orphan*/, char);
void vdd(char value) { gpio_write_bit(0, value); }


x86 assembly (clang, -O0):
<vdd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gpio_write_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vdd>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <gpio_write_bit@plt>

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

LLVM IR (-O2):
define void @vdd(i8 signext %0) {
%2 = tail call i32 @gpio_write_bit(i32 0, i8 signext %0)
ret void
}