xunge/DecIR huggingface dataset:
void mtrunc(a) register char *a;
{
  register int k;
  for (k = strlen(a) - 1; k >= 0; --k)
    if (a[k] == ',') {
      a[k] = '\0';
      break;
    }
}


x86 assembly (clang, -O0):
<mtrunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     116f <mtrunc+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    115c <mtrunc+0x4c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    116f <mtrunc+0x5f>
jmp    1161 <mtrunc+0x51>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <mtrunc+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtrunc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
nopl   0x0(%rax)
add    $0xffffffff,%eax
js     1131 <mtrunc+0x21>
mov    %eax,%ecx
cmpb   $0x2c,(%rbx,%rcx,1)
jne    1120 <mtrunc+0x10>
movb   $0x0,(%rbx,%rcx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @mtrunc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = sub i64 %5, 1
%7 = trunc i64 %6 to i32
store i32 %7, i32* %3
br label %8
8: ; preds = %25, %1
%9 = load i32, i32* %3
%10 = icmp sge i32 %9, 0
br i1 %10, label %11, label %28
11: ; preds = %8
%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
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 44
br i1 %18, label %19, label %24
19: ; preds = %11
%20 = load i8*, i8** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 0, i8* %23
br label %28
24: ; preds = %11
br label %25
25: ; preds = %24
%26 = load i32, i32* %3
%27 = add nsw i32 %26, -1
store i32 %27, i32* %3
br label %8
28: ; preds = %19, %8
ret void
}

LLVM IR (-O2):
define void @mtrunc(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
br label %4
4: ; preds = %8, %1
%5 = phi i32 [ %3, %1 ], [ %6, %8 ]
%6 = add i32 %5, -1
%7 = icmp sgt i32 %6, -1
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = zext i32 %6 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 44
br i1 %12, label %13, label %4
13: ; preds = %8
%14 = zext i32 %6 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %4, %13
ret void
}
int test_imm_EAint16_reg(short val) {
  return ((val) & (0xEA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EAint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xea,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_EAint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 234
%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_EAint16_reg(i16 signext %0) {
%2 = and i16 %0, 234
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ EWOULDBLOCK;
int LOCK_NB;
int LOCK_SH;
scalar_t__ errno;
int flock(int, int);
int has_flock(int fd) {
  return flock(fd, LOCK_SH | LOCK_NB) == -1 && errno == EWOULDBLOCK;
}


x86 assembly (clang, -O0):
<has_flock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2e92(%rip),%rax
or     (%rax),%esi
call   1030 <flock@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x5(%rbp)
jne    115f <has_flock+0x4f>
mov    0x2e8c(%rip),%rax
mov    (%rax),%rax
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_flock>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    0x2ea1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1030 <flock@plt>
cmp    $0xffffffff,%eax
sete   %al
mov    0x2ea3(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e91(%rip),%rdx
cmp    (%rdx),%rcx
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LOCK_SH = global i32 0
@LOCK_NB = global i32 0
@errno = global i64 0
@EWOULDBLOCK = global i64 0
define i32 @has_flock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @LOCK_SH
%5 = load i32, i32* @LOCK_NB
%6 = or i32 %4, %5
%7 = call i32 @flock(i32 %3, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @EWOULDBLOCK
%12 = icmp eq i64 %10, %11
br label %13
13: ; preds = %9, %1
%14 = phi i1 [ false, %1 ], [ %12, %9 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@LOCK_SH = global i32 0
@LOCK_NB = global i32 0
@errno = global i64 0
@EWOULDBLOCK = global i64 0
define i32 @has_flock(i32 %0) {
%2 = load i32, i32* @LOCK_SH
%3 = load i32, i32* @LOCK_NB
%4 = or i32 %3, %2
%5 = tail call i32 @flock(i32 %0, i32 %4)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EWOULDBLOCK
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg8(int);
unsigned long VIM_MARB_GetThumbbufStartAddr(void) {
  unsigned long Temp = 0;
  Temp = (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x00C)));
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x00B))) << 8;
  Temp |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x00A))) << 16;
  return Temp;
}


x86 assembly (clang, -O0):
<VIM_MARB_GetThumbbufStartAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x240c,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,-0x8(%rbp)
mov    $0x240b,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x240a,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_MARB_GetThumbbufStartAddr>:
push   %r14
push   %rbx
push   %rax
mov    $0x240c,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%r14
mov    $0x240b,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,%rbx
shl    $0x8,%rbx
or     %r14,%rbx
mov    $0x240a,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @VIM_MARB_GetThumbbufStartAddr() {
%1 = alloca i64
store i64 0, i64* %1
%2 = call i64 @VIM_HIF_GetReg8(i32 9228)
store i64 %2, i64* %1
%3 = call i64 @VIM_HIF_GetReg8(i32 9227)
%4 = shl i64 %3, 8
%5 = load i64, i64* %1
%6 = or i64 %5, %4
store i64 %6, i64* %1
%7 = call i64 @VIM_HIF_GetReg8(i32 9226)
%8 = shl i64 %7, 16
%9 = load i64, i64* %1
%10 = or i64 %9, %8
store i64 %10, i64* %1
%11 = load i64, i64* %1
ret i64 %11
}

LLVM IR (-O2):
define i64 @VIM_MARB_GetThumbbufStartAddr() {
%1 = tail call i64 @VIM_HIF_GetReg8(i32 9228)
%2 = tail call i64 @VIM_HIF_GetReg8(i32 9227)
%3 = shl i64 %2, 8
%4 = or i64 %3, %1
%5 = tail call i64 @VIM_HIF_GetReg8(i32 9226)
%6 = shl i64 %5, 16
%7 = or i64 %4, %6
ret i64 %7
}
void sos_uart_printf(char *string) {
  static char *std_out_map = (char *)0x84000000 + 0x0004;
  while (*string != '\0') {
    *std_out_map = *string;
    string++;
  }
}


x86 assembly (clang, -O0):
<sos_uart_printf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <sos_uart_printf+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    0x2efb(%rip),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <sos_uart_printf+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sos_uart_printf>:
mov    (%rdi),%al
test   %al,%al
je     111d <sos_uart_printf+0x1d>
add    $0x1,%rdi
mov    $0x84000004,%ecx
nop
mov    %al,(%rcx)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <sos_uart_printf+0x10>
ret

LLVM IR (-O0):
@sos_uart_printf.std_out_map = internal global i8* inttoptr (i64 2214592516 to i8*)
define void @sos_uart_printf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = load i8*, i8** @sos_uart_printf.std_out_map
store i8 %10, i8* %11
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %2
br label %3
14: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @sos_uart_printf(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
store i8 %5, i8* inttoptr (i64 2214592516 to i8*)
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned int f36(unsigned int);
unsigned int f37(unsigned int a) { return f36(f36(a)); }


x86 assembly (clang, -O0):
<f37>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f36@plt>
mov    %eax,%edi
call   1030 <f36@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f37>:
push   %rax
call   1030 <f36@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f36@plt>

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

LLVM IR (-O2):
define i32 @f37(i32 %0) {
%2 = tail call i32 @f36(i32 %0)
%3 = tail call i32 @f36(i32 %2)
ret i32 %3
}
/* Variables and functions */
int snprintf(char *, int, char *, char *);
int write(int, char *, int);
int pubsub_textline_publish(int fd, char *name) {
  int r;
  char buf[1024];
  r = snprintf(buf, 1024, "PUBLISH %s\r\n", name);
  return write(fd, buf, r);
}


x86 assembly (clang, -O0):
<pubsub_textline_publish>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x400,%esi
lea    0xeb7(%rip),%rdx
call   1040 <snprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x420(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pubsub_textline_publish>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rsi,%rcx
mov    %edi,%ebx
lea    0xeca(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
call   1040 <snprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"PUBLISH %s\0D\0A\00"
define i32 @pubsub_textline_publish(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [1024 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = call i32 @snprintf(i8* %7, i32 1024, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* %5
%13 = call i32 @write(i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [13 x i8] c"PUBLISH %s\0D\0A\00"
define i32 @pubsub_textline_publish(i32 %0, i8* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 1024, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i32 @write(i32 %0, i8* %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmpstringp(const void *p1, const void *p2) {
  const char *s1 = (const char *)p1;
  const char *s2 = (const char *)p2;
  return strcmp(s1, s2);
}


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

x86 assembly (clang, -O2):
<cmpstringp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cmpstringp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void fld_preg32_dword(int reg32) {
  put8(0xD9);
  put8(reg32);
}


x86 assembly (clang, -O0):
<fld_preg32_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fld_preg32_dword>:
push   %rbx
mov    %edi,%ebx
mov    $0xd9,%edi
call   1030 <put8@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @fld_preg32_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 217)
%4 = load i32, i32* %2
%5 = call i32 @put8(i32 %4)
ret void
}

LLVM IR (-O2):
define void @fld_preg32_dword(i32 %0) {
%2 = tail call i32 @put8(i32 217)
%3 = tail call i32 @put8(i32 %0)
ret void
}
double screen_x(double px, int width) { return (px + 0.5) * width; }


x86 assembly (clang, -O0):
<screen_x>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  0xeec(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<screen_x>:
addsd  0xef8(%rip),%xmm0
cvtsi2sd %edi,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @screen_x(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = fadd double %5, 5.000000e-01
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = fmul double %6, %8
ret double %9
}

LLVM IR (-O2):
define double @screen_x(double %0, i32 %1) {
%3 = fadd double %0, 5.000000e-01
%4 = sitofp i32 %1 to double
%5 = fmul double %3, %4
ret double %5
}
void main() {
  long a = 1;
  unsigned b = 1U;
  long c = 1L;
  unsigned long d = 1LU;
  unsigned long e = 1UL;
  long long f = 1LL;
  unsigned long long g = 1LLU;
  unsigned long long h = 1ULL;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
movq   $0x1,-0x30(%rbp)
movq   $0x1,-0x38(%rbp)
movq   $0x1,-0x40(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void msg_func() {
  char message[64];
  read(0, message, 256);
}


x86 assembly (clang, -O0):
<msg_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1030 <read@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_func>:
sub    $0x48,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x100,%edx
call   1030 <read@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @msg_func() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 256)
ret void
}

LLVM IR (-O2):
define void @msg_func() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 256)
ret void
}
/* Variables and functions */
int RetournerInformationConfig(char *, char *, char *);
int initConfig() {
  char resultat[512];
  int codeResultat;
  codeResultat =
      RetournerInformationConfig("NomServeur", "Interrupteur", resultat);
  codeResultat = RetournerInformationConfig("NombreBouton", "1", resultat);
}


x86 assembly (clang, -O0):
<initConfig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
lea    -0x210(%rbp),%rdx
lea    0xed7(%rip),%rdi
lea    0xedb(%rip),%rsi
call   1030 <RetournerInformationConfig@plt>
mov    %eax,-0x214(%rbp)
lea    -0x210(%rbp),%rdx
lea    0xecf(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <RetournerInformationConfig@plt>
mov    %eax,-0x214(%rbp)
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initConfig>:
push   %rbx
sub    $0x200,%rsp
lea    0xee1(%rip),%rdi
lea    0xee5(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1030 <RetournerInformationConfig@plt>
lea    0xee0(%rip),%rdi
lea    0xee6(%rip),%rsi
mov    %rbx,%rdx
call   1030 <RetournerInformationConfig@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"NomServeur\00"
@.str.1 = [13 x i8] c"Interrupteur\00"
@.str.2 = [13 x i8] c"NombreBouton\00"
@.str.3 = [2 x i8] c"1\00"
define i32 @initConfig() {
%1 = alloca i32
%2 = alloca [512 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%5 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %4)
store i32 %5, i32* %3
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%7 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"NomServeur\00"
@.str.1 = [13 x i8] c"Interrupteur\00"
@.str.2 = [13 x i8] c"NombreBouton\00"
@.str.3 = [2 x i8] c"1\00"
define i32 @initConfig() {
%1 = alloca [512 x i8]
%2 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%3 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @RetournerInformationConfig(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* %2)
ret i32 undef
}
void map_right(double x_in, double y_in, double *x_out, double *y_out,
               double *z_out) {
  *x_out = +1;
  *y_out = 1 - 2 * x_in;
  *z_out = 1 - 2 * y_in;
}


x86 assembly (clang, -O0):
<map_right>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xec5(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm1
addsd  %xmm1,%xmm1
movsd  0xea8(%rip),%xmm0
subsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_right>:
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rdi)
addsd  %xmm0,%xmm0
movsd  0xee7(%rip),%xmm2
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
movsd  %xmm3,(%rsi)
addsd  %xmm1,%xmm1
subsd  %xmm1,%xmm2
movsd  %xmm2,(%rdx)
ret

LLVM IR (-O0):
define void @map_right(double %0, double %1, double* %2, double* %3, double* %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
store double %0, double* %6
store double %1, double* %7
store double* %2, double** %8
store double* %3, double** %9
store double* %4, double** %10
%11 = load double*, double** %8
store double 1.000000e+00, double* %11
%12 = load double, double* %6
%13 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %12, double 1.000000e+00)
%14 = load double*, double** %9
store double %13, double* %14
%15 = load double, double* %7
%16 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %15, double 1.000000e+00)
%17 = load double*, double** %10
store double %16, double* %17
ret void
}

LLVM IR (-O2):
define void @map_right(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3, double* nocapture writeonly %4) {
store double 1.000000e+00, double* %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double 1.000000e+00)
store double %6, double* %3
%7 = tail call double @llvm.fmuladd.f64(double %1, double -2.000000e+00, double 1.000000e+00)
store double %7, double* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ L1C_CleanInvalidateCache(int);
void L1C_CleanDCacheAll(void) { L1C_CleanInvalidateCache(1); }


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

x86 assembly (clang, -O2):
<L1C_CleanDCacheAll>:
mov    $0x1,%edi
jmp    1030 <L1C_CleanInvalidateCache@plt>

LLVM IR (-O0):
define void @L1C_CleanDCacheAll() {
%1 = call i32 @L1C_CleanInvalidateCache(i32 1)
ret void
}

LLVM IR (-O2):
define void @L1C_CleanDCacheAll() {
%1 = tail call i32 @L1C_CleanInvalidateCache(i32 1)
ret void
}
void ieee802_11_set_beacons(struct hostapd_iface *iface) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_iface = type opaque
define void @ieee802_11_set_beacons(%struct.hostapd_iface* nocapture %0) {
ret void
}
void g_value_get_boxed() {}


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

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

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

LLVM IR (-O2):
define void @g_value_get_boxed() {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int fork();
pid_t xfork() {
  int ret = fork();
  if (ret == -1) {
    ;
  }
  return ret;
}


x86 assembly (clang, -O0):
<xfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1131 <xfork+0x21>
jmp    1131 <xfork+0x21>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xfork() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @xfork() {
%1 = tail call i32 (...) @fork()
ret i32 %1
}
/* Variables and functions */
double areac(float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float r;
  printf("Enter the radius of Circle:\n");
  scanf("%f", &r);
  printf("The Area of the circle with radius %f is: %f", r, areac(r));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <areac@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xe99(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1050 <areac@plt>
movaps %xmm0,%xmm1
lea    0xe80(%rip),%rdi
movsd  0x10(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Enter the radius of Circle:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [45 x i8] c"The Area of the circle with radius %f is: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = call double @areac(float %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %6, double %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [45 x i8] c"The Area of the circle with radius %f is: %f\00"
@str = [28 x i8] c"Enter the radius of Circle:\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call double @areac(float %5)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), double %6, double %7)
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ puts(char *);
int main(void) {
  char c, s[80];
  int i = 0;
  puts("hahahahahahaha\n");
  while ((c = getchar()) != '\n') {
    s[i] = c;
    i++;
  }
  puts(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x64(%rbp)
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1171 <main+0x51>
mov    -0x5(%rbp),%cl
movslq -0x64(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1142 <main+0x22>
lea    -0x60(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
lea    0xed4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%al
je     1151 <main+0x31>
mov    %rsp,%rbx
nop
mov    %al,(%rbx)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    $0xa,%al
jne    1140 <main+0x20>
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"hahahahahahaha\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [80 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %10, %0
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %6
%11 = load i8, i8* %2
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 %13
store i8 %11, i8* %14
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %6
17: ; preds = %6
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%19 = call i32 @puts(i8* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"hahahahahahaha\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call signext i8 (...) @getchar()
%5 = icmp eq i8 %4, 10
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i64 [ %10, %6 ], [ 0, %0 ]
%8 = phi i8 [ %11, %6 ], [ %4, %0 ]
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %7
store i8 %8, i8* %9
%10 = add nuw i64 %7, 1
%11 = tail call signext i8 (...) @getchar()
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %6
13: ; preds = %6, %0
%14 = call i32 @puts(i8* %2)
ret i32 0
}
BOOST_AUTO_TEST_CASE(eq) {
  TESTCASE2(eq, 0, 0, 1);
  TESTCASE2(eq, 0, 1, 0);
  TESTCASE2(eq, 1, 0, 0);
  TESTCASE2(eq, 1, 1, 1);
}


x86 assembly (clang, -O0):
<BOOST_AUTO_TEST_CASE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %edx,%edx
mov    $0x1,%ecx
mov    %edx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%esi
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x8(%rbp),%edi
mov    $0x1,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x0,%al
call   1030 <TESTCASE2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BOOST_AUTO_TEST_CASE>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1030 <TESTCASE2@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
xor    %eax,%eax
pop    %rbx
jmp    1030 <TESTCASE2@plt>

LLVM IR (-O0):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %4, i32 0, i32 0, i32 1)
%6 = load i32, i32* %3
%7 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %6, i32 0, i32 1, i32 0)
%8 = load i32, i32* %3
%9 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %8, i32 1, i32 0, i32 0)
%10 = load i32, i32* %3
%11 = call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %10, i32 1, i32 1, i32 1)
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @BOOST_AUTO_TEST_CASE(i32 %0) {
%2 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 0, i32 1)
%3 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 0, i32 1, i32 0)
%4 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 0, i32 0)
%5 = tail call i32 (i32, i32, i32, i32, ...) bitcast (i32 (...)* @TESTCASE2 to i32 (i32, i32, i32, i32, ...)*)(i32 %0, i32 1, i32 1, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int curs_move(int r, int c) { move(r, c); }


x86 assembly (clang, -O0):
<curs_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <move@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<curs_move>:
jmp    1030 <move@plt>

LLVM IR (-O0):
define i32 @curs_move(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = call i32 @move(i32 %6, i32 %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @curs_move(i32 %0, i32 %1) {
%3 = tail call i32 @move(i32 %0, i32 %1)
ret i32 undef
}
/* Type definitions */
struct Request {
  int dummy;
};
struct Block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DIE_UNLESS(struct Request *);
int addRequest(struct Block *b, char peerid[20], struct Request *req) {
  DIE_UNLESS(req);
}


x86 assembly (clang, -O0):
<addRequest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <DIE_UNLESS@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addRequest>:
mov    %rdx,%rdi
jmp    1030 <DIE_UNLESS@plt>

LLVM IR (-O0):
%struct.Block = type { i32 }
%struct.Request = type { i32 }
define i32 @addRequest(%struct.Block* %0, i8* %1, %struct.Request* %2) {
%4 = alloca i32
%5 = alloca %struct.Block*
%6 = alloca i8*
%7 = alloca %struct.Request*
store %struct.Block* %0, %struct.Block** %5
store i8* %1, i8** %6
store %struct.Request* %2, %struct.Request** %7
%8 = load %struct.Request*, %struct.Request** %7
%9 = call i32 @DIE_UNLESS(%struct.Request* %8)
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
%struct.Block = type { i32 }
%struct.Request = type { i32 }
define i32 @addRequest(%struct.Block* nocapture readnone %0, i8* nocapture readnone %1, %struct.Request* %2) {
%4 = tail call i32 @DIE_UNLESS(%struct.Request* %2)
ret i32 undef
}
void show_flags() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @arch_init_optprobes() {
ret i32 0
}
/* Variables and functions */
unsigned int f23(unsigned int);
unsigned int f24(unsigned int a) { return f23(f23(a)); }


x86 assembly (clang, -O0):
<f24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f23@plt>
mov    %eax,%edi
call   1030 <f23@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f24>:
push   %rax
call   1030 <f23@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f23@plt>

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

LLVM IR (-O2):
define i32 @f24(i32 %0) {
%2 = tail call i32 @f23(i32 %0)
%3 = tail call i32 @f23(i32 %2)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int sys_get_le16(int /*<<< orphan*/ const *);
uint32_t sys_get_le32(const uint8_t src[4]) {
  return ((uint32_t)sys_get_le16(&src[2]) << 16) | sys_get_le16(&src[0]);
}


x86 assembly (clang, -O0):
<sys_get_le32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x8,%rdi
call   1030 <sys_get_le16@plt>
shl    $0x10,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sys_get_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_get_le32>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
add    $0x8,%rdi
call   1030 <sys_get_le16@plt>
mov    %eax,%ebp
shl    $0x10,%ebp
mov    %rbx,%rdi
call   1030 <sys_get_le16@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sys_get_le32(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = call i32 @sys_get_le16(i32* %4)
%6 = shl i32 %5, 16
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = call i32 @sys_get_le16(i32* %8)
%10 = or i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @sys_get_le32(i32* %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = tail call i32 @sys_get_le16(i32* %2)
%4 = shl i32 %3, 16
%5 = tail call i32 @sys_get_le16(i32* %0)
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double, double, double,
                          double);
double display_results(double x_1, double y_1, double x_2, double y_2,
                       double slope, double y_intercept) {
  printf(
      "For the points (%.2lf, %.2lf) and (%.2lf, %.2lf), the equation of the "
      "\n                 perpendicular bisector is: y = %.2lfx + %.2lf\n\n",
      x_1, y_1, x_2, y_2, slope, y_intercept);
  return 0;
}


x86 assembly (clang, -O0):
<display_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm5
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_results>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [136 x i8] c"For the points (%.2lf, %.2lf) and (%.2lf, %.2lf), the equation of the \0A perpendicular bisector is: y = %.2lfx + %.2lf\0A\0A\00"
define double @display_results(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call i32 @printf(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), double %13, double %14, double %15, double %16, double %17, double %18)
ret double 0.000000e+00
}

LLVM IR (-O2):
@.str = [136 x i8] c"For the points (%.2lf, %.2lf) and (%.2lf, %.2lf), the equation of the \0A perpendicular bisector is: y = %.2lfx + %.2lf\0A\0A\00"
define double @display_results(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @printf(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %2, double %3, double %4, double %5)
ret double 0.000000e+00
}
void test_flipper_free_world(void) { return; }


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

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

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

LLVM IR (-O2):
define void @test_flipper_free_world() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *);
char *fcharminus(char *x, char y) {
  *x -= y;
  if (!*x)
    foo(x);
  return x;
}


x86 assembly (clang, -O0):
<fcharminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    %edx,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1147 <fcharminus+0x37>
mov    -0x8(%rbp),%rdi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcharminus>:
push   %rbx
mov    %rdi,%rbx
sub    %sil,(%rdi)
jne    1121 <fcharminus+0x11>
mov    %rbx,%rdi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @fcharminus(i8* returned %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = sub i8 %3, %1
store i8 %4, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @foo(i8* %0)
br label %8
8: ; preds = %6, %2
ret i8* %0
}
void third(char *status, int *counter, char pref) {
  if (*status == 'U') {
    if (pref == 'D') {
      *counter += 1;
      *status = 'D';
    }
  } else {
    if (pref == 'U') {
      *counter += 1;
      *status = 'U';
    }
  }
}


x86 assembly (clang, -O0):
<third>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x55,%eax
jne    1145 <third+0x45>
movsbl -0x11(%rbp),%eax
cmp    $0x44,%eax
jne    1140 <third+0x40>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x44,(%rax)
jmp    1169 <third+0x69>
movsbl -0x11(%rbp),%eax
cmp    $0x55,%eax
jne    1164 <third+0x64>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x55,(%rax)
jmp    1169 <third+0x69>
pop    %rbp
ret

x86 assembly (clang, -O2):
<third>:
cmpb   $0x55,(%rdi)
jne    110e <third+0xe>
mov    $0x44,%al
cmp    $0x44,%dl
je     1115 <third+0x15>
jmp    111a <third+0x1a>
mov    $0x55,%al
cmp    $0x55,%dl
jne    111a <third+0x1a>
addl   $0x1,(%rsi)
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @third(i8* %0, i32* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i8
store i8* %0, i8** %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 85
br i1 %10, label %11, label %21
11: ; preds = %3
%12 = load i8, i8* %6
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 68
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = add nsw i32 %17, 1
store i32 %18, i32* %16
%19 = load i8*, i8** %4
store i8 68, i8* %19
br label %20
20: ; preds = %15, %11
br label %31
21: ; preds = %3
%22 = load i8, i8* %6
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 85
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load i32*, i32** %5
%27 = load i32, i32* %26
%28 = add nsw i32 %27, 1
store i32 %28, i32* %26
%29 = load i8*, i8** %4
store i8 85, i8* %29
br label %30
30: ; preds = %25, %21
br label %31
31: ; preds = %30, %20
ret void
}

LLVM IR (-O2):
define void @third(i8* nocapture %0, i32* nocapture %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 85
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = icmp eq i8 %2, 68
br i1 %7, label %10, label %14
8: ; preds = %3
%9 = icmp eq i8 %2, 85
br i1 %9, label %10, label %14
10: ; preds = %8, %6
%11 = phi i8 [ 68, %6 ], [ 85, %8 ]
%12 = load i32, i32* %1
%13 = add nsw i32 %12, 1
store i32 %13, i32* %1
store i8 %11, i8* %0
br label %14
14: ; preds = %10, %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void myprintstr(const char *str) {
  int i = 0;
  while (str[i] != '\000') {
    printf("%c", str[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<myprintstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115e <myprintstr+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeb9(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <myprintstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @myprintstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %17)
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @myprintstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}