xunge/DecIR huggingface dataset:
adr0regx1_set(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*((short *)10000000)) = (p1[x1]); }


x86 assembly (clang, -O0):
<adr0regx1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,2),%cx
mov    $0x989680,%eax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0regx1_set>:
movslq %ecx,%rax
movzwl (%r9,%rax,2),%eax
mov    %ax,0x989680
ret

LLVM IR (-O0):
define i32 @adr0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = load i32, i32* %11
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
store i16 %20, i16* inttoptr (i64 10000000 to i16*)
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @adr0regx1_set(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* %5, i64 %7
%9 = load i16, i16* %8
store i16 %9, i16* inttoptr (i64 10000000 to i16*)
ret i32 undef
}
/* Variables and functions */
scalar_t__ __rintf(float);
long long int __llrintf(float x) { return (long long int)__rintf(x); }


x86 assembly (clang, -O0):
<__llrintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__rintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__llrintf>:
jmp    1030 <__rintf@plt>

LLVM IR (-O0):
define i64 @__llrintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i64 @__rintf(float %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @__llrintf(float %0) {
%2 = tail call i64 @__rintf(float %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void usage(void) {
  errx(64, "usage: timelimit [-pq] [-S ksig] [-s wsig] "
           "[-T ktime] [-t wtime] command");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rsi
mov    $0x40,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [73 x i8] c"usage: timelimit [-pq] [-S ksig] [-s wsig] [-T ktime] [-t wtime] command\00"
define void @usage() {
%1 = call i32 @errx(i32 64, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"usage: timelimit [-pq] [-S ksig] [-s wsig] [-T ktime] [-t wtime] command\00"
define void @usage() {
%1 = tail call i32 @errx(i32 64, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}
void delay(unsigned long count) {
  volatile unsigned long i = count;
  while (i--)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     112e <delay+0x2e>
jmp    1110 <delay+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %rdi,-0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
subq   $0x1,-0x8(%rsp)
jae    1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store volatile i64 %4, i64* %3
br label %5
5: ; preds = %9, %1
%6 = load volatile i64, i64* %3
%7 = add i64 %6, -1
store volatile i64 %7, i64* %3
%8 = icmp ne i64 %6, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store volatile i64 %0, i64* %2
br label %4
4: ; preds = %4, %1
%5 = load volatile i64, i64* %2
%6 = add i64 %5, -1
store volatile i64 %6, i64* %2
%7 = icmp eq i64 %5, 0
br i1 %7, label %8, label %4
8: ; preds = %4
ret void
}
void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) {}


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

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

LLVM IR (-O0):
%struct.taskstats = type opaque
%struct.task_struct = type opaque
define void @xacct_add_tsk(%struct.taskstats* %0, %struct.task_struct* %1) {
%3 = alloca %struct.taskstats*
%4 = alloca %struct.task_struct*
store %struct.taskstats* %0, %struct.taskstats** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.taskstats = type opaque
%struct.task_struct = type opaque
define void @xacct_add_tsk(%struct.taskstats* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
int no_save_func(const struct cmd_info *ci) { return 1; }


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

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

LLVM IR (-O0):
%struct.cmd_info = type opaque
define i32 @no_save_func(%struct.cmd_info* %0) {
%2 = alloca %struct.cmd_info*
store %struct.cmd_info* %0, %struct.cmd_info** %2
ret i32 1
}

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @no_save_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ snoopy_configuration_ctor();
int /*<<< orphan*/ snoopy_inputdatastorage_ctor();
void snoopy_init() {
  snoopy_configuration_ctor();
  snoopy_inputdatastorage_ctor();
}


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

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

LLVM IR (-O0):
define void @snoopy_init() {
%1 = call i32 (...) @snoopy_configuration_ctor()
%2 = call i32 (...) @snoopy_inputdatastorage_ctor()
ret void
}

LLVM IR (-O2):
define void @snoopy_init() {
%1 = tail call i32 (...) @snoopy_configuration_ctor()
%2 = tail call i32 (...) @snoopy_inputdatastorage_ctor()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dputc(char);
void dputs(const char *s) {
  char c;
  while ((c = *s++)) {
    if (c == 10)
      dputc(13);
    dputc(c);
  }
}


x86 assembly (clang, -O0):
<dputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
je     115d <dputs+0x4d>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
jne    114f <dputs+0x3f>
mov    $0xd,%edi
call   1030 <dputc@plt>
movsbl -0x9(%rbp),%edi
call   1030 <dputc@plt>
jmp    111c <dputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dputs>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
jmp    1136 <dputs+0x26>
nopl   0x0(%rax)
mov    $0xd,%edi
call   1030 <dputc@plt>
add    $0x1,%r14
movsbl %bl,%edi
call   1030 <dputc@plt>
movzbl (%r14),%ebx
cmp    $0xa,%bl
je     1120 <dputs+0x10>
test   %bl,%bl
jne    112a <dputs+0x1a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @dputs(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %4, %8 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %10
i8 10, label %6
]
6: ; preds = %2
%7 = tail call i32 @dputc(i8 signext 13)
br label %8
8: ; preds = %2, %6
%9 = tail call i32 @dputc(i8 signext %5)
br label %2
10: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Send1(int /*<<< orphan*/);
void LCD_X_WriteM01(unsigned char *pData, int NumBytes) {
  for (; NumBytes; NumBytes--) {
    _Send1(*pData++);
  }
}


x86 assembly (clang, -O0):
<LCD_X_WriteM01>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <LCD_X_WriteM01+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <_Send1@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <LCD_X_WriteM01+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_WriteM01>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <LCD_X_WriteM01+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <_Send1@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <LCD_X_WriteM01+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @LCD_X_WriteM01(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %7, %4 ], [ %0, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %6
%9 = zext i8 %8 to i32
%10 = tail call i32 @_Send1(i32 %9)
%11 = add nsw i32 %5, -1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SSIDataGet(int, unsigned long *);
int /*<<< orphan*/ SSIDataPut(int, unsigned char);
void PDCWrite(unsigned char ucAddr, unsigned char ucData) {
  unsigned long ulTemp;
  SSIDataPut(0x40008000, (ucAddr & 0x0F) | 0x00);
  SSIDataPut(0x40008000, ucData);
  SSIDataGet(0x40008000, &ulTemp);
  SSIDataGet(0x40008000, &ulTemp);
}


x86 assembly (clang, -O0):
<PDCWrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
or     $0x0,%eax
mov    $0x40008000,%edi
movzbl %al,%esi
call   1040 <SSIDataPut@plt>
mov    $0x40008000,%edi
movzbl -0x2(%rbp),%esi
call   1040 <SSIDataPut@plt>
mov    $0x40008000,%edi
lea    -0x10(%rbp),%rsi
call   1030 <SSIDataGet@plt>
mov    $0x40008000,%edi
lea    -0x10(%rbp),%rsi
call   1030 <SSIDataGet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDCWrite>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%esi
and    $0xf,%esi
mov    $0x40008000,%edi
call   1040 <SSIDataPut@plt>
mov    $0x40008000,%edi
mov    %ebx,%esi
call   1040 <SSIDataPut@plt>
lea    0x8(%rsp),%rbx
mov    $0x40008000,%edi
mov    %rbx,%rsi
call   1030 <SSIDataGet@plt>
mov    $0x40008000,%edi
mov    %rbx,%rsi
call   1030 <SSIDataGet@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @PDCWrite(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i64
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = load i8, i8* %3
%7 = zext i8 %6 to i32
%8 = and i32 %7, 15
%9 = or i32 %8, 0
%10 = trunc i32 %9 to i8
%11 = call i32 @SSIDataPut(i32 1073774592, i8 zeroext %10)
%12 = load i8, i8* %4
%13 = call i32 @SSIDataPut(i32 1073774592, i8 zeroext %12)
%14 = call i32 @SSIDataGet(i32 1073774592, i64* %5)
%15 = call i32 @SSIDataGet(i32 1073774592, i64* %5)
ret void
}

LLVM IR (-O2):
define void @PDCWrite(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = and i8 %0, 15
%6 = tail call i32 @SSIDataPut(i32 1073774592, i8 zeroext %5)
%7 = tail call i32 @SSIDataPut(i32 1073774592, i8 zeroext %1)
%8 = call i32 @SSIDataGet(i32 1073774592, i64* %3)
%9 = call i32 @SSIDataGet(i32 1073774592, i64* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int sig_init(void) {
  sigset_t mask;
  sigfillset(&mask);
  sigprocmask(SIG_BLOCK, &mask, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<sig_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_init>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define i32 @sig_init() {
%1 = alloca i32
%2 = call i32 @sigfillset(i32* %1)
%3 = load i32, i32* @SIG_BLOCK
%4 = call i32 @sigprocmask(i32 %3, i32* %1, i32* null)
ret i32 0
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define i32 @sig_init() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_BLOCK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
ret i32 0
}
int main(void) {
  int vollkommen;
  int defizient;
  int abundant;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
ret i32 0
}

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

/* Variables and functions */
int _mbtowc(int /*<<< orphan*/ *, char const *, size_t);
int mbtowc(wchar_t *pwc, const char *s, size_t n) {
  int result;
  if (s == NULL)
    return (1);
  result = _mbtowc(pwc, s, n);
  if (result < 0)
    result = -1;
  return (result);
}


x86 assembly (clang, -O0):
<mbtowc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113b <mbtowc+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1166 <mbtowc+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <_mbtowc@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1160 <mbtowc+0x50>
movl   $0xffffffff,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbtowc>:
test   %rsi,%rsi
je     112c <mbtowc+0x1c>
push   %rax
call   1030 <_mbtowc@plt>
mov    %eax,%ecx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %ecx,%eax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @mbtowc(i32* %0, i8* %1, i64 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 @_mbtowc(i32* %0, i8* %1, i64 %2)
%7 = icmp sgt i32 %6, -1
%8 = select i1 %7, i32 %6, i32 -1
br label %9
9: ; preds = %3, %5
%10 = phi i32 [ %8, %5 ], [ 1, %3 ]
ret i32 %10
}
void XtSetWarningMsgHandler() {}


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

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

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

LLVM IR (-O2):
define void @XtSetWarningMsgHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_minreq() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_minreq"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblockq_get_minreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_minreq\0A\00"
define i32 @pa_memblockq_get_minreq() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_minreq\00"
define i32 @pa_memblockq_get_minreq() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void __pthread_register_cancel_2(struct __ptcb *__cb) {
  __asm__ __volatile__("call __pthread_register_cancel" : : "a"(__cb));
}


x86 assembly (clang, -O0):
<__pthread_register_cancel_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
call   1030 <__pthread_register_cancel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pthread_register_cancel_2>:
mov    %rdi,%rax
call   1030 <__pthread_register_cancel@plt>
ret

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

LLVM IR (-O2):
%struct.__ptcb = type opaque
define void @__pthread_register_cancel_2(%struct.__ptcb* %0) {
tail call void asm sideeffect "call __pthread_register_cancel", "{ax},~{dirflag},~{fpsr},~{flags}"(%struct.__ptcb* %0)
ret void
}
const char *CmpName(void *arg) { return "foo"; }


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

x86 assembly (clang, -O2):
<CmpName>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
define i8* @CmpName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
define i8* @CmpName(i8* nocapture readnone %0) {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_me() { printf("YOU'RE HERE"); }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"YOU'RE HERE\00"
define void @print_me() {
%1 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"YOU'RE HERE\00"
define void @print_me() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int foo() {
  int a = 1;
  while (a < 10) {
    if (a == 5)
      goto end;
    a = f(a);
  }
  printf(a);
end:
  a *= 2;
  return a;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    115a <foo+0x3a>
cmpl   $0x5,-0x4(%rbp)
jne    1148 <foo+0x28>
jmp    1165 <foo+0x45>
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
jmp    112f <foo+0xf>
movslq -0x4(%rbp),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
cmp    $0x5,%ebx
je     1152 <foo+0x32>
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <f@plt>
mov    %eax,%ebx
cmp    $0xa,%eax
jl     1130 <foo+0x10>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <printf@plt>
add    %ebx,%ebx
jmp    1157 <foo+0x37>
mov    $0xa,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 5
br i1 %7, label %8, label %9
8: ; preds = %5
br label %17
9: ; preds = %5
%10 = load i32, i32* %1
%11 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %10)
store i32 %11, i32* %1
br label %2
12: ; preds = %2
%13 = load i32, i32* %1
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = call i32 (i8*, ...) @printf(i8* %15)
br label %17
17: ; preds = %12, %8
%18 = load i32, i32* %1
%19 = mul nsw i32 %18, 2
store i32 %19, i32* %1
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo() {
br label %1
1: ; preds = %0, %4
%2 = phi i32 [ 1, %0 ], [ %5, %4 ]
%3 = icmp eq i32 %2, 5
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 %2)
%6 = icmp slt i32 %5, 10
br i1 %6, label %1, label %7
7: ; preds = %4
%8 = zext i32 %5 to i64
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 (i8*, ...) @printf(i8* %9)
%11 = shl nuw i32 %5, 1
br label %12
12: ; preds = %1, %7
%13 = phi i32 [ %11, %7 ], [ 10, %1 ]
ret i32 %13
}
const char *picosat_copyright(void) {
  return "Copyright (c) 2006 - 2008 Armin Biere JKU Linz";
}


x86 assembly (clang, -O0):
<picosat_copyright>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<picosat_copyright>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Copyright (c) 2006 - 2008 Armin Biere JKU Linz\00"
define i8* @picosat_copyright() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [47 x i8] c"Copyright (c) 2006 - 2008 Armin Biere JKU Linz\00"
define i8* @picosat_copyright() {
ret i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0)
}
void _blacklist_freenode(void *nodep) {}


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

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

LLVM IR (-O0):
define void @_blacklist_freenode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @_blacklist_freenode(i8* nocapture %0) {
ret void
}
void testNormal() {
  double n1 = Random_normal(0, 1);
  double n2 = Random_normal(0, 1);
  UnitTest_expect_ne_double((n1), (n2), __func__, 80);
}


x86 assembly (clang, -O0):
<testNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <Random_normal@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <Random_normal@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe99(%rip),%rdi
mov    $0x50,%esi
mov    $0x2,%al
call   1040 <UnitTest_expect_ne_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testNormal>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <Random_normal@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
xor    %edi,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <Random_normal@plt>
cvtsi2sd %eax,%xmm1
lea    0xeaf(%rip),%rdi
movsd  (%rsp),%xmm0
mov    $0x50,%esi
mov    $0x2,%al
pop    %rcx
jmp    1040 <UnitTest_expect_ne_double@plt>

LLVM IR (-O0):
@__func__.testNormal = [11 x i8] c"testNormal\00"
define void @testNormal() {
%1 = alloca double
%2 = alloca double
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Random_normal to i32 (i32, i32, ...)*)(i32 0, i32 1)
%4 = sitofp i32 %3 to double
store double %4, double* %1
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @Random_normal to i32 (i32, i32, ...)*)(i32 0, i32 1)
%6 = sitofp i32 %5 to double
store double %6, double* %2
%7 = load double, double* %1
%8 = load double, double* %2
%9 = call i32 (double, double, i8*, i32, ...) bitcast (i32 (...)* @UnitTest_expect_ne_double to i32 (double, double, i8*, i32, ...)*)(double %7, double %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.testNormal, i64 0, i64 0), i32 80)
ret void
}

LLVM IR (-O2):
@__func__.testNormal = [11 x i8] c"testNormal\00"
define void @testNormal() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Random_normal to i32 (i32, i32, ...)*)(i32 0, i32 1)
%2 = sitofp i32 %1 to double
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @Random_normal to i32 (i32, i32, ...)*)(i32 0, i32 1)
%4 = sitofp i32 %3 to double
%5 = tail call i32 (double, double, i8*, i32, ...) bitcast (i32 (...)* @UnitTest_expect_ne_double to i32 (double, double, i8*, i32, ...)*)(double %2, double %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__func__.testNormal, i64 0, i64 0), i32 80)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_st_8_ix(void) { m68ki_write_8(EA_AY_IX_8(), 0xff); }


x86 assembly (clang, -O0):
<m68k_op_st_8_ix>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
call   1040 <m68ki_write_8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_st_8_ix>:
push   %rax
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%edi
mov    $0xff,%esi
pop    %rax
jmp    1040 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_st_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}

LLVM IR (-O2):
define void @m68k_op_st_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i32 @m68ki_write_8(i32 %1, i32 255)
ret void
}
void saveconfig() { return; }


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

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

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

LLVM IR (-O2):
define void @saveconfig() {
ret void
}
char *end_of_name(char *where) {
  char *now = where;
  while ((*now) && ((*now != ' ') && (*now != '\t') && (*now != '=')))
    now++;
  return now;
}


x86 assembly (clang, -O0):
<end_of_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1165 <end_of_name+0x65>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x12(%rbp)
je     115f <end_of_name+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x12(%rbp)
je     115f <end_of_name+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
setne  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1175 <end_of_name+0x75>
jmp    1186 <end_of_name+0x86>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <end_of_name+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_of_name>:
mov    %rdi,%rax
movabs $0x2000000100000201,%rcx
jmp    1114 <end_of_name+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x3d,%rdx
ja     1110 <end_of_name+0x10>
bt     %rdx,%rcx
jae    1110 <end_of_name+0x10>
ret

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

LLVM IR (-O2):
define i8* @end_of_name(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 9, label %7
i8 61, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *a = (char *)malloc(10 * sizeof(char));
  int i;
  for (i = 0; i < 10; i++)
    a[i] = '\0';
  printf("aAAA%n", a);
  printf("\n[%s]\n", a);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    116f <main+0x4f>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114b <main+0x2b>
mov    -0x18(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movq   $0x0,(%rax)
movw   $0x0,0x8(%rax)
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"aAAA%n\00"
@.str.1 = [7 x i8] c"\0A[%s]\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 10)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %6
store i32 0, i32* %7
br label %10
10: ; preds = %18, %2
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
br label %18
18: ; preds = %13
%19 = load i32, i32* %7
%20 = add nsw i32 %19, 1
store i32 %20, i32* %7
br label %10
21: ; preds = %10
%22 = load i8*, i8** %6
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %6
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %24)
ret i32 1
}

LLVM IR (-O2):
@.str = [7 x i8] c"aAAA%n\00"
@.str.1 = [7 x i8] c"\0A[%s]\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 10)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}
double fmax(double a, double b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
int ToBCD(int n) { return ((n / 10) << 4) | (n % 10); }


x86 assembly (clang, -O0):
<ToBCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
or     %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToBCD>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @ToBCD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ToBCD(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int recipSqrt(float);
float sqrt(float x) { return x == 0 ? 0 : 1 / recipSqrt(x); }


x86 assembly (clang, -O0):
<sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    113e <sqrt+0x2e>
jp     113e <sqrt+0x2e>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <sqrt+0x45>
movss  -0x4(%rbp),%xmm0
call   1030 <recipSqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqrt>:
movaps %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    111e <sqrt+0xe>
jp     111e <sqrt+0xe>
ret
push   %rax
movaps %xmm1,%xmm0
call   1030 <recipSqrt@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2ss %edx,%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define float @sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %10
6: ; preds = %1
%7 = load float, float* %2
%8 = call i32 @recipSqrt(float %7)
%9 = sdiv i32 1, %8
br label %10
10: ; preds = %6, %5
%11 = phi i32 [ 0, %5 ], [ %9, %6 ]
%12 = sitofp i32 %11 to float
ret float %12
}

LLVM IR (-O2):
define float @sqrt(float %0) {
%2 = fcmp oeq float %0, 0.000000e+00
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @recipSqrt(float %0)
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to float
br label %9
9: ; preds = %1, %3
%10 = phi float [ %8, %3 ], [ 0.000000e+00, %1 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ compute(int, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int month, year;
  {
    system("clear");
    puts("Enter the month and year in order");
    scanf("%i %i", &month, &year);
    compute(month, year);
  }
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <system@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1060 <compute@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [34 x i8] c"Enter the month and year in order\00"
@.str.2 = [6 x i8] c"%i %i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @compute(i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [34 x i8] c"Enter the month and year in order\00"
@.str.2 = [6 x i8] c"%i %i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @compute(i32 %8, i32 %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ file64_to_cpu(int /*<<< orphan*/);
uint32_t struct_val_u64(char *ptr, unsigned int offset) {
  return (file64_to_cpu(*(uint64_t *)(ptr + offset)));
}


x86 assembly (clang, -O0):
<struct_val_u64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    (%rax,%rcx,1),%edi
call   1030 <file64_to_cpu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<struct_val_u64>:
mov    %esi,%eax
mov    (%rdi,%rax,1),%edi
jmp    1030 <file64_to_cpu@plt>

LLVM IR (-O0):
define i32 @struct_val_u64(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @file64_to_cpu(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @struct_val_u64(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @file64_to_cpu(i32 %6)
ret i32 %7
}
/* Variables and functions */
int errno;
scalar_t__ unlink(char const *);
int unlink_noerr(const char *pathname) {
  int saved_errno = errno, ret;
  if (unlink(pathname) != 0)
    ret = errno;
  else
    ret = 0;
  errno = saved_errno;
  return ret;
}


x86 assembly (clang, -O0):
<unlink_noerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%rax
je     114c <unlink_noerr+0x3c>
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
jmp    1153 <unlink_noerr+0x43>
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    0x2e83(%rip),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink_noerr>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <unlink@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     112d <unlink_noerr+0x1d>
mov    (%rbx),%eax
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @unlink_noerr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i32, i32* @errno
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = call i64 @unlink(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* @errno
store i32 %10, i32* %4
br label %12
11: ; preds = %1
store i32 0, i32* %4
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %3
store i32 %13, i32* @errno
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @unlink_noerr(i8* nocapture %0) {
%2 = load i32, i32* @errno
%3 = tail call i64 @unlink(i8* %0)
%4 = icmp eq i64 %3, 0
%5 = load i32, i32* @errno
%6 = select i1 %4, i32 0, i32 %5
store i32 %2, i32* @errno
ret i32 %6
}
/* Variables and functions */
int mkstemps(char *, int /*<<< orphan*/);
int mkstemp(char *template) { return mkstemps(template, 0); }


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

x86 assembly (clang, -O2):
<mkstemp>:
xor    %esi,%esi
jmp    1030 <mkstemps@plt>

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

LLVM IR (-O2):
define i32 @mkstemp(i8* %0) {
%2 = tail call i32 @mkstemps(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void DMA1_Channel7_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @DMA1_Channel7_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @DMA1_Channel7_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int valloc_upcall() {}


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

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

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

LLVM IR (-O2):
define i32 @valloc_upcall() {
ret i32 undef
}
/* Variables and functions */
bool is_oct_digit(char c) { return (c >= '0') && (c <= '7'); }


x86 assembly (clang, -O0):
<is_oct_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <is_oct_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_oct_digit>:
and    $0xf8,%dil
xor    %eax,%eax
cmp    $0x30,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_oct_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 55
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_oct_digit(i8 signext %0) {
%2 = and i8 %0, -8
%3 = icmp eq i8 %2, 48
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
scalar_t__ getpid();
scalar_t__ syscall(int /*<<< orphan*/);
int pthread_main_np() { return syscall(SYS_gettid) == getpid() ? 1 : 0; }


x86 assembly (clang, -O0):
<pthread_main_np>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x8(%rbp),%rdx
mov    %rax,%rsi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_main_np>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @pthread_main_np() {
%1 = load i32, i32* @SYS_gettid
%2 = call i64 @syscall(i32 %1)
%3 = call i64 (...) @getpid()
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @pthread_main_np() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i64 @syscall(i32 %1)
%3 = tail call i64 (...) @getpid()
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
int entity_func2(void) { return 9; }


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

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

LLVM IR (-O0):
define i32 @entity_func2() {
ret i32 9
}

LLVM IR (-O2):
define i32 @entity_func2() {
ret i32 9
}
int mul3div4(int x) {
  int mul3 = x + (x << 1);
  int mul3_mask = mul3 >> ((sizeof(int) << 3) - 1u);
  int bias = mul3_mask & 3;
  return (mul3 + bias) >> 2;
}


x86 assembly (clang, -O0):
<mul3div4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul3div4>:
lea    (%rdi,%rdi,2),%ecx
mov    %ecx,%eax
sar    $0x1f,%eax
and    $0x3,%eax
add    %ecx,%eax
sar    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @mul3div4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = shl i32 %7, 1
%9 = add nsw i32 %6, %8
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = ashr i32 %10, 31
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = and i32 %12, 3
store i32 %13, i32* %5
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = add nsw i32 %14, %15
%17 = ashr i32 %16, 2
ret i32 %17
}

LLVM IR (-O2):
define i32 @mul3div4(i32 %0) {
%2 = mul i32 %0, 3
%3 = icmp slt i32 %2, 0
%4 = select i1 %3, i32 3, i32 0
%5 = add nsw i32 %4, %2
%6 = ashr i32 %5, 2
ret i32 %6
}