xunge/DecIR huggingface dataset:
int test_imm_25uint16_reg(unsigned short val) {
  return ((val) & (0x25 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_25uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 37
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned int tune9(unsigned int t) {
  return ((t * 9 & t >> 4) | (t * 5 & t >> 7) | ((t * 3) & (t / 1024))) - 1;
}


x86 assembly (clang, -O0):
<tune9>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x9,-0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    %ecx,%eax
imul   $0x5,-0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
shr    $0x7,%edx
and    %edx,%ecx
or     %ecx,%eax
imul   $0x3,-0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
shr    $0xa,%edx
and    %edx,%ecx
or     %ecx,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tune9>:
lea    (%rdi,%rdi,8),%eax
mov    %edi,%ecx
shr    $0x4,%ecx
and    %eax,%ecx
lea    (%rdi,%rdi,4),%eax
mov    %edi,%edx
shr    $0x7,%edx
and    %eax,%edx
or     %ecx,%edx
lea    (%rdi,%rdi,2),%eax
shr    $0xa,%edi
and    %edi,%eax
or     %edx,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @tune9(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 9
%5 = load i32, i32* %2
%6 = lshr i32 %5, 4
%7 = and i32 %4, %6
%8 = load i32, i32* %2
%9 = mul i32 %8, 5
%10 = load i32, i32* %2
%11 = lshr i32 %10, 7
%12 = and i32 %9, %11
%13 = or i32 %7, %12
%14 = load i32, i32* %2
%15 = mul i32 %14, 3
%16 = load i32, i32* %2
%17 = udiv i32 %16, 1024
%18 = and i32 %15, %17
%19 = or i32 %13, %18
%20 = sub i32 %19, 1
ret i32 %20
}

LLVM IR (-O2):
define i32 @tune9(i32 %0) {
%2 = mul i32 %0, 9
%3 = lshr i32 %0, 4
%4 = and i32 %2, %3
%5 = mul i32 %0, 5
%6 = lshr i32 %0, 7
%7 = and i32 %5, %6
%8 = or i32 %4, %7
%9 = mul i32 %0, 3
%10 = lshr i32 %0, 10
%11 = and i32 %9, %10
%12 = or i32 %8, %11
%13 = add nsw i32 %12, -1
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ putc(unsigned char);
unsigned char getc(void) {
  unsigned char ret;
  while (!((*((volatile unsigned long *)0x7F005018)) & 0x7f))
    ;
  ret = (*((volatile unsigned char *)0x7F005024));
  if ((ret == 0x0d) || (ret == 0x0a)) {
    putc(0x0d);
    putc(0x0a);
  } else
    putc(ret);
  return ret;
}


x86 assembly (clang, -O0):
<getc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x7f005018,%eax
mov    (%rax),%rax
and    $0x7f,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <getc+0x2a>
jmp    113f <getc+0x2f>
jmp    1118 <getc+0x8>
mov    $0x7f005024,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     1163 <getc+0x53>
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    117c <getc+0x6c>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%edi
call   1030 <putc@plt>
jmp    1185 <getc+0x75>
movzbl -0x1(%rbp),%edi
call   1030 <putc@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getc>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
testq  $0x7f,0x7f005018
je     1120 <getc+0x10>
mov    0x7f005024,%bl
cmp    $0xd,%bl
je     1141 <getc+0x31>
mov    %ebx,%eax
cmp    $0xa,%bl
jne    114d <getc+0x3d>
mov    $0xd,%edi
call   1030 <putc@plt>
mov    $0xa,%al
movzbl %al,%edi
call   1030 <putc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @getc() {
%1 = alloca i8
br label %2
2: ; preds = %7, %0
%3 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%4 = and i64 %3, 127
%5 = icmp ne i64 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %2
br label %2
8: ; preds = %2
%9 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 13
br i1 %12, label %17, label %13
13: ; preds = %8
%14 = load i8, i8* %1
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %17, label %20
17: ; preds = %13, %8
%18 = call i32 @putc(i8 zeroext 13)
%19 = call i32 @putc(i8 zeroext 10)
br label %23
20: ; preds = %13
%21 = load i8, i8* %1
%22 = call i32 @putc(i8 zeroext %21)
br label %23
23: ; preds = %20, %17
%24 = load i8, i8* %1
ret i8 %24
}

LLVM IR (-O2):
define zeroext i8 @getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 2130726936 to i64*)
%3 = and i64 %2, 127
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 2130726948 to i8*)
switch i8 %6, label %9 [
i8 13, label %7
i8 10, label %7
]
7: ; preds = %5, %5
%8 = tail call i32 @putc(i8 zeroext 13)
br label %9
9: ; preds = %5, %7
%10 = phi i8 [ 10, %7 ], [ %6, %5 ]
%11 = tail call i32 @putc(i8 zeroext %10)
ret i8 %6
}
/* Variables and functions */
scalar_t__ StatSumInt(int *, int, int);
double StatAvgInt(int a[], int n, int s) {
  return (double)StatSumInt(a, n, s) / (double)n;
}


x86 assembly (clang, -O0):
<StatAvgInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <StatSumInt@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StatAvgInt>:
push   %rbx
mov    %esi,%ebx
call   1030 <StatSumInt@plt>
cvtsi2sd %rax,%xmm0
cvtsi2sd %ebx,%xmm1
divsd  %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @StatAvgInt(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 i64 @StatSumInt(i32* %7, i32 %8, i32 %9)
%11 = sitofp i64 %10 to double
%12 = load i32, i32* %5
%13 = sitofp i32 %12 to double
%14 = fdiv double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @StatAvgInt(i32* %0, i32 %1, i32 %2) {
%4 = tail call i64 @StatSumInt(i32* %0, i32 %1, i32 %2)
%5 = sitofp i64 %4 to double
%6 = sitofp i32 %1 to double
%7 = fdiv double %5, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
void *callback(void *data) {
  f((int *)data);
  return NULL;
}


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

x86 assembly (clang, -O2):
<callback>:
push   %rax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @callback(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @f(i32* %4)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @callback(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @f(i32* %2)
ret i8* null
}
unsigned long compaction_suitable(struct zone *zone, int order) { return 1; }


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

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

LLVM IR (-O0):
%struct.zone = type opaque
define i64 @compaction_suitable(%struct.zone* %0, i32 %1) {
%3 = alloca %struct.zone*
%4 = alloca i32
store %struct.zone* %0, %struct.zone** %3
store i32 %1, i32* %4
ret i64 1
}

LLVM IR (-O2):
%struct.zone = type opaque
define i64 @compaction_suitable(%struct.zone* nocapture readnone %0, i32 %1) {
ret i64 1
}
void init_msat_ids() {}


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

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

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

LLVM IR (-O2):
define void @init_msat_ids() {
ret void
}
void iniciaPinos() {}


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

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

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

LLVM IR (-O2):
define void @iniciaPinos() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out_printc(char);
void out_prints(char *str) {
  while (*str != '\0') {
    out_printc(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<out_prints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <out_prints+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <out_printc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <out_prints+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_prints>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <out_prints+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <out_printc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <out_prints+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @out_prints(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @out_printc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
void empeg_close(struct usb_serial_port *port, struct file *filp) {}


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

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

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

LLVM IR (-O2):
%struct.usb_serial_port = type opaque
%struct.file = type opaque
define void @empeg_close(%struct.usb_serial_port* nocapture %0, %struct.file* nocapture %1) {
ret void
}
int max(int first, int second) {
  if (first > second) {
    return first;
  }
  return second;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <max+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @max(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 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned int DRV_GET_RTC_VALUE(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_RTC_VALUE() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *basename) {
  printf("Usage: %s [--port <PORT: 1-65535>]\n", basename);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Usage: %s [--port <PORT: 1-65535>]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage: %s [--port <PORT: 1-65535>]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void helloWorld(void) { printf("Hello World!\n"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
define void @helloWorld() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
define void @helloWorld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLdouble;

/* Variables and functions */
int /*<<< orphan*/ matrixVectorNormSq(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sqrt(int /*<<< orphan*/);
GLdouble matrixVectorNorm(GLdouble *vector, int size) {
  return sqrt(matrixVectorNormSq(vector, size));
}


x86 assembly (clang, -O0):
<matrixVectorNorm>:
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 <matrixVectorNormSq@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrixVectorNorm>:
push   %rax
call   1030 <matrixVectorNormSq@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

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

LLVM IR (-O2):
define i32 @matrixVectorNorm(i32* %0, i32 %1) {
%3 = tail call i32 @matrixVectorNormSq(i32* %0, i32 %1)
%4 = tail call i32 @sqrt(i32 %3)
ret i32 %4
}
void swap(int *m, int *n) {
  int temp = *m;
  *m = *n;
  *n = temp;
}


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

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

LLVM IR (-O0):
define void @swap(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
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ racy_count(void *);
void *thread_fn(void *arg) {
  racy_count(arg);
  return NULL;
}


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

x86 assembly (clang, -O2):
<thread_fn>:
push   %rax
call   1030 <racy_count@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @thread_fn(i8* %0) {
%2 = tail call i32 @racy_count(i8* %0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char const *, char const *, char const *,
                          char const *);
void print_usage(const char *binary_name) {
  const char *format = "Usage: %s [options]\n"
                       "Options:\n"
                       "    -b <address>  bind and listen the address\n"
                       "Examples:\n"
                       "    %s -b ipc:///tmp/uds.ipc\n"
                       "    %s -b tcp://127.0.0.1:10000\n"
                       "\n";
  printf(format, binary_name, binary_name, binary_name);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    %rcx,%rsi
mov    %rcx,%rdx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [148 x i8] c"Usage: %s [options]\0AOptions:\0A -b <address> bind and listen the address\0AExamples:\0A %s -b ipc:///tmp/uds.ipc\0A %s -b tcp://127.0.0.1:10000\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* %4, i8* %5, i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [148 x i8] c"Usage: %s [options]\0AOptions:\0A -b <address> bind and listen the address\0AExamples:\0A %s -b ipc:///tmp/uds.ipc\0A %s -b tcp://127.0.0.1:10000\0A\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0, i8* %0)
ret void
}
void max_swap(int *a, int *b) {
  int temp;
  temp = *a;
  *a = *b;
  *b = temp;
}


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

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

LLVM IR (-O0):
define void @max_swap(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
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @max_swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log2(int);
int pow(int, int);
int chunk(int idx) {
  if (idx < pow(2, 5)) {
    return 0;
  } else {
    return floor(log2(idx)) + 1 - 5;
  }
}


x86 assembly (clang, -O0):
<chunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cmp    %ecx,%eax
jge    1169 <chunk+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1181 <chunk+0x51>
mov    -0x8(%rbp),%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
sub    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chunk>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
mov    $0x5,%esi
call   1040 <pow@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ebx,%ecx
jg     115b <chunk+0x2b>
mov    %ebx,%edi
call   1030 <log2@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0xfffffffc,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @chunk(i32 %0) {
%2 = tail call i32 @pow(i32 2, i32 5)
%3 = icmp sgt i32 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @log2(i32 %0)
%6 = tail call i32 @floor(i32 %5)
%7 = add nsw i32 %6, -4
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ get_string(char *, char *, int);
int /*<<< orphan*/ my_strcpy(char *, char *, int);
int /*<<< orphan*/ process_pref_file_command(char *);
void do_cmd_pref(void) {
  char tmp[80];
  my_strcpy(tmp, "", sizeof(tmp));
  if (!get_string("Pref: ", tmp, 80))
    return;
  (void)process_pref_file_command(tmp);
}


x86 assembly (clang, -O0):
<do_cmd_pref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x50,%edx
call   1030 <my_strcpy@plt>
lea    -0x50(%rbp),%rsi
lea    0xea8(%rip),%rdi
mov    $0x50,%edx
call   1040 <get_string@plt>
cmp    $0x0,%eax
jne    1170 <do_cmd_pref+0x40>
jmp    1179 <do_cmd_pref+0x49>
lea    -0x50(%rbp),%rdi
call   1050 <process_pref_file_command@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_cmd_pref>:
push   %rbx
sub    $0x50,%rsp
lea    0xeca(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x50,%edx
call   1030 <my_strcpy@plt>
lea    0xead(%rip),%rdi
mov    %rbx,%rsi
mov    $0x50,%edx
call   1040 <get_string@plt>
test   %eax,%eax
je     116c <do_cmd_pref+0x3c>
mov    %rsp,%rdi
call   1050 <process_pref_file_command@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Pref: \00"
define void @do_cmd_pref() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%5 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32 80)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %0
br label %11
8: ; preds = %0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%10 = call i32 @process_pref_file_command(i8* %9)
br label %11
11: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"Pref: \00"
define void @do_cmd_pref() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @my_strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 80)
%4 = call i32 @get_string(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 80)
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @process_pref_file_command(i8* %2)
br label %8
8: ; preds = %0, %6
ret void
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *BuildTwoThree();
int /*<<< orphan*/ Push(struct node **, int);
void PushTest() {
  struct node *head = BuildTwoThree();
  Push(&head, 1);
  Push(&head, 13);
}


x86 assembly (clang, -O0):
<PushTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <BuildTwoThree@plt>
mov    %rax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <Push@plt>
lea    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <Push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PushTest>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <BuildTwoThree@plt>
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <Push@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <Push@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @PushTest() {
%1 = alloca %struct.node*
%2 = call %struct.node* (...) @BuildTwoThree()
store %struct.node* %2, %struct.node** %1
%3 = call i32 @Push(%struct.node** %1, i32 1)
%4 = call i32 @Push(%struct.node** %1, i32 13)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @PushTest() {
%1 = alloca %struct.node*
%2 = bitcast %struct.node** %1 to i8*
%3 = tail call %struct.node* (...) @BuildTwoThree()
store %struct.node* %3, %struct.node** %1
%4 = call i32 @Push(%struct.node** %1, i32 1)
%5 = call i32 @Push(%struct.node** %1, i32 13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
int /*<<< orphan*/ ArgNum();
void Act_RopePrev(void) {
  ArgItem();
  ArgNum();
}


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

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

LLVM IR (-O0):
define void @Act_RopePrev() {
%1 = call i32 (...) @ArgItem()
%2 = call i32 (...) @ArgNum()
ret void
}

LLVM IR (-O2):
define void @Act_RopePrev() {
%1 = tail call i32 (...) @ArgItem()
%2 = tail call i32 (...) @ArgNum()
ret void
}
int set(int *a, int b) {
  *a = b;
  return b;
}


x86 assembly (clang, -O0):
<set>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @set(i32* nocapture writeonly %0, i32 returned %1) {
store i32 %1, i32* %0
ret i32 %1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t a52_get_bsid(const uint8_t *p_a52) { return (p_a52[5] & 0xf8) >> 3; }


x86 assembly (clang, -O0):
<a52_get_bsid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0xf8,%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52_get_bsid>:
mov    0x14(%rdi),%eax
shr    $0x3,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @a52_get_bsid(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 5
%5 = load i32, i32* %4
%6 = and i32 %5, 248
%7 = ashr i32 %6, 3
ret i32 %7
}

LLVM IR (-O2):
define i32 @a52_get_bsid(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = lshr i32 %3, 3
%5 = and i32 %4, 31
ret i32 %5
}
int StrLength(char *str) {
  int length = 0;
  while (str[length] != '\0')
    ++length;
  return length;
}


x86 assembly (clang, -O0):
<StrLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <StrLength+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <StrLength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrLength>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <StrLength+0x10>
ret

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

LLVM IR (-O2):
define i32 @StrLength(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int strlen(char *);
int is_labeled(char *s) { return (s[strlen(s) - 1] == '#') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_labeled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x23,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_labeled>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rcx
xor    %eax,%eax
cmpb   $0x23,-0x1(%rcx,%rbx,1)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_labeled(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 35
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_labeled(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 35
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
float eval_chains(void *);
float eval_groups(void *);
double _eval_groups_chains(void *s) {
  float groups = eval_groups(s);
  float chains = eval_chains(s);
  return groups + 20 * chains;
}


x86 assembly (clang, -O0):
<_eval_groups_chains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <eval_groups@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <eval_chains@plt>
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
movss  0xea6(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eval_groups_chains>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <eval_groups@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <eval_chains@plt>
mulss  0xebd(%rip),%xmm0
addss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @_eval_groups_chains(i8* %0) {
%2 = alloca i8*
%3 = alloca float
%4 = alloca float
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call float @eval_groups(i8* %5)
store float %6, float* %3
%7 = load i8*, i8** %2
%8 = call float @eval_chains(i8* %7)
store float %8, float* %4
%9 = load float, float* %3
%10 = load float, float* %4
%11 = call float @llvm.fmuladd.f32(float 2.000000e+01, float %10, float %9)
%12 = fpext float %11 to double
ret double %12
}

LLVM IR (-O2):
define double @_eval_groups_chains(i8* %0) {
%2 = tail call float @eval_groups(i8* %0)
%3 = tail call float @eval_chains(i8* %0)
%4 = tail call float @llvm.fmuladd.f32(float %3, float 2.000000e+01, float %2)
%5 = fpext float %4 to double
ret double %5
}
int __test() { return _Alignof(int) + _Alignof(char); }


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

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

LLVM IR (-O0):
define i32 @__test() {
ret i32 5
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 5
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};
typedef int /*<<< orphan*/ __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE_DATA;
int /*<<< orphan*/ I2C_SMBUS_WRITE;
int /*<<< orphan*/ i2c_smbus_access(int, int /*<<< orphan*/, int,
                                    int /*<<< orphan*/, union i2c_smbus_data *);
__s32 i2c_smbus_write_byte_data(int fd, int cmd, int value) {
  union i2c_smbus_data data;
  data.byte = value;
  return i2c_smbus_access(fd, I2C_SMBUS_WRITE, cmd, I2C_SMBUS_BYTE_DATA, &data);
}


x86 assembly (clang, -O0):
<i2c_smbus_write_byte_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2eab(%rip),%rax
mov    (%rax),%ecx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_write_byte_data>:
push   %rax
mov    %esi,%eax
mov    %edx,(%rsp)
mov    0x2ebb(%rip),%rcx
mov    (%rcx),%esi
mov    0x2ec2(%rip),%rcx
mov    (%rcx),%ecx
mov    %rsp,%r8
mov    %eax,%edx
call   1030 <i2c_smbus_access@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE_DATA = global i32 0
define i32 @i2c_smbus_write_byte_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.i2c_smbus_data
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = bitcast %union.i2c_smbus_data* %7 to i32*
store i32 %8, i32* %9
%10 = load i32, i32* %4
%11 = load i32, i32* @I2C_SMBUS_WRITE
%12 = load i32, i32* %5
%13 = load i32, i32* @I2C_SMBUS_BYTE_DATA
%14 = call i32 @i2c_smbus_access(i32 %10, i32 %11, i32 %12, i32 %13, %union.i2c_smbus_data* %7)
ret i32 %14
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_WRITE = global i32 0
@I2C_SMBUS_BYTE_DATA = global i32 0
define i32 @i2c_smbus_write_byte_data(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.i2c_smbus_data
%5 = bitcast %union.i2c_smbus_data* %4 to i8*
%6 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = load i32, i32* @I2C_SMBUS_WRITE
%8 = load i32, i32* @I2C_SMBUS_BYTE_DATA
%9 = call i32 @i2c_smbus_access(i32 %0, i32 %7, i32 %1, i32 %8, %union.i2c_smbus_data* %4)
ret i32 %9
}
int fun105() { return 105; }


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

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

LLVM IR (-O0):
define i32 @fun105() {
ret i32 105
}

LLVM IR (-O2):
define i32 @fun105() {
ret i32 105
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ syscall(int);
uid_t geteuid(void) { return syscall(201); }


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

x86 assembly (clang, -O2):
<geteuid>:
mov    $0xc9,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @geteuid() {
%1 = call i32 @syscall(i32 201)
ret i32 %1
}

LLVM IR (-O2):
define i32 @geteuid() {
%1 = tail call i32 @syscall(i32 201)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
defstorage() { ot("TIMES "); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"TIMES \00"
define i32 @defstorage() {
%1 = alloca i32
%2 = call i32 @ot(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [7 x i8] c"TIMES \00"
define i32 @defstorage() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo1(int);
int /*<<< orphan*/ putchar(char);
int foo2(int i) {
  foo1(i);
  putchar('a');
  return 0;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <foo1@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
push   %rax
call   1040 <foo1@plt>
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo1(i32 %3)
%5 = call i32 @putchar(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @foo2(i32 %0) {
%2 = tail call i32 @foo1(i32 %0)
%3 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
/* Type definitions */
typedef void uint8_t;
typedef int uint32_t;

/* Variables and functions */
void *dmc_unrar_ppmd_offset_to_pointer(void *base, uint32_t offset) {
  if (!offset)
    return NULL;
  return ((uint8_t *)base) + offset;
}


x86 assembly (clang, -O0):
<dmc_unrar_ppmd_offset_to_pointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1122 <dmc_unrar_ppmd_offset_to_pointer+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1131 <dmc_unrar_ppmd_offset_to_pointer+0x31>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmc_unrar_ppmd_offset_to_pointer>:
movslq %esi,%rcx
lea    (%rdi,%rcx,1),%rdx
xor    %eax,%eax
test   %ecx,%ecx
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @dmc_unrar_ppmd_offset_to_pointer(i8* readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = sext i32 %1 to i64
%5 = getelementptr i8, i8* %0, i64 %4
%6 = select i1 %3, i8* null, i8* %5
ret i8* %6
}
void X509_REQ_add1_attr_by_NID(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_add1_attr_by_NID() {
ret void
}
/* Type definitions */
struct input_view {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ iv_insert(struct input_view *, int);
void iv_over(struct input_view *this_iv, int len) { iv_insert(this_iv, len); }


x86 assembly (clang, -O0):
<iv_over>:
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 <iv_insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iv_over>:
jmp    1030 <iv_insert@plt>

LLVM IR (-O0):
%struct.input_view = type { i32 }
define void @iv_over(%struct.input_view* %0, i32 %1) {
%3 = alloca %struct.input_view*
%4 = alloca i32
store %struct.input_view* %0, %struct.input_view** %3
store i32 %1, i32* %4
%5 = load %struct.input_view*, %struct.input_view** %3
%6 = load i32, i32* %4
%7 = call i32 @iv_insert(%struct.input_view* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.input_view = type { i32 }
define void @iv_over(%struct.input_view* %0, i32 %1) {
%3 = tail call i32 @iv_insert(%struct.input_view* %0, i32 %1)
ret void
}
/* Variables and functions */
int set_irq_wake(unsigned int, int /*<<< orphan*/);
__attribute__((always_)) int disable_irq_wake(unsigned int irq) {
  return set_irq_wake(irq, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @disable_irq_wake(i32 %0) {
%2 = tail call i32 @set_irq_wake(i32 %0, i32 0)
ret i32 %2
}
/* Type definitions */
struct queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ enqueue(struct queue *, int);
void producer(struct queue *q) {
  for (int i = 0; i < 100; i++) {
    enqueue(q, i);
  }
}


x86 assembly (clang, -O0):
<producer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    1147 <producer+0x37>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <enqueue@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <producer+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<producer>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <enqueue@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
jne    1120 <producer+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.queue = type { i32 }
define void @producer(%struct.queue* %0) {
%2 = alloca %struct.queue*
%3 = alloca i32
store %struct.queue* %0, %struct.queue** %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load %struct.queue*, %struct.queue** %2
%9 = load i32, i32* %3
%10 = call i32 @enqueue(%struct.queue* %8, i32 %9)
br label %11
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.queue = type { i32 }
define void @producer(%struct.queue* %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @enqueue(%struct.queue* %0, i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 100
br i1 %7, label %2, label %3
}
/* Type definitions */
typedef int gid_t;

/* Variables and functions */
gid_t getgid(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @getgid() {
ret i32 42
}

LLVM IR (-O2):
define i32 @getgid() {
ret i32 42
}
int test_imm_47int16_mem(short *val) {
  return ((*val) & (0x47 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_47int16_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, 71
%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_47int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 71
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int IsWhite(char ch) {
  return (ch == ' ') || (ch == (char)011);
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<IsWhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <IsWhite+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsWhite>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @IsWhite(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void create_metatables() {}


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

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

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

LLVM IR (-O2):
define void @create_metatables() {
ret void
}