xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getAlarmShutdown(unsigned char id) {
  return dxl_read_byte(id, (18));
}


x86 assembly (clang, -O0):
<getAlarmShutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x12,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAlarmShutdown>:
mov    $0x12,%esi
jmp    1030 <dxl_read_byte@plt>

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

LLVM IR (-O2):
define zeroext i8 @getAlarmShutdown(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 18)
ret i8 %2
}
/* Variables and functions */
scalar_t__ cbrt(double);
int /*<<< orphan*/ link_failure_cbrt();
void test_cbrt(double d) {
  if (cbrt(d) != cbrt(d))
    link_failure_cbrt();
}


x86 assembly (clang, -O0):
<test_cbrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cbrt@plt>
mov    %rax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cbrt@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_cbrt+0x3c>
mov    $0x0,%al
call   1040 <link_failure_cbrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cbrt>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <cbrt@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <cbrt@plt>
cmp    %rax,%rbx
jne    1149 <test_cbrt+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_cbrt@plt>

LLVM IR (-O0):
define void @test_cbrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @cbrt(double %3)
%5 = load double, double* %2
%6 = call i64 @cbrt(double %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_cbrt()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_cbrt(double %0) {
%2 = tail call i64 @cbrt(double %0)
%3 = tail call i64 @cbrt(double %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_cbrt()
br label %7
7: ; preds = %5, %1
ret void
}
double norm_angle(double ang) {
  while (ang > +(3.141592)) {
    ang -= 2 * (3.141592);
  }
  while (ang < -(3.141592)) {
    ang += 2 * (3.141592);
  }
  return ang;
}


x86 assembly (clang, -O0):
<norm_angle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    113b <norm_angle+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1109 <norm_angle+0x9>
jmp    1140 <norm_angle+0x40>
movsd  0xec0(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    116a <norm_angle+0x6a>
movsd  0xeb5(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1140 <norm_angle+0x40>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm_angle>:
ucomisd 0xef8(%rip),%xmm0
jbe    112a <norm_angle+0x2a>
movsd  0xef6(%rip),%xmm1
movsd  0xee6(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
addsd  %xmm1,%xmm0
ucomisd %xmm2,%xmm0
ja     1120 <norm_angle+0x20>
movsd  0xede(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    114a <norm_angle+0x4a>
movsd  0xed8(%rip),%xmm2
addsd  %xmm2,%xmm0
ucomisd %xmm0,%xmm1
ja     1140 <norm_angle+0x40>
ret

LLVM IR (-O0):
define double @norm_angle(double %0) {
%2 = alloca double
store double %0, double* %2
br label %3
3: ; preds = %6, %1
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0x400921FAFC8B007A
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load double, double* %2
%8 = fsub double %7, 0x401921FAFC8B007A
store double %8, double* %2
br label %3
9: ; preds = %3
br label %10
10: ; preds = %13, %9
%11 = load double, double* %2
%12 = fcmp olt double %11, 0xC00921FAFC8B007A
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load double, double* %2
%15 = fadd double %14, 0x401921FAFC8B007A
store double %15, double* %2
br label %10
16: ; preds = %10
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @norm_angle(double %0) {
%2 = fcmp ogt double %0, 0x400921FAFC8B007A
br i1 %2, label %6, label %3
3: ; preds = %6, %1
%4 = phi double [ %0, %1 ], [ %8, %6 ]
%5 = fcmp olt double %4, 0xC00921FAFC8B007A
br i1 %5, label %10, label %14
6: ; preds = %1, %6
%7 = phi double [ %8, %6 ], [ %0, %1 ]
%8 = fadd double %7, 0xC01921FAFC8B007A
%9 = fcmp ogt double %8, 0x400921FAFC8B007A
br i1 %9, label %6, label %3
10: ; preds = %3, %10
%11 = phi double [ %12, %10 ], [ %4, %3 ]
%12 = fadd double %11, 0x401921FAFC8B007A
%13 = fcmp olt double %12, 0xC00921FAFC8B007A
br i1 %13, label %10, label %14
14: ; preds = %10, %3
%15 = phi double [ %4, %3 ], [ %12, %10 ]
ret double %15
}
/* Variables and functions */
int calculator(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  if (argc != 2) {
    fprintf(stderr, "Usage: ./test string\n");
    exit(-1);
  }
  printf("%d\n", calculator(argv[1]));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     117f <main+0x3f>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <calculator@plt>
mov    %eax,%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1161 <main+0x21>
mov    0x8(%rsi),%rdi
call   1050 <calculator@plt>
lea    0xec0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: ./test string\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @calculator(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Usage: ./test string\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @calculator(i8* %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swap32(uint32_t x) {
  return (x << 24) | (x >> 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00);
}


x86 assembly (clang, -O0):
<swap32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap32>:
mov    %edi,%eax
shl    $0x18,%eax
mov    %edi,%ecx
sar    $0x18,%ecx
or     %eax,%ecx
mov    %edi,%eax
shl    $0x8,%eax
and    $0xff0000,%eax
or     %ecx,%eax
shr    $0x8,%edi
and    $0xff00,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @swap32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = ashr i32 %5, 24
%7 = or i32 %4, %6
%8 = load i32, i32* %2
%9 = and i32 %8, 65280
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = load i32, i32* %2
%13 = ashr i32 %12, 8
%14 = and i32 %13, 65280
%15 = or i32 %11, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @swap32(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr i32 %0, 24
%4 = or i32 %2, %3
%5 = shl i32 %0, 8
%6 = and i32 %5, 16711680
%7 = or i32 %4, %6
%8 = lshr i32 %0, 8
%9 = and i32 %8, 65280
%10 = or i32 %7, %9
ret i32 %10
}
int main() {
  _Atomic int a;
  for (a = 0; a < 100000; printf("%i\n", a), a++)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
xchg   %eax,-0x8(%rbp)
cmpl   $0x186a0,-0x8(%rbp)
jge    1151 <main+0x41>
jmp    1136 <main+0x26>
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lock addl $0x1,-0x8(%rbp)
jmp    1124 <main+0x14>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
xchg   %eax,0xc(%rsp)
mov    0xc(%rsp),%eax
cmp    $0x1869f,%eax
jg     114f <main+0x3f>
lea    0xed3(%rip),%rbx
nopl   (%rax)
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lock addl $0x1,0xc(%rsp)
mov    0xc(%rsp),%eax
cmp    $0x186a0,%eax
jl     1130 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store atomic i32 0, i32* %2 seq_cst
br label %3
3: ; preds = %7, %0
%4 = load atomic i32, i32* %2 seq_cst
%5 = icmp slt i32 %4, 100000
br i1 %5, label %6, label %11
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load atomic i32, i32* %2 seq_cst
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = atomicrmw add i32* %2, i32 1 seq_cst
br label %3
11: ; preds = %3
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store atomic i32 0, i32* %1 seq_cst
%3 = load atomic i32, i32* %1 seq_cst
%4 = icmp slt i32 %3, 100000
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = load atomic i32, i32* %1 seq_cst
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = atomicrmw add i32* %1, i32 1 seq_cst
%9 = load atomic i32, i32* %1 seq_cst
%10 = icmp slt i32 %9, 100000
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
void test_mapping() {}


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

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

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

LLVM IR (-O2):
define void @test_mapping() {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void h265nal_set_layerid(uint8_t *p_h265nal, uint8_t i_layerid) {
  p_h265nal[3] &= ~0x1;
  p_h265nal[4] &= ~0xf8;
  p_h265nal[3] |= (i_layerid >> 5) & 0x1;
  p_h265nal[4] |= (i_layerid << 3) & 0xf8;
}


x86 assembly (clang, -O0):
<h265nal_set_layerid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xfffffffe,%ecx
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
and    $0xffffff07,%ecx
mov    %ecx,0x10(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x5,%ecx
and    $0x1,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    %ecx,0xc(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
and    $0xf8,%ecx
mov    -0x8(%rbp),%rax
or     0x10(%rax),%ecx
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<h265nal_set_layerid>:
mov    0xc(%rdi),%eax
mov    $0xffffff07,%ecx
and    0x10(%rdi),%ecx
and    $0xfffffffe,%eax
mov    %esi,%edx
shr    $0x5,%edx
and    $0x1,%edx
or     %eax,%edx
mov    %edx,0xc(%rdi)
and    $0x1f,%esi
lea    (%rcx,%rsi,8),%eax
mov    %eax,0x10(%rdi)
ret

LLVM IR (-O0):
define void @h265nal_set_layerid(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 = getelementptr inbounds i32, i32* %5, i64 3
%7 = load i32, i32* %6
%8 = and i32 %7, -2
store i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = load i32, i32* %10
%12 = and i32 %11, -249
store i32 %12, i32* %10
%13 = load i32, i32* %4
%14 = ashr i32 %13, 5
%15 = and i32 %14, 1
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = or i32 %18, %15
store i32 %19, i32* %17
%20 = load i32, i32* %4
%21 = shl i32 %20, 3
%22 = and i32 %21, 248
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 4
%25 = load i32, i32* %24
%26 = or i32 %25, %22
store i32 %26, i32* %24
ret void
}

LLVM IR (-O2):
define void @h265nal_set_layerid(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 3
%4 = load i32, i32* %3
%5 = and i32 %4, -2
%6 = getelementptr inbounds i32, i32* %0, i64 4
%7 = load i32, i32* %6
%8 = and i32 %7, -249
%9 = lshr i32 %1, 5
%10 = and i32 %9, 1
%11 = or i32 %5, %10
store i32 %11, i32* %3
%12 = shl i32 %1, 3
%13 = and i32 %12, 248
%14 = or i32 %8, %13
store i32 %14, i32* %6
ret void
}
short f8(short a, unsigned short b) {
  int c;
  return __builtin_mul_overflow(a, b, &c);
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movswl %cx,%ecx
movzwl %ax,%eax
imul   %eax,%ecx
seto   %al
mov    %ecx,-0x8(%rbp)
and    $0x1,%al
movzbl %al,%eax
cwtl
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @f8(i16 signext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca i32
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = load i16, i16* %4
%8 = sext i16 %6 to i32
%9 = zext i16 %7 to i32
%10 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %8, i32 %9)
%11 = extractvalue { i32, i1 } %10, 1
%12 = extractvalue { i32, i1 } %10, 0
store i32 %12, i32* %5
%13 = zext i1 %11 to i16
ret i16 %13
}

LLVM IR (-O2):
define signext i16 @f8(i16 signext %0, i16 zeroext %1) {
ret i16 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_table_footer(void) {
  printf("   </tbody>\n"
         "  </table>\n"
         "  <p>\n"
         "   <input type=\"submit\" value=\"Update Quantities\"/>\n"
         "   <input type=\"reset\" value=\"Reset Quantities\"/>\n"
         "  </p>\n"
         " </form>\n");
}


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

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

LLVM IR (-O0):
@.str = [148 x i8] c" </tbody>\0A </table>\0A <p>\0A <input type=\22submit\22 value=\22Update Quantities\22/>\0A <input type=\22reset\22 value=\22Reset Quantities\22/>\0A </p>\0A </form>\0A\00"
define void @print_table_footer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [147 x i8] c" </tbody>\0A </table>\0A <p>\0A <input type=\22submit\22 value=\22Update Quantities\22/>\0A <input type=\22reset\22 value=\22Reset Quantities\22/>\0A </p>\0A </form>\00"
define void @print_table_footer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([147 x i8], [147 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void inner_iter() { putchar('.'); }


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

x86 assembly (clang, -O2):
<inner_iter>:
mov    $0x2e,%edi
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @inner_iter() {
%1 = call i32 @putchar(i8 signext 46)
ret void
}

LLVM IR (-O2):
define void @inner_iter() {
%1 = tail call i32 @putchar(i8 signext 46)
ret void
}
RX0RX1(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (p0[x0]) = (p1[x1]); }


x86 assembly (clang, -O0):
<RX0RX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0RX1>:
movslq %esi,%rax
movss  (%rcx,%rax,4),%xmm0
movslq %edi,%rax
movss  %xmm0,(%rdx,%rax,4)
ret

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

LLVM IR (-O2):
define i32 @RX0RX1(double %0, double %1, i32 %2, i32 %3, float* nocapture writeonly %4, float* nocapture %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds float, float* %5, i64 %7
%9 = load float, float* %8
%10 = sext i32 %2 to i64
%11 = getelementptr inbounds float, float* %4, i64 %10
store float %9, float* %11
ret i32 undef
}
int test_imm_3Dint64_lowword_mem(long long *val) {
  return ((*val) & (0x3D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Dint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 61
%6 = icmp ne i64 %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_3Dint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 61
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chr1setBank2(int);
void m32setParamsBXX2(uint16_t addr, uint8_t val) {
  (void)addr;
  chr1setBank2(val << 10);
}


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

x86 assembly (clang, -O2):
<m32setParamsBXX2>:
mov    %esi,%edi
shl    $0xa,%edi
jmp    1030 <chr1setBank2@plt>

LLVM IR (-O0):
define void @m32setParamsBXX2(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 = shl i32 %6, 10
%8 = call i32 @chr1setBank2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m32setParamsBXX2(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = tail call i32 @chr1setBank2(i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
void traitement_signal(int sig) {
  int status;
  waitpid(-1, &status, WNOHANG);
  printf("Signal %d recu \n", sig);
}


x86 assembly (clang, -O0):
<traitement_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1040 <waitpid@plt>
mov    -0x4(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<traitement_signal>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
mov    0x2eba(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [17 x i8] c"Signal %d recu \0A\00"
define void @traitement_signal(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
z() { return 6; }


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

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

LLVM IR (-O0):
define i32 @z() {
ret i32 6
}

LLVM IR (-O2):
define i32 @z() {
ret i32 6
}
void print_subgraph() {}


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

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

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

LLVM IR (-O2):
define void @print_subgraph() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putstr(char *, int);
void term_cursor_off(void) { putstr("\x1b[?25l", 6); }


x86 assembly (clang, -O0):
<term_cursor_off>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x6,%esi
call   1030 <putstr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_cursor_off>:
lea    0xee9(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <putstr@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[?25l\00"
define void @term_cursor_off() {
%1 = call i32 @putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[?25l\00"
define void @term_cursor_off() {
%1 = tail call i32 @putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int mp_load_u8(char const **);
void mp_decode_nil(const char **data) {
  uint8_t c = mp_load_u8(data);
  assert(c == 0xc0);
  (void)c;
}


x86 assembly (clang, -O0):
<mp_decode_nil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mp_load_u8@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xc0,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_nil>:
push   %rax
call   1040 <mp_load_u8@plt>
xor    %edi,%edi
cmp    $0xc0,%eax
sete   %dil
pop    %rax
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @mp_decode_nil(i8** %0) {
%2 = alloca i8**
%3 = alloca i32
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = call i32 @mp_load_u8(i8** %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 192
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i32, i32* %3
ret void
}

LLVM IR (-O2):
define void @mp_decode_nil(i8** %0) {
%2 = tail call i32 @mp_load_u8(i8** %0)
%3 = icmp eq i32 %2, 192
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int strftime(char *, int, char *, struct tm *);
int time2mysql(time_t _time, char *_result, int _res_len) {
  struct tm *t;
  t = localtime(&_time);
  return strftime(_result, _res_len, "%Y-%m-%d %H:%M:%S", t);
}


x86 assembly (clang, -O0):
<time2mysql>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rcx
lea    0xeaf(%rip),%rdx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time2mysql>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @time2mysql(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.tm*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = call %struct.tm* @localtime(i32* %4)
store %struct.tm* %8, %struct.tm** %7
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load %struct.tm*, %struct.tm** %7
%12 = call i32 @strftime(i8* %9, i32 %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [18 x i8] c"%Y-%m-%d %H:%M:%S\00"
define i32 @time2mysql(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = call %struct.tm* @localtime(i32* %4)
%6 = call i32 @strftime(i8* %1, i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ AddIP(char *);
int /*<<< orphan*/ G_Printf(char *);
int trap_Argc();
int /*<<< orphan*/ trap_Argv(int, char *, int);
void Svcmd_AddIP_f(char *cmd) {
  char str[1024];
  if (trap_Argc() < 2) {
    G_Printf("Usage:  addip <ip-mask>\n");
    return;
  }
  trap_Argv(1, str, sizeof(str));
  AddIP(str);
}


x86 assembly (clang, -O0):
<Svcmd_AddIP_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <trap_Argc@plt>
cmp    $0x2,%eax
jge    1170 <Svcmd_AddIP_f+0x30>
lea    0xe9a(%rip),%rdi
call   1050 <G_Printf@plt>
jmp    1192 <Svcmd_AddIP_f+0x52>
lea    -0x410(%rbp),%rsi
mov    $0x1,%edi
mov    $0x400,%edx
call   1060 <trap_Argv@plt>
lea    -0x410(%rbp),%rdi
call   1040 <AddIP@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Svcmd_AddIP_f>:
push   %rbx
sub    $0x400,%rsp
xor    %eax,%eax
call   1030 <trap_Argc@plt>
cmp    $0x1,%eax
jg     1168 <Svcmd_AddIP_f+0x28>
lea    0xea5(%rip),%rdi
add    $0x400,%rsp
pop    %rbx
jmp    1050 <G_Printf@plt>
mov    %rsp,%rbx
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x400,%edx
call   1060 <trap_Argv@plt>
mov    %rbx,%rdi
call   1040 <AddIP@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Usage: addip <ip-mask>\0A\00"
define void @Svcmd_AddIP_f(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = call i32 (...) @trap_Argc()
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @G_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %13
8: ; preds = %1
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%10 = call i32 @trap_Argv(i32 1, i8* %9, i32 1024)
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = call i32 @AddIP(i8* %11)
br label %13
13: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Usage: addip <ip-mask>\0A\00"
define void @Svcmd_AddIP_f(i8* nocapture readnone %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = tail call i32 (...) @trap_Argc()
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @G_Printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = call i32 @trap_Argv(i32 1, i8* %3, i32 1024)
%10 = call i32 @AddIP(i8* %3)
br label %11
11: ; preds = %8, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DoSQV1HQ();
int /*<<< orphan*/ DoSQV2HQ();
int /*<<< orphan*/ DoSawVHQ();
void VRC6SoundHQ(void) {
  DoSQV1HQ();
  DoSQV2HQ();
  DoSawVHQ();
}


x86 assembly (clang, -O0):
<VRC6SoundHQ>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <DoSQV1HQ@plt>
mov    $0x0,%al
call   1050 <DoSQV2HQ@plt>
mov    $0x0,%al
call   1030 <DoSawVHQ@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VRC6SoundHQ>:
push   %rax
xor    %eax,%eax
call   1040 <DoSQV1HQ@plt>
xor    %eax,%eax
call   1050 <DoSQV2HQ@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <DoSawVHQ@plt>

LLVM IR (-O0):
define void @VRC6SoundHQ() {
%1 = call i32 (...) @DoSQV1HQ()
%2 = call i32 (...) @DoSQV2HQ()
%3 = call i32 (...) @DoSawVHQ()
ret void
}

LLVM IR (-O2):
define void @VRC6SoundHQ() {
%1 = tail call i32 (...) @DoSQV1HQ()
%2 = tail call i32 (...) @DoSQV2HQ()
%3 = tail call i32 (...) @DoSawVHQ()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_reparent_window(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
void xembed_window_unembed(xcb_connection_t *connection, xcb_window_t child,
                           xcb_window_t root) {
  xcb_reparent_window(connection, child, root, 0, 0);
}


x86 assembly (clang, -O0):
<xembed_window_unembed>:
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
xor    %r8d,%r8d
mov    %r8d,%ecx
call   1030 <xcb_reparent_window@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xembed_window_unembed>:
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <xcb_reparent_window@plt>

LLVM IR (-O0):
define void @xembed_window_unembed(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 @xcb_reparent_window(i32* %7, i32 %8, i32 %9, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @xembed_window_unembed(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @xcb_reparent_window(i32* %0, i32 %1, i32 %2, i32 0, i32 0)
ret void
}
unsigned kol_key_control() { asm volatile("int $0x40" ::"a"(66), "b"(3)); }


x86 assembly (clang, -O0):
<kol_key_control>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x42,%eax
mov    $0x3,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_key_control>:
push   %rbx
mov    $0x42,%eax
mov    $0x3,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_key_control() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 66, i32 3)
ret i32 undef
}
void insert(struct list_t *st, int item) {}


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

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

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

LLVM IR (-O2):
%struct.list_t = type opaque
define void @insert(%struct.list_t* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *xsd_strdup(const char *str) {
  char *dup = NULL;
  if (str != NULL && *str != '\0') {
    size_t sz = strlen(str) + 1;
    dup = (char *)malloc(sz);
    memcpy(dup, str, sz);
  }
  return dup;
}


x86 assembly (clang, -O0):
<xsd_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118f <xsd_strdup+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     118f <xsd_strdup+0x5f>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsd_strdup>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     116b <xsd_strdup+0x3b>
mov    %rdi,%rbx
cmpb   $0x0,(%rdi)
je     116b <xsd_strdup+0x3b>
mov    %rbx,%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
jmp    116e <xsd_strdup+0x3e>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xsd_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
store i8* null, i8** %3
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %24
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %24
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = call i32 @strlen(i8* %13)
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
store i64 %16, i64* %4
%17 = load i64, i64* %4
%18 = call i64 @malloc(i64 %17)
%19 = inttoptr i64 %18 to i8*
store i8* %19, i8** %3
%20 = load i8*, i8** %3
%21 = load i8*, i8** %2
%22 = load i64, i64* %4
%23 = call i32 @memcpy(i8* %20, i8* %21, i64 %22)
br label %24
24: ; preds = %12, %7, %1
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @xsd_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %0)
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = tail call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @memcpy(i8* %11, i8* %0, i64 %9)
br label %13
13: ; preds = %6, %3, %1
%14 = phi i8* [ %11, %6 ], [ null, %3 ], [ null, %1 ]
ret i8* %14
}
int IsCommandSeparator(char c) { return c == ';' || c == ','; }


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

x86 assembly (clang, -O2):
<IsCommandSeparator>:
cmp    $0x3b,%dil
sete   %al
cmp    $0x2c,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @IsCommandSeparator(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, 59
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, 44
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 @IsCommandSeparator(i8 signext %0) {
%2 = icmp eq i8 %0, 59
%3 = icmp eq i8 %0, 44
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void exit() {
  asm("movl $42, %ebx \n\t"
      "movl $1, %eax \n\t"
      "int $0x80     \n\t");
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2a,%ebx
mov    $0x1,%eax
int    $0x80

x86 assembly (clang, -O2):
<exit>:
mov    $0x2a,%ebx
mov    $0x1,%eax
int    $0x80

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

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void asm sideeffect "movl $$42, %ebx \0A\09movl $$1, %eax \0A\09int $$0x80 \0A\09", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *popen(char *, char *);
int test_sock();
int main(void) {
  FILE *f;
  f = popen("ping -c5 localhost", "r");
  (void)f;
  return test_sock();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_sock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1040 <popen@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <test_sock@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"ping -c5 localhost\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @popen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 (...) @test_sock()
ret i32 %5
}

LLVM IR (-O2):
@.str = [19 x i8] c"ping -c5 localhost\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @main() {
%1 = tail call i32* @popen(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @test_sock()
ret i32 %2
}
/* Variables and functions */
scalar_t__ lc_COLLATE();
int Ada_lc_COLLATE() {
  int jresult;
  int result;
  result = (int)lc_COLLATE();
  jresult = result;
  return jresult;
}


x86 assembly (clang, -O0):
<Ada_lc_COLLATE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <lc_COLLATE@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Ada_lc_COLLATE() {
%1 = alloca i32
%2 = alloca i32
%3 = call i64 (...) @lc_COLLATE()
%4 = trunc i64 %3 to i32
store i32 %4, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @Ada_lc_COLLATE() {
%1 = tail call i64 (...) @lc_COLLATE()
%2 = trunc i64 %1 to i32
ret i32 %2
}
void testf(float *__restrict__ p, float *__restrict q) {
  p[0] = p[0] - q[0];
  p[1] = p[1] + q[1];
  p[2] = p[2] - q[2];
  p[3] = p[3] + q[3];
}


x86 assembly (clang, -O0):
<testf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
addss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<testf>:
movups (%rdi),%xmm0
movups (%rsi),%xmm1
movaps %xmm0,%xmm2
subps  %xmm1,%xmm2
addps  %xmm1,%xmm0
shufps $0xd8,%xmm0,%xmm2
shufps $0xd8,%xmm2,%xmm2
movups %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @testf(float* noalias %0, float* noalias %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = fsub float %7, %10
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i64 0
store float %11, float* %13
%14 = load float*, float** %3
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = load float*, float** %4
%18 = getelementptr inbounds float, float* %17, i64 1
%19 = load float, float* %18
%20 = fadd float %16, %19
%21 = load float*, float** %3
%22 = getelementptr inbounds float, float* %21, i64 1
store float %20, float* %22
%23 = load float*, float** %3
%24 = getelementptr inbounds float, float* %23, i64 2
%25 = load float, float* %24
%26 = load float*, float** %4
%27 = getelementptr inbounds float, float* %26, i64 2
%28 = load float, float* %27
%29 = fsub float %25, %28
%30 = load float*, float** %3
%31 = getelementptr inbounds float, float* %30, i64 2
store float %29, float* %31
%32 = load float*, float** %3
%33 = getelementptr inbounds float, float* %32, i64 3
%34 = load float, float* %33
%35 = load float*, float** %4
%36 = getelementptr inbounds float, float* %35, i64 3
%37 = load float, float* %36
%38 = fadd float %34, %37
%39 = load float*, float** %3
%40 = getelementptr inbounds float, float* %39, i64 3
store float %38, float* %40
ret void
}

LLVM IR (-O2):
define void @testf(float* noalias nocapture %0, float* noalias nocapture %1) {
%3 = bitcast float* %0 to <4 x float>*
%4 = load <4 x float>, <4 x float>* %3
%5 = bitcast float* %1 to <4 x float>*
%6 = load <4 x float>, <4 x float>* %5
%7 = fsub <4 x float> %4, %6
%8 = fadd <4 x float> %4, %6
%9 = shufflevector <4 x float> %7, <4 x float> %8, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
%10 = bitcast float* %0 to <4 x float>*
store <4 x float> %9, <4 x float>* %10
ret void
}
int main() {
  int a, b, c;
  scanf("%d%d%d", &a, &b, &c), a += b + c,
      printf("%d %d...%d", a, a / 3, a % 3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x10(%rbp),%edx
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
add    0x14(%rsp),%eax
add    0xc(%rsp),%eax
mov    %eax,0xc(%rsp)
movslq %eax,%rsi
imul   $0x55555556,%rsi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x20,%rdx
add    %eax,%edx
lea    (%rdx,%rdx,2),%eax
mov    %esi,%ecx
sub    %eax,%ecx
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [11 x i8] c"%d %d...%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
%8 = load i32, i32* %1
%9 = add nsw i32 %8, %7
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = load i32, i32* %1
%12 = sdiv i32 %11, 3
%13 = load i32, i32* %1
%14 = srem i32 %13, 3
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %12, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [11 x i8] c"%d %d...%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, %8
%11 = load i32, i32* %1
%12 = add nsw i32 %10, %11
store i32 %12, i32* %1
%13 = sdiv i32 %12, 3
%14 = srem i32 %12, 3
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret i32 0
}
void sip_add_token(unsigned char *pToken, unsigned char *pValue) {}


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

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

LLVM IR (-O0):
define void @sip_add_token(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @sip_add_token(i8* nocapture %0, i8* nocapture %1) {
ret void
}
void AlarmToTimerC$0$Alarm$fired(void) { AlarmToTimerC$0$fired$postTask(); }


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

x86 assembly (clang, -O2):
<AlarmToTimerC$0$Alarm$fired>:
xor    %eax,%eax
jmp    1030 <AlarmToTimerC$0$fired$postTask@plt>

LLVM IR (-O0):
define void @"AlarmToTimerC$0$Alarm$fired"() {
%1 = call i32 (...) @"AlarmToTimerC$0$fired$postTask"()
ret void
}

LLVM IR (-O2):
define void @"AlarmToTimerC$0$Alarm$fired"() {
%1 = tail call i32 (...) @"AlarmToTimerC$0$fired$postTask"()
ret void
}