xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void putnchar(char *str, int nchar) {
  unsigned int i;
  for (i = 0; i < nchar; i++) {
    if (!str[i])
      break;
    putchar(str[i]);
  }
}


x86 assembly (clang, -O0):
<putnchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1166 <putnchar+0x56>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
jne    1148 <putnchar+0x38>
jmp    1166 <putnchar+0x56>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1030 <putchar@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <putnchar+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putnchar>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     114a <putnchar+0x3a>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     114a <putnchar+0x3a>
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <putnchar+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @putnchar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %25, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %28
10: ; preds = %6
%11 = load i8*, i8** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %10
br label %28
18: ; preds = %10
%19 = load i8*, i8** %3
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = call i32 @putchar(i8 signext %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %5
%27 = add i32 %26, 1
store i32 %27, i32* %5
br label %6
28: ; preds = %17, %6
ret void
}

LLVM IR (-O2):
define void @putnchar(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %11
%7 = phi i64 [ 0, %4 ], [ %13, %11 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = tail call i32 @putchar(i8 signext %9)
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %11, %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wFileFree();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasFreeFile() { wPushNumber(wFileFree()); }


x86 assembly (clang, -O0):
<wBasFreeFile>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <wFileFree@plt>
mov    %eax,%edi
call   1030 <wPushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasFreeFile>:
push   %rax
xor    %eax,%eax
call   1040 <wFileFree@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <wPushNumber@plt>

LLVM IR (-O0):
define void @wBasFreeFile() {
%1 = call i32 (...) @wFileFree()
%2 = call i32 @wPushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @wBasFreeFile() {
%1 = tail call i32 (...) @wFileFree()
%2 = tail call i32 @wPushNumber(i32 %1)
ret void
}
int test_imm_71uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x71 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_71uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 485331304448
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void foo803() {}


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

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

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

LLVM IR (-O2):
define void @foo803() {
ret void
}
void dbgbrk() { int i; }


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

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

LLVM IR (-O0):
define void @dbgbrk() {
%1 = alloca i32
ret void
}

LLVM IR (-O2):
define void @dbgbrk() {
ret void
}
float lmath_maxf(float val, float max) { return val > max ? max : val; }


x86 assembly (clang, -O0):
<lmath_maxf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <lmath_maxf+0x2c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <lmath_maxf+0x36>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmath_maxf>:
minss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @lmath_maxf(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int print_lines(FILE *fp, char **lines) {
  char *line;
  while ((line = *lines++))
    fputs(line, fp);
  return 0;
}


x86 assembly (clang, -O0):
<print_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1152 <print_lines+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
jmp    1120 <print_lines+0x10>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_lines>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%rdi
test   %rdi,%rdi
je     1144 <print_lines+0x34>
mov    %rsi,%rbx
add    $0x8,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rsi
call   1030 <fputs@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <print_lines+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @print_lines(i32* nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %10, %5 ], [ %3, %2 ]
%7 = phi i8** [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = tail call i32 @fputs(i8* %6, i32* %0)
%10 = load i8*, i8** %8
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int st103_get_epreg(int /*<<< orphan*/);
int /*<<< orphan*/ st103_set_epreg(int /*<<< orphan*/, int);
void st103_ep_clear_dtog_rx(uint8_t ep_num) {
  uint16_t value = st103_get_epreg(ep_num);
  if ((value & (0x4000))) {
    value &= ((0x8000) | (0x0800) | (0x0600) | (0x0100) | (0x0080) | (0x000F));
    value |= (0x8000) | (0x0080) | (0x4000);
    st103_set_epreg(ep_num, value);
  }
}


x86 assembly (clang, -O0):
<st103_ep_clear_dtog_rx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <st103_get_epreg@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x4000,%eax
cmp    $0x0,%eax
je     1168 <st103_ep_clear_dtog_rx+0x48>
mov    -0x8(%rbp),%eax
and    $0x8f8f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     $0xc080,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <st103_set_epreg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<st103_ep_clear_dtog_rx>:
push   %rbx
mov    %edi,%ebx
call   1040 <st103_get_epreg@plt>
test   $0x4000,%eax
jne    1131 <st103_ep_clear_dtog_rx+0x11>
pop    %rbx
ret
and    $0xf0f,%eax
or     $0xc080,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <st103_set_epreg@plt>

LLVM IR (-O0):
define void @st103_ep_clear_dtog_rx(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @st103_get_epreg(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 16384
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %17
9: ; preds = %1
%10 = load i32, i32* %3
%11 = and i32 %10, 36751
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = or i32 %12, 49280
store i32 %13, i32* %3
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @st103_set_epreg(i32 %14, i32 %15)
br label %17
17: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @st103_ep_clear_dtog_rx(i32 %0) {
%2 = tail call i32 @st103_get_epreg(i32 %0)
%3 = and i32 %2, 16384
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = and i32 %2, 3855
%7 = or i32 %6, 49280
%8 = tail call i32 @st103_set_epreg(i32 %0, i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Fatal_Error(char *, char const *);
char const *Skip_Digits(char const *);
int sscanf(char const *, char *, unsigned long *);
const char *Scan_Octal(const char *string, unsigned long *value) {
  if (sscanf(string, "%lo", value) != 1)
    Fatal_Error("Bad octal number: %s.", string);
  return Skip_Digits(string);
}


x86 assembly (clang, -O0):
<Scan_Octal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb1(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     116d <Scan_Octal+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <Fatal_Error@plt>
mov    -0x8(%rbp),%rdi
call   1040 <Skip_Digits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Scan_Octal>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xec2(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     1157 <Scan_Octal+0x27>
lea    0xeb5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <Fatal_Error@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <Skip_Digits@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%lo\00"
@.str.1 = [22 x i8] c"Bad octal number: %s.\00"
define i8* @Scan_Octal(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
store i8* %0, i8** %3
store i64* %1, i64** %4
%5 = load i8*, i8** %3
%6 = load i64*, i64** %4
%7 = call i32 @sscanf(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %6)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = call i32 @Fatal_Error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %10)
br label %12
12: ; preds = %9, %2
%13 = load i8*, i8** %3
%14 = call i8* @Skip_Digits(i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lo\00"
@.str.1 = [22 x i8] c"Bad octal number: %s.\00"
define i8* @Scan_Octal(i8* %0, i64* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @Fatal_Error(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
%8 = tail call i8* @Skip_Digits(i8* %0)
ret i8* %8
}
void soft_right(void) {}


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

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

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

LLVM IR (-O2):
define void @soft_right() {
ret void
}
/* Variables and functions */
int rightShift(int, int);
int decodeExceptionNumber(int status) { return rightShift(status, 16); }


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

x86 assembly (clang, -O2):
<decodeExceptionNumber>:
mov    $0x10,%esi
jmp    1030 <rightShift@plt>

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

LLVM IR (-O2):
define i32 @decodeExceptionNumber(i32 %0) {
%2 = tail call i32 @rightShift(i32 %0, i32 16)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *fprintf(int /*<<< orphan*/, char *, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t sz) {
  register void *p = malloc(sz);
  return (p ? p
            : ((fprintf(stderr, "fatal: %s\n", "out of memory"), exit(-1)),
               (void *)0));
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1161 <xmalloc+0x31>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1187 <xmalloc+0x57>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
lea    0xe93(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <xmalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
lea    0xeb7(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"fatal: %s\0A\00"
@.str.1 = [14 x i8] c"out of memory\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
br label %15
10: ; preds = %1
%11 = load i32, i32* @stderr
%12 = call i8* @fprintf(i32 %11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @exit(i32 -1)
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %8
%16 = phi i8* [ %9, %8 ], [ null, %14 ]
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"fatal: %s\0A\00"
@.str.1 = [14 x i8] c"out of memory\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i8* @fprintf(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ mpack_load_u32(char const *);
int32_t mpack_load_i32(const char *p) { return (int32_t)mpack_load_u32(p); }


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

x86 assembly (clang, -O2):
<mpack_load_i32>:
jmp    1030 <mpack_load_u32@plt>

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

LLVM IR (-O2):
define i32 @mpack_load_i32(i8* %0) {
%2 = tail call i32 @mpack_load_u32(i8* %0)
ret i32 %2
}
int f77_return(int stat) {
  int new_status;
  new_status = stat;
  return (int)new_status;
}


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

x86 assembly (clang, -O2):
<f77_return>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @f77_return(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned long);
int /*<<< orphan*/ put8(int);
void mov_preg32pimm32_reg16(int reg32, unsigned long imm32, int reg16) {
  put8(0x66);
  put8(0x89);
  put8(0x80 | reg32 | (reg16 << 3));
  put32(imm32);
}


x86 assembly (clang, -O0):
<mov_preg32pimm32_reg16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x89,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
or     $0x80,%edi
mov    -0x14(%rbp),%eax
shl    $0x3,%eax
or     %eax,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rdi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg32pimm32_reg16>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x89,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
or     $0x80,%ebx
mov    %ebx,%edi
call   1030 <put8@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_preg32pimm32_reg16(i32 %0, i64 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = call i32 @put8(i32 102)
%8 = call i32 @put8(i32 137)
%9 = load i32, i32* %4
%10 = or i32 128, %9
%11 = load i32, i32* %6
%12 = shl i32 %11, 3
%13 = or i32 %10, %12
%14 = call i32 @put8(i32 %13)
%15 = load i64, i64* %5
%16 = call i32 @put32(i64 %15)
ret void
}

LLVM IR (-O2):
define void @mov_preg32pimm32_reg16(i32 %0, i64 %1, i32 %2) {
%4 = tail call i32 @put8(i32 102)
%5 = tail call i32 @put8(i32 137)
%6 = shl i32 %2, 3
%7 = or i32 %6, %0
%8 = or i32 %7, 128
%9 = tail call i32 @put8(i32 %8)
%10 = tail call i32 @put32(i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cow_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @cow_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
char *strcpy(char *dest, const char *src) {
  char *cp = dest;
  while ((*cp++ = *src++))
    ;
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
float gffi_get_single_float_swapped(int8_t *location, int offset) {
  int8_t buf[4];
  buf[3] = location[offset];
  buf[2] = location[offset + 1];
  buf[1] = location[offset + 2];
  buf[0] = location[offset + 3];
  return *(float *)buf;
}


x86 assembly (clang, -O0):
<gffi_get_single_float_swapped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffi_get_single_float_swapped>:
movslq %esi,%rax
movss  0xc(%rdi,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @gffi_get_single_float_swapped(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [4 x i32]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %6, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 %10, i32* %11
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %12, i64 %15
%17 = load i32, i32* %16
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 %17, i32* %18
%19 = load i32*, i32** %3
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = load i32, i32* %23
%25 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 %24, i32* %25
%26 = load i32*, i32** %3
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
%32 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 %31, i32* %32
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%34 = bitcast i32* %33 to float*
%35 = load float, float* %34
ret float %35
}

LLVM IR (-O2):
define float @gffi_get_single_float_swapped(i32* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = bitcast i32* %5 to float*
%7 = load float, float* %6
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ static_assert(int, char *);
void assertions(void) {
  static_assert(sizeof(float) == sizeof(uint32_t), "incompatible float type");
  static_assert(sizeof(double) == sizeof(uint64_t), "incompatible double type");
  static_assert(sizeof(intptr_t) == sizeof(uint32_t) ||
                    sizeof(intptr_t) == sizeof(uint64_t),
                "incompatible pointer type");
}


x86 assembly (clang, -O0):
<assertions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <static_assert@plt>
xor    %edi,%edi
lea    0xeea(%rip),%rsi
call   1030 <static_assert@plt>
xor    %edi,%edi
lea    0xef5(%rip),%rsi
call   1030 <static_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertions>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <static_assert@plt>
lea    0xeef(%rip),%rsi
xor    %edi,%edi
call   1030 <static_assert@plt>
lea    0xefa(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1030 <static_assert@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"incompatible float type\00"
@.str.1 = [25 x i8] c"incompatible double type\00"
@.str.2 = [26 x i8] c"incompatible pointer type\00"
define void @assertions() {
%1 = call i32 @static_assert(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @static_assert(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @static_assert(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"incompatible float type\00"
@.str.1 = [25 x i8] c"incompatible double type\00"
@.str.2 = [26 x i8] c"incompatible pointer type\00"
define void @assertions() {
%1 = tail call i32 @static_assert(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @static_assert(i32 0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @static_assert(i32 0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
ret void
}
int check_wchar_t() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_wchar_t() {
ret i32 0
}
int koi2num(int a) {
  static unsigned char t[32] = {30, 0,  1,  22, 4,  5,  20, 3,  21, 8,  9,
                                10, 11, 12, 13, 14, 15, 31, 16, 17, 18, 19,
                                6,  2,  28, 27, 7,  24, 29, 25, 23, 26};
  return (t[a & 31]);
}


x86 assembly (clang, -O0):
<koi2num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0x2f19(%rip),%rax
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<koi2num>:
and    $0x1f,%edi
lea    0xef6(%rip),%rax
movzbl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
@koi2num.t = internal global [32 x i8] c"\1E\00\01\16\04\05\14\03\15\08\09\0A\0B\0C\0D\0E\0F\1F\10\11\12\13\06\02\1C\1B\07\18\1D\19\17\1A"
define i32 @koi2num(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [32 x i8], [32 x i8]* @koi2num.t, i64 0, i64 %5
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@koi2num.t = internal unnamed_addr constant [32 x i8] c"\1E\00\01\16\04\05\14\03\15\08\09\0A\0B\0C\0D\0E\0F\1F\10\11\12\13\06\02\1C\1B\07\18\1D\19\17\1A"
define i32 @koi2num(i32 %0) {
%2 = and i32 %0, 31
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [32 x i8], [32 x i8]* @koi2num.t, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int c;

/* Variables and functions */
scalar_t__ isupper(int);
int tolower(int c) { return isupper(c) ? (c) - 'A' + 'a' : c; }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     113e <tolower+0x2e>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <tolower+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
push   %rbx
mov    %edi,%ebx
call   1030 <isupper@plt>
lea    0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isupper(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 65
%9 = add nsw i32 %8, 97
br label %12
10: ; preds = %1
%11 = load i32, i32* %2
br label %12
12: ; preds = %10, %6
%13 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = tail call i64 @isupper(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
void cx11646_stopN(struct usb_spca50x *spca50x) {}


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

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

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

LLVM IR (-O2):
%struct.usb_spca50x = type opaque
define void @cx11646_stopN(%struct.usb_spca50x* nocapture %0) {
ret void
}
int test_imm_83uint16_reg(unsigned short val) {
  return ((val) & (-0x83 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_83uint16_reg>:
test   $0xff7d,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_83uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -131
%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_83uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -131
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Gpm_Close();
void gpm_close(void) { Gpm_Close(); }


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

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

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

LLVM IR (-O2):
define void @gpm_close() {
%1 = tail call i32 (...) @Gpm_Close()
ret void
}
void save_early_sprs(struct thread_struct *prev) {}


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

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

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

LLVM IR (-O2):
%struct.thread_struct = type opaque
define void @save_early_sprs(%struct.thread_struct* nocapture %0) {
ret void
}
char *kerror(key, emess)
char *key, *emess;
{
  static char ebuf[80];
  (void)strcpy(ebuf, key);
  (void)strcat(ebuf, emess);
  return ebuf;
}


x86 assembly (clang, -O0):
<kerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f05(%rip),%rdi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0x2ef5(%rip),%rdi
call   1040 <strcat@plt>
lea    0x2ee9(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kerror>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0x2f0f(%rip),%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@kerror.ebuf = internal global [80 x i8] zeroinitializer
define i8* @kerror(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i8* @strcpy(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @kerror.ebuf, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %4
%8 = call i8* @strcat(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @kerror.ebuf, i64 0, i64 0), i8* %7)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @kerror.ebuf, i64 0, i64 0)
}

LLVM IR (-O2):
@kerror.ebuf = internal global [80 x i8] zeroinitializer
define i8* @kerror(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i8* @strcpy(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @kerror.ebuf, i64 0, i64 0), i8* dereferenceable(1) %0)
%4 = tail call i8* @strcat(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @kerror.ebuf, i64 0, i64 0), i8* dereferenceable(1) %1)
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @kerror.ebuf, i64 0, i64 0)
}
creat(name, mode) char *name;
{ return open(name, 1 | 0x0200 | 0x0100, mode); }


x86 assembly (clang, -O0):
<creat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    $0x301,%esi
mov    $0x0,%al
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    %esi,%edx
mov    $0x301,%esi
xor    %eax,%eax
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, i32, ...)*)(i8* %5, i32 769, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @creat(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 769, i32 %1)
ret i32 %3
}
void perfstats_print(void) {}


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

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

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

LLVM IR (-O2):
define void @perfstats_print() {
ret void
}
/* Variables and functions */
int errno;
int shutdown(int, int);
int os_shutdown(int sock, int how) {
  int retval;
  retval = shutdown(sock, how);
  if (retval == -1)
    retval = -errno;
  return retval;
}


x86 assembly (clang, -O0):
<os_shutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <shutdown@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1144 <os_shutdown+0x34>
xor    %eax,%eax
mov    0x2ea1(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_shutdown>:
push   %rax
call   1030 <shutdown@plt>
mov    0x2ec3(%rip),%rcx
xor    %edx,%edx
sub    (%rcx),%edx
cmp    $0xffffffff,%eax
cmove  %edx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @os_shutdown(i32 %0, i32 %1) {
%3 = tail call i32 @shutdown(i32 %0, i32 %1)
%4 = icmp eq i32 %3, -1
%5 = load i32, i32* @errno
%6 = sub nsw i32 0, %5
%7 = select i1 %4, i32 %6, i32 %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "%s: [-t] [inputfile|-] [outputfile|-]\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"%s: [-t] [inputfile|-] [outputfile|-]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"%s: [-t] [inputfile|-] [outputfile|-]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void setupNVIC() {
  *((volatile uint32_t *)0xe000e100) |= (1 << 11);
  *((volatile uint32_t *)0xe000e100) |= (1 << 1);
  *((volatile uint32_t *)0xe000e100) |= (1 << 26);
}


x86 assembly (clang, -O0):
<setupNVIC>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000e100,%eax
mov    (%rax),%ecx
or     $0x800,%ecx
mov    $0xe000e100,%eax
mov    %ecx,(%rax)
mov    $0xe000e100,%eax
mov    (%rax),%ecx
or     $0x2,%ecx
mov    $0xe000e100,%eax
mov    %ecx,(%rax)
mov    $0xe000e100,%eax
mov    (%rax),%ecx
or     $0x4000000,%ecx
mov    $0xe000e100,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupNVIC>:
mov    $0xe000e100,%eax
orl    $0x800,(%rax)
orl    $0x2,(%rax)
orl    $0x4000000,(%rax)
ret

LLVM IR (-O0):
define void @setupNVIC() {
%1 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%2 = or i32 %1, 2048
store volatile i32 %2, i32* inttoptr (i64 3758153984 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%4 = or i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 3758153984 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%6 = or i32 %5, 67108864
store volatile i32 %6, i32* inttoptr (i64 3758153984 to i32*)
ret void
}

LLVM IR (-O2):
define void @setupNVIC() {
%1 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%2 = or i32 %1, 2048
store volatile i32 %2, i32* inttoptr (i64 3758153984 to i32*)
%3 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%4 = or i32 %3, 2
store volatile i32 %4, i32* inttoptr (i64 3758153984 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 3758153984 to i32*)
%6 = or i32 %5, 67108864
store volatile i32 %6, i32* inttoptr (i64 3758153984 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "Usage: cleantmp [-d[level]] [-i file ] ... -days|-f directory ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: cleantmp [-d[level]] [-i file ] ... -days|-f directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [67 x i8] c"Usage: cleantmp [-d[level]] [-i file ] ... -days|-f directory ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void cafebabe_constant_info_double_deinit(
    struct cafebabe_constant_info_double *d) {}


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

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

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

LLVM IR (-O2):
%struct.cafebabe_constant_info_double = type opaque
define void @cafebabe_constant_info_double_deinit(%struct.cafebabe_constant_info_double* nocapture %0) {
ret void
}
/* Variables and functions */
int hb_layout_to_mode(int);
int hb_mixdown_to_mode(int);
int hb_need_downmix(int layout, int mixdown) {
  int mode_in, mode_out;
  mode_in = hb_layout_to_mode(layout);
  mode_out = hb_mixdown_to_mode(mixdown);
  return (mode_in != mode_out);
}


x86 assembly (clang, -O0):
<hb_need_downmix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <hb_layout_to_mode@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <hb_mixdown_to_mode@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hb_need_downmix>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
call   1040 <hb_layout_to_mode@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <hb_mixdown_to_mode@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hb_need_downmix(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = call i32 @hb_layout_to_mode(i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @hb_mixdown_to_mode(i32 %9)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = icmp ne i32 %11, %12
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @hb_need_downmix(i32 %0, i32 %1) {
%3 = tail call i32 @hb_layout_to_mode(i32 %0)
%4 = tail call i32 @hb_mixdown_to_mode(i32 %1)
%5 = icmp ne i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int switch4(unsigned a) {
  switch (a) {
  case -2:
    return 1;
  case -1:
    return a + 3;
  case 3:
    return a + 3;
  default:
    return 44;
  }
}


x86 assembly (clang, -O0):
<switch4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xfffffffe,%eax
je     113d <switch4+0x3d>
jmp    111b <switch4+0x1b>
mov    -0xc(%rbp),%eax
sub    $0xffffffff,%eax
je     1149 <switch4+0x49>
jmp    112c <switch4+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     1157 <switch4+0x57>
jmp    1165 <switch4+0x65>
movl   $0x1,-0x4(%rbp)
jmp    116c <switch4+0x6c>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <switch4+0x6c>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <switch4+0x6c>
movl   $0x2c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch4>:
add    $0x2,%edi
mov    $0x2c,%eax
cmp    $0x5,%edi
ja     111a <switch4+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @switch4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 -2, label %5
i32 -1, label %6
i32 3, label %9
]
5: ; preds = %1
store i32 1, i32* %2
br label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add i32 %7, 3
store i32 %8, i32* %2
br label %13
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add i32 %10, 3
store i32 %11, i32* %2
br label %13
12: ; preds = %1
store i32 44, i32* %2
br label %13
13: ; preds = %12, %9, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.switch4 = [6 x i32] [i32 1, i32 2, i32 44, i32 44, i32 44, i32 6]
define i32 @switch4(i32 %0) {
%2 = add i32 %0, 2
%3 = icmp ult i32 %2, 6
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.switch4, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 44, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int errno;
int main() {
  errno = 1;
  assert(errno);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
movl   $0x1,(%rax)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
movl   $0x1,(%rax)
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
store i32 1, i32* @errno
%2 = load i32, i32* @errno
%3 = call i32 @assert(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @main() {
store i32 1, i32* @errno
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void htmlfooters(FILE *fp) { fputs("</body>\n</html>\n", fp); }


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

x86 assembly (clang, -O2):
<htmlfooters>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"</body>\0A</html>\0A\00"
define void @htmlfooters(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"</body>\0A</html>\0A\00"
define void @htmlfooters(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i64 16, i64 1, i32* %0)
ret void
}