xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void QEIIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000028))) = ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<QEIIntClear>:
mov    %rsi,0x28(%rdi)
ret

LLVM IR (-O0):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 40
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @QEIIntClear(i64 %0, i64 %1) {
%3 = add i64 %0, 40
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
float int16_sample(unsigned char hi, unsigned char lo) {
  int sign = hi & (1 << 7);
  int v = (((int)(hi)&0x7f) << 8) | (int)lo;
  if (sign) {
    v = -0x8000 + v;
  }
  return v * 1.f / 0x8000;
}


x86 assembly (clang, -O0):
<int16_sample>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x80,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x7f,%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <int16_sample+0x44>
mov    -0xc(%rbp),%eax
add    $0xffff8000,%eax
mov    %eax,-0xc(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
movss  0xeb3(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xea3(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<int16_sample>:
mov    %edi,%eax
and    $0x7f,%eax
shl    $0x8,%eax
lea    (%rax,%rsi,1),%ecx
test   $0x80,%dil
lea    -0x8000(%rax,%rsi,1),%eax
cmove  %ecx,%eax
cvtsi2ss %eax,%xmm0
mulss  0xedb(%rip),%xmm0
ret

LLVM IR (-O0):
define float @int16_sample(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = and i32 %8, 128
store i32 %9, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %11, 127
%13 = shl i32 %12, 8
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i32, i32* %5
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = load i32, i32* %6
%21 = add nsw i32 -32768, %20
store i32 %21, i32* %6
br label %22
22: ; preds = %19, %2
%23 = load i32, i32* %6
%24 = sitofp i32 %23 to float
%25 = fmul float %24, 1.000000e+00
%26 = fdiv float %25, 3.276800e+04
ret float %26
}

LLVM IR (-O2):
define float @int16_sample(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = and i32 %3, 128
%5 = shl nuw nsw i32 %3, 8
%6 = and i32 %5, 32512
%7 = zext i8 %1 to i32
%8 = or i32 %6, %7
%9 = icmp eq i32 %4, 0
%10 = or i32 %8, -32768
%11 = select i1 %9, i32 %8, i32 %10
%12 = sitofp i32 %11 to float
%13 = fmul float %12, 0x3F00000000000000
ret float %13
}
/* Variables and functions */
int xx_final();
int xx(void) { return xx_final(); }


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

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

LLVM IR (-O0):
define i32 @xx() {
%1 = call i32 (...) @xx_final()
ret i32 %1
}

LLVM IR (-O2):
define i32 @xx() {
%1 = tail call i32 (...) @xx_final()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnb(long long);
void ft_putnbr(int n) {
  long long num;
  num = n;
  if (n < 0) {
    ft_putchar('-');
    num *= -1;
  }
  ft_putnb(num);
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1150 <ft_putnbr+0x30>
mov    $0x2d,%edi
call   1040 <ft_putchar@plt>
imul   $0xffffffffffffffff,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_putnb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbx
movslq %edi,%rbx
test   %ebx,%ebx
jns    1135 <ft_putnbr+0x15>
mov    $0x2d,%edi
call   1040 <ft_putchar@plt>
neg    %rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ft_putnb@plt>

LLVM IR (-O0):
define void @ft_putnbr(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
store i64 %5, i64* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @ft_putchar(i8 signext 45)
%10 = load i64, i64* %3
%11 = mul nsw i64 %10, -1
store i64 %11, i64* %3
br label %12
12: ; preds = %8, %1
%13 = load i64, i64* %3
%14 = call i32 @ft_putnb(i64 %13)
ret void
}

LLVM IR (-O2):
define void @ft_putnbr(i32 %0) {
%2 = sext i32 %0 to i64
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @ft_putchar(i8 signext 45)
%6 = sub nsw i64 0, %2
br label %7
7: ; preds = %4, %1
%8 = phi i64 [ %6, %4 ], [ %2, %1 ]
%9 = tail call i32 @ft_putnb(i64 %8)
ret void
}
/* Variables and functions */
int setjmp(void *);
int sigsetjmp(void *a, int x) { return setjmp(a); }


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

x86 assembly (clang, -O2):
<sigsetjmp>:
push   %rax
call   1030 <setjmp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sigsetjmp(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 = call i32 @setjmp(i8* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @sigsetjmp(i8* %0, i32 %1) {
%3 = call i32 @setjmp(i8* %0)
ret i32 %3
}
int do_bnode_destroy(struct stp_bnode *node) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.stp_bnode = type opaque
define i32 @do_bnode_destroy(%struct.stp_bnode* nocapture readnone %0) {
ret i32 -1
}
void Osal_platformSpiCsEnter(void) { return; }


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

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

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

LLVM IR (-O2):
define void @Osal_platformSpiCsEnter() {
ret void
}
/* Variables and functions */
int detectPresence(char *);
scalar_t__ graphicMode();
int notifysendPresent() {
  static int lNotifysendPresent = -1;
  if (lNotifysendPresent < 0) {
    lNotifysendPresent = detectPresence("notify-send");
  }
  return lNotifysendPresent && graphicMode();
}


x86 assembly (clang, -O0):
<notifysendPresent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0x0,0x2f01(%rip)
jge    1147 <notifysendPresent+0x27>
lea    0xec4(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2ee9(%rip)
xor    %eax,%eax
cmpl   $0x0,0x2ee0(%rip)
mov    %al,-0x1(%rbp)
je     116a <notifysendPresent+0x4a>
mov    $0x0,%al
call   1030 <graphicMode@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<notifysendPresent>:
push   %rax
mov    0x2f09(%rip),%eax
test   %eax,%eax
js     1143 <notifysendPresent+0x23>
test   %eax,%eax
je     1159 <notifysendPresent+0x39>
xor    %eax,%eax
call   1030 <graphicMode@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
lea    0xeb6(%rip),%rdi
call   1040 <detectPresence@plt>
mov    %eax,0x2edb(%rip)
test   %eax,%eax
jne    112f <notifysendPresent+0xf>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@notifysendPresent.lNotifysendPresent = internal global i32 -1
@.str = [12 x i8] c"notify-send\00"
define i32 @notifysendPresent() {
%1 = load i32, i32* @notifysendPresent.lNotifysendPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @detectPresence(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @notifysendPresent.lNotifysendPresent
br label %5
5: ; preds = %3, %0
%6 = load i32, i32* @notifysendPresent.lNotifysendPresent
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@notifysendPresent.lNotifysendPresent = internal unnamed_addr global i32 -1
@.str = [12 x i8] c"notify-send\00"
define i32 @notifysendPresent() {
%1 = load i32, i32* @notifysendPresent.lNotifysendPresent
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @detectPresence(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* @notifysendPresent.lNotifysendPresent
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %5
%9 = tail call i64 (...) @graphicMode()
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void out_of_memory(void) {
  fprintf(stderr, "Out of memory...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<out_of_memory>:
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):
<out_of_memory>:
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 = [18 x i8] c"Out of memory...\0A\00"
define void @out_of_memory() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Out of memory...\0A\00"
define void @out_of_memory() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ glTranslated(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/);
void Translated(GLdouble dx, GLdouble dy, GLdouble dz) {
  glTranslated(dx, dy, dz);
}


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

x86 assembly (clang, -O2):
<Translated>:
jmp    1030 <glTranslated@plt>

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

LLVM IR (-O2):
define void @Translated(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @glTranslated(i32 %0, i32 %1, i32 %2)
ret void
}
void ns_event_loop_mutex_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ns_event_loop_mutex_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ f();
main() {
  if (f())
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
cmp    $0x0,%rax
je     1157 <main+0x27>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <f@plt>
test   %rax,%rax
jne    1144 <main+0x14>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @f()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @f()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, int /*<<< orphan*/ *);
void end_doc() { write("json-task.json", "}\n", NULL); }


x86 assembly (clang, -O0):
<end_doc>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<end_doc>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %edx,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @end_doc() {
%1 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @end_doc() {
%1 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
int test_imm_F8int16_mem(short *val) {
  return ((*val) & (-0xF8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F8int16_mem>:
movzwl (%rdi),%eax
test   $0xff08,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_F8int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -248
%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_F8int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -248
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int e(void) {
  const int x = 0;
  return 0;
}


x86 assembly (clang, -O0):
<e>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @e() {
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
uint8_t data_fragments(uint8_t dataSize, uint8_t fragMaxSize) {
  uint8_t frags = (uint8_t)(1 + ((((int16_t)dataSize) - 1) / fragMaxSize));
  if (frags == 0) {
    return 1;
  }
  return frags;
}


x86 assembly (clang, -O0):
<data_fragments>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0xc(%rbp)
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1130 <data_fragments+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1136 <data_fragments+0x36>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_fragments>:
lea    -0x1(%rdi),%eax
cltd
idiv   %esi
inc    %eax
mov    $0x1,%ecx
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @data_fragments(i32 %0, i32 %1) {
%3 = add nsw i32 %0, -1
%4 = sdiv i32 %3, %1
%5 = add nsw i32 %4, 1
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 1, i32 %5
ret i32 %7
}
/* Type definitions */
struct http_header_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ http_header_add_alloced(struct http_header_list *,
                                           char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strdup(char const *);
void http_header_add(struct http_header_list *headers, const char *key,
                     const char *value) {
  http_header_add_alloced(headers, key, strdup(value));
}


x86 assembly (clang, -O0):
<http_header_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strdup@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <http_header_add_alloced@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<http_header_add>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1040 <strdup@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <http_header_add_alloced@plt>

LLVM IR (-O0):
%struct.http_header_list = type { i32 }
define void @http_header_add(%struct.http_header_list* %0, i8* %1, i8* %2) {
%4 = alloca %struct.http_header_list*
%5 = alloca i8*
%6 = alloca i8*
store %struct.http_header_list* %0, %struct.http_header_list** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.http_header_list*, %struct.http_header_list** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @strdup(i8* %9)
%11 = call i32 @http_header_add_alloced(%struct.http_header_list* %7, i8* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.http_header_list = type { i32 }
define void @http_header_add(%struct.http_header_list* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strdup(i8* %2)
%5 = tail call i32 @http_header_add_alloced(%struct.http_header_list* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int analog(int);
int detect_side(int sensor) {
  int result = -1;
  if (analog(sensor) > 100) {
    result = 1;
  } else {
    result = 0;
  }
  return result;
}


x86 assembly (clang, -O0):
<detect_side>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <analog@plt>
cmp    $0x64,%eax
jle    113f <detect_side+0x2f>
movl   $0x1,-0x8(%rbp)
jmp    1146 <detect_side+0x36>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<detect_side>:
push   %rax
call   1030 <analog@plt>
xor    %ecx,%ecx
cmp    $0x65,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @detect_side(i32 %0) {
%2 = tail call i32 @analog(i32 %0)
%3 = icmp sgt i32 %2, 100
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage: \n  iwas4gdou <-a> <-i interface> <-u user> [-p password] "
         "[-options]\n\n  iwas4gdou <-d> <-i interface>\n\nExamples: \n  # "
         "De-authenticate first if necessary, then authenticate and perform "
         "re-authenticate\n  iwas4gdou -ar -i eth0 -u zjlanhb302000 -p "
         "02302000\n\n  # De-authenticate\n  iwas4gdou -d -i eth0\n\nTry `man "
         "iwas4gdou' to get more information.\n\n");
}


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

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

LLVM IR (-O0):
@.str = [351 x i8] c"Usage: \0A iwas4gdou <-a> <-i interface> <-u user> [-p password] [-options]\0A\0A iwas4gdou <-d> <-i interface>\0A\0AExamples: \0A # De-authenticate first if necessary, then authenticate and perform re-authenticate\0A iwas4gdou -ar -i eth0 -u zjlanhb302000 -p 02302000\0A\0A # De-authenticate\0A iwas4gdou -d -i eth0\0A\0ATry `man iwas4gdou' to get more information.\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([351 x i8], [351 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [350 x i8] c"Usage: \0A iwas4gdou <-a> <-i interface> <-u user> [-p password] [-options]\0A\0A iwas4gdou <-d> <-i interface>\0A\0AExamples: \0A # De-authenticate first if necessary, then authenticate and perform re-authenticate\0A iwas4gdou -ar -i eth0 -u zjlanhb302000 -p 02302000\0A\0A # De-authenticate\0A iwas4gdou -d -i eth0\0A\0ATry `man iwas4gdou' to get more information.\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([350 x i8], [350 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f1(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int c = f1(1, 1);
  printf("%d\n", c);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1040 <f1@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f1(i32 1, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int get_gcd(int, int);
void reduce_fraction(int *a, int *b) {
  int gcd = get_gcd(*a, *b);
  *a /= gcd;
  *b /= gcd;
}


x86 assembly (clang, -O0):
<reduce_fraction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <get_gcd@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reduce_fraction>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1030 <get_gcd@plt>
mov    %eax,%ecx
mov    (%rbx),%eax
cltd
idiv   %ecx
mov    %eax,(%rbx)
mov    (%r14),%eax
cltd
idiv   %ecx
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @reduce_fraction(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* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = call i32 @get_gcd(i32 %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = sdiv i32 %13, %11
store i32 %14, i32* %12
%15 = load i32, i32* %5
%16 = load i32*, i32** %4
%17 = load i32, i32* %16
%18 = sdiv i32 %17, %15
store i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @reduce_fraction(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = tail call i32 @get_gcd(i32 %3, i32 %4)
%6 = load i32, i32* %0
%7 = sdiv i32 %6, %5
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = sdiv i32 %8, %5
store i32 %9, i32* %1
ret void
}
void CrashLog_LogError(char *buffer) {
  (void)buffer;
  ;
}


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

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

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

LLVM IR (-O2):
define void @CrashLog_LogError(i8* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ isdigit(char const);
int str_isdigit(const char *s) {
  while (isdigit(*s))
    s++;
  return *s == '\0';
}


x86 assembly (clang, -O0):
<str_isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1143 <str_isdigit+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_isdigit+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_isdigit>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <str_isdigit+0x10>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rbx)
sete   %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @str_isdigit(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isdigit(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
void glStencilOpSeparate(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glStencilOpSeparate() {
ret void
}
/* Type definitions */
struct device_node {
  int dummy;
};
typedef enum of_gpio_flags { ____Placeholder_of_gpio_flags } of_gpio_flags;

/* Variables and functions */
int of_get_named_gpio_flags(struct device_node *, char *, int, int *);
int of_get_gpio_flags(struct device_node *np, int index,
                      enum of_gpio_flags *flags) {
  return of_get_named_gpio_flags(np, "gpios", index, flags);
}


x86 assembly (clang, -O0):
<of_get_gpio_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rsi
call   1030 <of_get_named_gpio_flags@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<of_get_gpio_flags>:
mov    %rdx,%rcx
mov    %esi,%edx
lea    0xee4(%rip),%rsi
jmp    1030 <of_get_named_gpio_flags@plt>

LLVM IR (-O0):
%struct.device_node = type { i32 }
@.str = [6 x i8] c"gpios\00"
define i32 @of_get_gpio_flags(%struct.device_node* %0, i32 %1, i32* %2) {
%4 = alloca %struct.device_node*
%5 = alloca i32
%6 = alloca i32*
store %struct.device_node* %0, %struct.device_node** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load %struct.device_node*, %struct.device_node** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call i32 @of_get_named_gpio_flags(%struct.device_node* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.device_node = type { i32 }
@.str = [6 x i8] c"gpios\00"
define i32 @of_get_gpio_flags(%struct.device_node* %0, i32 %1, i32* %2) {
%4 = tail call i32 @of_get_named_gpio_flags(%struct.device_node* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %1, i32* %2)
ret i32 %4
}
unsigned transform_shift(int modif) {
  if (!modif)
    return 0;
  else
    return (1 << (modif - 1));
}


x86 assembly (clang, -O0):
<transform_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <transform_shift+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    112d <transform_shift+0x2d>
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform_shift>:
lea    -0x1(%rdi),%ecx
mov    $0x1,%edx
shl    %cl,%edx
xor    %eax,%eax
cmp    $0x1,%edi
cmovae %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @transform_shift(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = shl nuw i32 1, %3
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
int xmlUCSIsMiscellaneousMathematicalSymbolsB(int code) {
  return (((code >= 0x2980) && (code <= 0x29FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsMiscellaneousMathematicalSymbolsB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2980,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsMiscellaneousMathematicalSymbolsB+0x26>
cmpl   $0x29ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsMiscellaneousMathematicalSymbolsB>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0x2980,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsMiscellaneousMathematicalSymbolsB(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 10624
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strlcpy(char *dest, const char *src, size_t n) {
  strncpy(dest, src, n);
  if (strlen(src) >= n)
    dest[n] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strlcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    -0x18(%rbp),%rax
jb     1164 <strlcpy+0x44>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
call   1030 <strncpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    %r14,%rax
jb     1145 <strlcpy+0x25>
movb   $0x0,(%r15,%r14,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strlcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
%11 = load i8*, i8** %5
%12 = call i64 @strlen(i8* %11)
%13 = load i64, i64* %6
%14 = icmp uge i64 %12, %13
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i8*, i8** %4
%17 = load i64, i64* %6
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 0, i8* %18
br label %19
19: ; preds = %15, %3
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
define i8* @strlcpy(i8* returned %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = icmp ult i64 %5, %2
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %0, i64 %2
store i8 0, i8* %8
br label %9
9: ; preds = %7, %3
ret i8* %0
}
char *Clone(string)
char *string;
{
  register char *retval;
  retval = (char *)malloc(strlen(string) + 1);
  if (retval) {
    strcpy(retval, string);
  }
  return (retval);
}


x86 assembly (clang, -O0):
<Clone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <Clone+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clone>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <Clone+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @Clone(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i8* @strcpy(i8* %4, i8* dereferenceable(1) %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void reset(void) {}


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

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

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

LLVM IR (-O2):
define void @reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void Signup_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/cut_frame");
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @Signup_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"menu/art_blueish/cut_frame\00"
define void @Signup_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
void mem_module_init(void) {}


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

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

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

LLVM IR (-O2):
define void @mem_module_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int x, y, z;
  printf("Bye world!\n");
  printf("/* Troll comment */");
  printf("Other troll string \"LolLOL\"");
  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>
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Bye world!\0A\00"
@.str.1 = [20 x i8] c"/* Troll comment */\00"
@.str.2 = [28 x i8] c"Other troll string \22LolLOL\22\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [20 x i8] c"/* Troll comment */\00"
@.str.2 = [28 x i8] c"Other troll string \22LolLOL\22\00"
@str = [11 x i8] c"Bye world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CX4_immediate_reg(int);
void CX4_op7a(void) { CX4_immediate_reg(42); }


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

x86 assembly (clang, -O2):
<CX4_op7a>:
mov    $0x2a,%edi
jmp    1030 <CX4_immediate_reg@plt>

LLVM IR (-O0):
define void @CX4_op7a() {
%1 = call i32 @CX4_immediate_reg(i32 42)
ret void
}

LLVM IR (-O2):
define void @CX4_op7a() {
%1 = tail call i32 @CX4_immediate_reg(i32 42)
ret void
}
int fun404() { return 404; }


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

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

LLVM IR (-O0):
define i32 @fun404() {
ret i32 404
}

LLVM IR (-O2):
define i32 @fun404() {
ret i32 404
}
int ad_init(int idx) {}


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

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

LLVM IR (-O0):
define i32 @ad_init(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 @ad_init(i32 %0) {
ret i32 undef
}
int dwc_otg_pcd_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dwc_otg_pcd_init() {
ret i32 0
}
unsigned int get_unaligned_uint32(void *p) {
  struct {
    unsigned int d;
  } __attribute__((packed)) *pp = (void *)p;
  return pp->d;
}


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

x86 assembly (clang, -O2):
<get_unaligned_uint32>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @get_unaligned_uint32(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_unaligned_uint32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
double swe_deltat(double);
double deltat(double jd_ad) { return swe_deltat(jd_ad + 2433282.0); }


x86 assembly (clang, -O0):
<deltat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1030 <swe_deltat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deltat>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <swe_deltat@plt>

LLVM IR (-O0):
define double @deltat(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 0x4142908100000000
%5 = call double @swe_deltat(double %4)
ret double %5
}

LLVM IR (-O2):
define double @deltat(double %0) {
%2 = fadd double %0, 0x4142908100000000
%3 = tail call double @swe_deltat(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void practice2D11() {
  int x = 0x55;
  printf("0x%x\n", x << 3);
  printf("0x%x\n", x >> 2);
}


x86 assembly (clang, -O0):
<practice2D11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x55,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x3,%esi
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
sar    $0x2,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<practice2D11>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2a8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x15,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"0x%x\0A\00"
define void @practice2D11() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 680)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 21)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void str_free_value_func(void *value) { free((char *)value); }


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

LLVM IR (-O0):
define void @str_free_value_func(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 @str_free_value_func(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int is_head(unsigned char *b) {
  if (b[0] == '*' && b[1] == '*' && b[2] == '*' && b[3] == '*')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_head>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x2a,%eax
jne    1157 <is_head+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0x2a,%eax
jne    1157 <is_head+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
cmp    $0x2a,%eax
jne    1157 <is_head+0x57>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x2a,%eax
jne    1157 <is_head+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <is_head+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_head>:
cmpb   $0x2a,(%rdi)
jne    111c <is_head+0x1c>
cmpb   $0x2a,0x1(%rdi)
jne    111c <is_head+0x1c>
cmpb   $0x2a,0x2(%rdi)
jne    111c <is_head+0x1c>
mov    $0x1,%eax
cmpb   $0x2a,0x3(%rdi)
je     111e <is_head+0x1e>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_head(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 42
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 42
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 42
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 42
br i1 %15, label %17, label %16
16: ; preds = %12, %8, %4, %1
br label %17
17: ; preds = %12, %16
%18 = phi i32 [ 0, %16 ], [ 1, %12 ]
ret i32 %18
}