xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sem_t;

/* Variables and functions */
int /*<<< orphan*/ *sem_open(char const *, int);
extern sem_t *_swift_Platform_sem_open2(const char *name, int oflag) {
  return sem_open(name, oflag);
}


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

x86 assembly (clang, -O2):
<_swift_Platform_sem_open2>:
jmp    1030 <sem_open@plt>

LLVM IR (-O0):
define i32* @_swift_Platform_sem_open2(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* @sem_open(i8* %5, i32 %6)
ret i32* %7
}

LLVM IR (-O2):
define i32* @_swift_Platform_sem_open2(i8* %0, i32 %1) {
%3 = tail call i32* @sem_open(i8* %0, i32 %1)
ret i32* %3
}
/* Type definitions */
struct xrdp_painter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ g_free(struct xrdp_painter *);
void xrdp_painter_delete(struct xrdp_painter *self) {
  if (self == 0) {
    return;
  }
  g_free(self);
}


x86 assembly (clang, -O0):
<xrdp_painter_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <xrdp_painter_delete+0x1c>
jmp    1135 <xrdp_painter_delete+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <g_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrdp_painter_delete>:
test   %rdi,%rdi
je     111a <xrdp_painter_delete+0xa>
jmp    1030 <g_free@plt>
ret

LLVM IR (-O0):
%struct.xrdp_painter = type { i32 }
define void @xrdp_painter_delete(%struct.xrdp_painter* %0) {
%2 = alloca %struct.xrdp_painter*
store %struct.xrdp_painter* %0, %struct.xrdp_painter** %2
%3 = load %struct.xrdp_painter*, %struct.xrdp_painter** %2
%4 = icmp eq %struct.xrdp_painter* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.xrdp_painter*, %struct.xrdp_painter** %2
%8 = call i32 @g_free(%struct.xrdp_painter* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.xrdp_painter = type { i32 }
define void @xrdp_painter_delete(%struct.xrdp_painter* %0) {
%2 = icmp eq %struct.xrdp_painter* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @g_free(%struct.xrdp_painter* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void value_to_rwx(unsigned value) {
  if (value & 4) {
    putchar('r');
  } else {
    putchar('-');
  }
  if (value & 2) {
    putchar('w');
  } else {
    putchar('-');
  }
  if (value & 1) {
    putchar('x');
  } else {
    putchar('-');
  }
}


x86 assembly (clang, -O0):
<value_to_rwx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1139 <value_to_rwx+0x29>
mov    $0x72,%edi
call   1030 <putchar@plt>
jmp    1143 <value_to_rwx+0x33>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1161 <value_to_rwx+0x51>
mov    $0x77,%edi
call   1030 <putchar@plt>
jmp    116b <value_to_rwx+0x5b>
mov    $0x2d,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1189 <value_to_rwx+0x79>
mov    $0x78,%edi
call   1030 <putchar@plt>
jmp    1193 <value_to_rwx+0x83>
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_to_rwx>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
test   $0x4,%bl
mov    $0x2d,%ebp
mov    $0x72,%edi
cmove  %ebp,%edi
call   1030 <putchar@plt>
test   $0x2,%bl
mov    $0x77,%edi
cmove  %ebp,%edi
call   1030 <putchar@plt>
test   $0x1,%bl
mov    $0x78,%edi
cmove  %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @value_to_rwx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @putchar(i8 signext 114)
br label %10
8: ; preds = %1
%9 = call i32 @putchar(i8 signext 45)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @putchar(i8 signext 119)
br label %18
16: ; preds = %10
%17 = call i32 @putchar(i8 signext 45)
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %2
%20 = and i32 %19, 1
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @putchar(i8 signext 120)
br label %26
24: ; preds = %18
%25 = call i32 @putchar(i8 signext 45)
br label %26
26: ; preds = %24, %22
ret void
}

LLVM IR (-O2):
define void @value_to_rwx(i32 %0) {
%2 = and i32 %0, 4
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8 45, i8 114
%5 = tail call i32 @putchar(i8 signext %4)
%6 = and i32 %0, 2
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8 45, i8 119
%9 = tail call i32 @putchar(i8 signext %8)
%10 = and i32 %0, 1
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i8 45, i8 120
%13 = tail call i32 @putchar(i8 signext %12)
ret void
}
int abs(int x) { return (x < 0) ? -x : x; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <abs+0x1e>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sub nsw i32 0, %6
br label %10
8: ; preds = %1
%9 = load i32, i32* %2
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ geraValoresVetor(int *);
int main() {
  int v[15];
  geraValoresVetor(v);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <geraValoresVetor@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1030 <geraValoresVetor@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [15 x i32]
%2 = bitcast [15 x i32]* %1 to i8*
%3 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 0
%4 = call i32 @geraValoresVetor(i32* %3)
ret i32 0
}
/* Variables and functions */
unsigned char *fptr_capi20_get_serial_number(unsigned int, unsigned char *);
scalar_t__ loadlib();
unsigned char *capi20_get_serial_number(unsigned Ctrl, unsigned char *Buf) {
  if (loadlib() < 0)
    return "";
  return fptr_capi20_get_serial_number(Ctrl, Buf);
}


x86 assembly (clang, -O0):
<capi20_get_serial_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x0,%al
call   1040 <loadlib@plt>
cmp    $0x0,%rax
jge    1150 <capi20_get_serial_number+0x30>
lea    0xeb9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <capi20_get_serial_number+0x40>
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <fptr_capi20_get_serial_number@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capi20_get_serial_number>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <loadlib@plt>
test   %rax,%rax
js     1144 <capi20_get_serial_number+0x24>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fptr_capi20_get_serial_number@plt>
lea    0xeb5(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @capi20_get_serial_number(i32 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = call i64 (...) @loadlib()
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i8*, i8** %5
%12 = call i8* @fptr_capi20_get_serial_number(i32 %10, i8* %11)
store i8* %12, i8** %3
br label %13
13: ; preds = %9, %8
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @capi20_get_serial_number(i32 %0, i8* %1) {
%3 = tail call i64 (...) @loadlib()
%4 = icmp slt i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i8* @fptr_capi20_get_serial_number(i32 %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %8
}
/* Variables and functions */
scalar_t__ VIM_HIF_GetReg8(int);
unsigned long VIM_MARB_GetJbufUpThreshold(void) {
  unsigned long Length;
  Length = (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x028)));
  Length |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x027))) << 8;
  Length |= (unsigned long)(VIM_HIF_GetReg8((0x2400 + 0x026))) << 16;
  return Length;
}


x86 assembly (clang, -O0):
<VIM_MARB_GetJbufUpThreshold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2428,%edi
call   1030 <VIM_HIF_GetReg8@plt>
mov    %rax,-0x8(%rbp)
mov    $0x2427,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x8,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    $0x2426,%edi
call   1030 <VIM_HIF_GetReg8@plt>
shl    $0x10,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @VIM_MARB_GetJbufUpThreshold() {
%1 = tail call i64 @VIM_HIF_GetReg8(i32 9256)
%2 = tail call i64 @VIM_HIF_GetReg8(i32 9255)
%3 = shl i64 %2, 8
%4 = or i64 %3, %1
%5 = tail call i64 @VIM_HIF_GetReg8(i32 9254)
%6 = shl i64 %5, 16
%7 = or i64 %4, %6
ret i64 %7
}
void INT_Excep_ICU_IRQ0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ0() {
ret void
}
void foo460(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo460(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArbiterP__1__ResourceDefaultOwner__default__requested();
void ArbiterP__1__ResourceDefaultOwner__requested(void) {
  ArbiterP__1__ResourceDefaultOwner__default__requested();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__1__ResourceDefaultOwner__requested() {
%1 = tail call i32 (...) @ArbiterP__1__ResourceDefaultOwner__default__requested()
ret void
}
/* Variables and functions */
int CountLeadingZeroes(unsigned long);
unsigned long Log2Floor(unsigned long x) {
  return 32 - CountLeadingZeroes(x) - 1;
}


x86 assembly (clang, -O0):
<Log2Floor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <CountLeadingZeroes@plt>
mov    %eax,%ecx
mov    $0x20,%eax
sub    %ecx,%eax
sub    $0x1,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Log2Floor>:
push   %rax
call   1030 <CountLeadingZeroes@plt>
mov    $0x1f,%ecx
sub    %eax,%ecx
movslq %ecx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @Log2Floor(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @CountLeadingZeroes(i64 %3)
%5 = sub nsw i32 32, %4
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @Log2Floor(i64 %0) {
%2 = tail call i32 @CountLeadingZeroes(i64 %0)
%3 = sub i32 31, %2
%4 = sext i32 %3 to i64
ret i64 %4
}
char *parser_err_print_char(char *buf, const char *const end, char c) {
  if (buf < end)
    *buf++ = c;
  return buf;
}


x86 assembly (clang, -O0):
<parser_err_print_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1133 <parser_err_print_char+0x33>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_err_print_char>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    110e <parser_err_print_char+0xe>
mov    %dl,(%rax)
add    $0x1,%rax
ret

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

LLVM IR (-O2):
define i8* @parser_err_print_char(i8* writeonly %0, i8* readnone %1, i8 signext %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %2, i8* %0
br label %7
7: ; preds = %5, %3
%8 = phi i8* [ %6, %5 ], [ %0, %3 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t const);
int strlen(char const *);
char *xmalloc(int);
char *xstrdup(const char *str) {
  const size_t len = strlen(str) + 1;
  char *res = xmalloc(sizeof(char) * len);
  memcpy(res, str, len);
  return res;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15d,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @xmalloc(i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %2
%15 = load i64, i64* %3
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @xmalloc(i32 %3)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
int exists(const char *filename __attribute__((unused))) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @exists(i8* nocapture readnone %0) {
ret i32 0
}
int main(int argc, char *argv[]) {
  char *greeting = "Hello World";
  char msg[12];
  unsigned sz = 0;
  for (unsigned i = 0; i < 12; i += 1) {
    sz += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0xc,-0x2c(%rbp)
jae    114c <main+0x4c>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    112b <main+0x2b>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
const char *message(void) { return "right"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"right\00"
define i8* @message() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"right\00"
define i8* @message() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void g_type_module_register_type() {}


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

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

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

LLVM IR (-O2):
define void @g_type_module_register_type() {
ret void
}
void swap(char *str, int i, int j) {
  char tmp = str[i];
  str[i] = str[j];
  str[j] = tmp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,1),%sil
movslq %edx,%rdx
mov    (%rdi,%rdx,1),%cl
mov    %cl,(%rdi,%rax,1)
mov    %sil,(%rdi,%rdx,1)
ret

LLVM IR (-O0):
define void @swap(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
store i8 %12, i8* %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = load i8*, i8** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %7
%23 = load i8*, i8** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
store i8 %22, i8* %26
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %5
store i8 %6, i8* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cm_g711_a_law_encode_decode__value__is_encoded_decoded();
int /*<<< orphan*/ cm_g711_mu_law_encode_decode__value__is_encoded_decoded();
void cm_g711_run_tests(void) {
  cm_g711_mu_law_encode_decode__value__is_encoded_decoded();
  cm_g711_a_law_encode_decode__value__is_encoded_decoded();
}


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

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

LLVM IR (-O0):
define void @cm_g711_run_tests() {
%1 = call i32 (...) @cm_g711_mu_law_encode_decode__value__is_encoded_decoded()
%2 = call i32 (...) @cm_g711_a_law_encode_decode__value__is_encoded_decoded()
ret void
}

LLVM IR (-O2):
define void @cm_g711_run_tests() {
%1 = tail call i32 (...) @cm_g711_mu_law_encode_decode__value__is_encoded_decoded()
%2 = tail call i32 (...) @cm_g711_a_law_encode_decode__value__is_encoded_decoded()
ret void
}
unsigned char str2hexnum(unsigned char c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  if (c >= 'a' && c <= 'f')
    return c - 'a' + 10;
  return 0;
}


x86 assembly (clang, -O0):
<str2hexnum>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <str2hexnum+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <str2hexnum+0x33>
movzbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1163 <str2hexnum+0x63>
movzbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     115f <str2hexnum+0x5f>
movzbl -0x2(%rbp),%eax
cmp    $0x66,%eax
jg     115f <str2hexnum+0x5f>
movzbl -0x2(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    1163 <str2hexnum+0x63>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2hexnum>:
lea    -0x30(%rdi),%eax
lea    -0x61(%rdi),%ecx
add    $0xa9,%dil
xor    %edx,%edx
cmp    $0x6,%cl
movzbl %dil,%ecx
cmovae %edx,%ecx
cmp    $0xa,%al
movzbl %al,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @str2hexnum(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %31
16: ; preds = %7, %1
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = icmp sge i32 %18, 97
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = icmp sle i32 %22, 102
br i1 %23, label %24, label %30
24: ; preds = %20
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = sub nsw i32 %26, 97
%28 = add nsw i32 %27, 10
%29 = trunc i32 %28 to i8
store i8 %29, i8* %2
br label %31
30: ; preds = %20, %16
store i8 0, i8* %2
br label %31
31: ; preds = %30, %24, %11
%32 = load i8, i8* %2
ret i8 %32
}

LLVM IR (-O2):
define zeroext i8 @str2hexnum(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -97
%5 = icmp ult i8 %4, 6
%6 = add i8 %0, -87
%7 = select i1 %5, i8 %6, i8 0
%8 = select i1 %3, i8 %2, i8 %7
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("RaawwWWWWWRRRR!!\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"RaawwWWWWWRRRR!!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [17 x i8] c"RaawwWWWWWRRRR!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage: RNApaln [-Xpmfc] [-B [file]] [-T temp] [-4] [-d] [-noGU]\n"
          "               [-noCloseGU] [-noLP] [-P paramfile] [-nsp pairs]\n"
          "               [--gapo open] [--gape ext] [--seqw w] [--endgaps]\n");
}


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

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

LLVM IR (-O0):
@.str = [194 x i8] c"usage: RNApaln [-Xpmfc] [-B [file]] [-T temp] [-4] [-d] [-noGU]\0A [-noCloseGU] [-noLP] [-P paramfile] [-nsp pairs]\0A [--gapo open] [--gape ext] [--seqw w] [--endgaps]\0A\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [194 x i8] c"usage: RNApaln [-Xpmfc] [-B [file]] [-T temp] [-4] [-d] [-noGU]\0A [-noCloseGU] [-noLP] [-P paramfile] [-nsp pairs]\0A [--gapo open] [--gape ext] [--seqw w] [--endgaps]\0A\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *create_container(int /*<<< orphan*/, int);
int main(int argc, char **argv) {
  void *container = create_container(0, 14);
  return 14;
}


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)
xor    %edi,%edi
mov    $0xe,%esi
call   1030 <create_container@plt>
mov    %rax,-0x18(%rbp)
mov    $0xe,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0xe,%esi
call   1030 <create_container@plt>
mov    $0xe,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i8* @create_container(i32 0, i32 14)
store i8* %7, i8** %6
ret i32 14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @create_container(i32 0, i32 14)
ret i32 14
}
int prio(int a) {
  switch (a) {
  case 0:
    return 0;
  case 1:
  case 2:
    return 1;
  case 3:
  case 4:
    return 2;
  case 5:
  case 6:
    return 3;
  default:
    return 4;
  }
}


x86 assembly (clang, -O0):
<prio>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     115c <prio+0x5c>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,-0x4(%rbp)
jmp    1163 <prio+0x63>
movl   $0x1,-0x4(%rbp)
jmp    1163 <prio+0x63>
movl   $0x2,-0x4(%rbp)
jmp    1163 <prio+0x63>
movl   $0x3,-0x4(%rbp)
jmp    1163 <prio+0x63>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prio>:
mov    $0x4,%eax
cmp    $0x6,%edi
ja     1117 <prio+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.prio = [7 x i32] [i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3]
define i32 @prio(i32 %0) {
%2 = icmp ult i32 %0, 7
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.prio, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 4, %1 ]
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
void sg_put_unaligned_be16(uint16_t val, void *p) {
  ((uint8_t *)p)[0] = (uint8_t)(val >> 8);
  ((uint8_t *)p)[1] = (uint8_t)val;
}


x86 assembly (clang, -O0):
<sg_put_unaligned_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movslq -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_put_unaligned_be16>:
movslq %edi,%rax
sar    $0x8,%edi
movslq %edi,%rcx
mov    %rcx,(%rsi)
mov    %rax,0x8(%rsi)
ret

LLVM IR (-O0):
define void @sg_put_unaligned_be16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 8
%7 = sext i32 %6 to i64
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = getelementptr inbounds i64, i64* %9, i64 0
store i64 %7, i64* %10
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i64*
%15 = getelementptr inbounds i64, i64* %14, i64 1
store i64 %12, i64* %15
ret void
}

LLVM IR (-O2):
define void @sg_put_unaligned_be16(i32 %0, i8* nocapture writeonly %1) {
%3 = ashr i32 %0, 8
%4 = sext i32 %3 to i64
%5 = bitcast i8* %1 to i64*
store i64 %4, i64* %5
%6 = sext i32 %0 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 8
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
ret void
}
/* Variables and functions */
double pow(int, double);
double qDebaySI(double x) {
  return pow(24 * x / 3.14159265358979323846264338327950288419716939937510,
             1.0 / 3) *
         3.14159265358979323846264338327950288419716939937510 / 0.5633;
}


x86 assembly (clang, -O0):
<qDebaySI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
movsd  0xece(%rip),%xmm0
call   1030 <pow@plt>
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea5(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qDebaySI>:
push   %rax
mulsd  0xee7(%rip),%xmm0
divsd  0xee7(%rip),%xmm0
cvttsd2si %xmm0,%edi
movsd  0xee3(%rip),%xmm0
call   1030 <pow@plt>
mulsd  0xece(%rip),%xmm0
divsd  0xed6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @qDebaySI(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 2.400000e+01, %3
%5 = fdiv double %4, 0x400921FB54442D18
%6 = fptosi double %5 to i32
%7 = call double @pow(i32 %6, double 0x3FD5555555555555)
%8 = fmul double %7, 0x400921FB54442D18
%9 = fdiv double %8, 5.633000e-01
ret double %9
}

LLVM IR (-O2):
define double @qDebaySI(double %0) {
%2 = fmul double %0, 2.400000e+01
%3 = fdiv double %2, 0x400921FB54442D18
%4 = fptosi double %3 to i32
%5 = tail call double @pow(i32 %4, double 0x3FD5555555555555)
%6 = fmul double %5, 0x400921FB54442D18
%7 = fdiv double %6, 5.633000e-01
ret double %7
}
/* Variables and functions */
int inb(int);
void pause() {
  int i = 0;
  while (i < 100000000) {
    i++;
  }
  while (inb(0x60) & 0x80) {
  };
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5f5e100,-0x4(%rbp)
jge    113a <pause+0x2a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <pause+0xf>
jmp    113f <pause+0x2f>
mov    $0x60,%edi
call   1030 <inb@plt>
and    $0x80,%eax
cmp    $0x0,%eax
je     115c <pause+0x4c>
jmp    113f <pause+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x60,%edi
call   1030 <inb@plt>
test   $0x80,%al
jne    1120 <pause+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @pause() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %5, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 100000000
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %1
br label %2
8: ; preds = %2
br label %9
9: ; preds = %13, %8
%10 = call i32 @inb(i32 96)
%11 = and i32 %10, 128
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
br label %9
14: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @pause() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @inb(i32 96)
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "usage: genproj [-projfile <str> (defaults to "
          "proj_S#xD#_{date|seed})]\n\t[-D <n> (defaults to 39)]\n\t[-S <n> "
          "(defaults to 32)]\n\t[-seed <n> (defaults to date)]\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 = [157 x i8] c"usage: genproj [-projfile <str> (defaults to proj_S#xD#_{date|seed})]\0A\09[-D <n> (defaults to 39)]\0A\09[-S <n> (defaults to 32)]\0A\09[-seed <n> (defaults to date)]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [157 x i8] c"usage: genproj [-projfile <str> (defaults to proj_S#xD#_{date|seed})]\0A\09[-D <n> (defaults to 39)]\0A\09[-S <n> (defaults to 32)]\0A\09[-seed <n> (defaults to date)]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int foo(unsigned int sum) {
#pragma acc parallel reduction(+ : sum)
  { sum; }
  return sum;
}


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 returned %0) {
ret i32 %0
}
void stripme(void) { ; }


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

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

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

LLVM IR (-O2):
define void @stripme() {
ret void
}
int d_ble_rm2(double a1, double *a2) {
  return !(__builtin_islessequal(a1, *a2));
}


x86 assembly (clang, -O0):
<d_ble_rm2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_ble_rm2>:
movsd  (%rdi),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setb   %al
ret

LLVM IR (-O0):
define i32 @d_ble_rm2(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 = load double, double* %6
%8 = fcmp ole double %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @d_ble_rm2(double %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ult double %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 2;
  {
    int a = 3;
    printf("%d", a);
  }
  printf("%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
int swconfig_create_led_trigger(struct switch_dev *swdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.switch_dev = type opaque
define i32 @swconfig_create_led_trigger(%struct.switch_dev* nocapture readnone %0) {
ret i32 0
}
cont(x, y) int x, y;
{ printf("cont(%d,%d)\n", x, y); }


x86 assembly (clang, -O0):
<cont>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cont>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"cont(%d,%d)\0A\00"
define i32 @cont(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret i32 undef
}
int is_positive(int x) {
  if (x > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_positive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    111d <is_positive+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <is_positive+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_positive>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @is_positive(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_positive(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
void RTSocketRetain(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSocketRetain() {
ret void
}
void __attribute__((weak)) tim8_up_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<tim8_up_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tim8_up_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.tim8_up_isr = [12 x i8] c"tim8_up_isr\00"
define weak void @tim8_up_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.tim8_up_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.tim8_up_isr = [12 x i8] c"tim8_up_isr\00"
define weak void @tim8_up_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__FUNCTION__.tim8_up_isr, i64 0, i64 0))
ret void
}
void TIM0_IC12_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @TIM0_IC12_IRQHandler() {
ret void
}
const char *redroid_buildinfo(void) {
  return ({
    extern __typeof__(redroid_buildinfo) module_api_redroid_buildinfo;
    &module_api_redroid_buildinfo;
  })();
}


x86 assembly (clang, -O0):
<redroid_buildinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed9(%rip),%rax
mov    %rax,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redroid_buildinfo>:
jmp    1030 <module_api_redroid_buildinfo@plt>

LLVM IR (-O0):
define i8* @redroid_buildinfo() {
%1 = alloca i8* ()*
store i8* ()* @module_api_redroid_buildinfo, i8* ()** %1
%2 = load i8* ()*, i8* ()** %1
%3 = call i8* %2()
ret i8* %3
}

LLVM IR (-O2):
define i8* @redroid_buildinfo() {
%1 = tail call i8* @module_api_redroid_buildinfo()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ challenges_save();
void CG_Shutdown(void) { challenges_save(); }


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

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

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

LLVM IR (-O2):
define void @CG_Shutdown() {
%1 = tail call i32 (...) @challenges_save()
ret void
}
int test_imm_6Fuint16_mem(unsigned short *val) {
  return ((*val) & (0x6F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 111
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct mpeg {
  int dummy;
};

/* Variables and functions */
int mpeg_frame_length(struct mpeg *);
size_t mpeg_frame_bytes(struct mpeg *mpeg) {
  return (4 * mpeg_frame_length(mpeg));
}


x86 assembly (clang, -O0):
<mpeg_frame_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mpeg_frame_length@plt>
shl    $0x2,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpeg_frame_bytes>:
push   %rax
call   1030 <mpeg_frame_length@plt>
shl    $0x2,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.mpeg = type { i32 }
define i64 @mpeg_frame_bytes(%struct.mpeg* %0) {
%2 = alloca %struct.mpeg*
store %struct.mpeg* %0, %struct.mpeg** %2
%3 = load %struct.mpeg*, %struct.mpeg** %2
%4 = call i32 @mpeg_frame_length(%struct.mpeg* %3)
%5 = mul nsw i32 4, %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
%struct.mpeg = type { i32 }
define i64 @mpeg_frame_bytes(%struct.mpeg* %0) {
%2 = tail call i32 @mpeg_frame_length(%struct.mpeg* %0)
%3 = shl nsw i32 %2, 2
%4 = sext i32 %3 to i64
ret i64 %4
}
int leapyear(int year) {}


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

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

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

LLVM IR (-O2):
define i32 @leapyear(i32 %0) {
ret i32 undef
}