xunge/DecIR huggingface dataset:
long long _saddsub(unsigned int src1, unsigned int src2) {
  int radd;
  signed long long rsub;
  signed long long maxv, minv;
  maxv = (1LL << (32 - 1)) - 1;
  minv = (-1LL << (32 - 1));
  radd = (int)src1 + (int)src2;
  rsub = (long long)((int)src1) - (long long)((int)src2);
  if (rsub > maxv) {
    rsub = maxv;
  } else if (rsub < minv) {
    rsub = minv;
  }
  return (((unsigned long long)radd) << 32) | (rsub & 0x00000000ffffffff);
}


x86 assembly (clang, -O0):
<_saddsub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x7fffffff,-0x20(%rbp)
7f
movq   $0xffffffff80000000,-0x28(%rbp)
80
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movslq -0x4(%rbp),%rax
movslq -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    114d <_saddsub+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1168 <_saddsub+0x68>
mov    -0x18(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1163 <_saddsub+0x63>
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1168 <_saddsub+0x68>
movslq -0xc(%rbp),%rax
shl    $0x20,%rax
movabs $0xffffffff,%rcx
and    -0x18(%rbp),%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_saddsub>:
xor    %ecx,%ecx
cmp    %esi,%edi
setns  %cl
add    $0x7fffffff,%ecx
lea    (%rsi,%rdi,1),%eax
sub    %esi,%edi
cmovo  %ecx,%edi
shl    $0x20,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @_saddsub(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %3
store i32 %1, i32* %4
store i64 2147483647, i64* %7
store i64 -2147483648, i64* %8
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = sub nsw i64 %13, %15
store i64 %16, i64* %6
%17 = load i64, i64* %6
%18 = load i64, i64* %7
%19 = icmp sgt i64 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = load i64, i64* %7
store i64 %21, i64* %6
br label %29
22: ; preds = %2
%23 = load i64, i64* %6
%24 = load i64, i64* %8
%25 = icmp slt i64 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i64, i64* %8
store i64 %27, i64* %6
br label %28
28: ; preds = %26, %22
br label %29
29: ; preds = %28, %20
%30 = load i32, i32* %5
%31 = sext i32 %30 to i64
%32 = shl i64 %31, 32
%33 = load i64, i64* %6
%34 = and i64 %33, 4294967295
%35 = or i64 %32, %34
ret i64 %35
}

LLVM IR (-O2):
define i64 @_saddsub(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.ssub.sat.i32(i32 %0, i32 %1)
%4 = zext i32 %3 to i64
%5 = add nsw i32 %1, %0
%6 = zext i32 %5 to i64
%7 = shl nuw i64 %6, 32
%8 = or i64 %7, %4
ret i64 %8
}
int compareDouble(const void *x, const void *y) {
  double xx = *(double *)x, yy = *(double *)y;
  if (xx < yy)
    return -1;
  if (xx > yy)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<compareDouble>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <compareDouble+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <compareDouble+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <compareDouble+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <compareDouble+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareDouble>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareDouble(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compareDouble(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void custom_delay(void) {
  int i;
  for (i = 0; i < 5; i++)
    ;
}


x86 assembly (clang, -O0):
<custom_delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    1128 <custom_delay+0x28>
jmp    111a <custom_delay+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <custom_delay+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @custom_delay() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long ustime(void) {
  struct timeval tv;
  long long ust;
  gettimeofday(&tv, NULL);
  ust = ((long long)tv.tv_sec) * 1000000;
  ust += tv.tv_usec;
  return ust;
}


x86 assembly (clang, -O0):
<ustime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @ustime() {
%1 = alloca %struct.timeval
%2 = alloca i64
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
store i64 %6, i64* %2
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i64, i64* %7
%9 = load i64, i64* %2
%10 = add nsw i64 %9, %8
store i64 %10, i64* %2
%11 = load i64, i64* %2
ret i64 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @ustime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
void f_ll(void) {
  long long x;
  asm("" : "=@ccc"(x));
}


x86 assembly (clang, -O0):
<f_ll>:
push   %rbp
mov    %rsp,%rbp
setb   %al
movzbl %al,%eax
mov    %rax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f_ll() {
%1 = alloca i64
%2 = call i64 asm "", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
ret void
}

LLVM IR (-O2):
define void @f_ll() {
%1 = tail call i64 asm "", "={@ccc},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decode();
int main(int argc, char *argv[]) {
  decode();
  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)
mov    $0x0,%al
call   1030 <decode@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 = call i32 (...) @decode()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @decode()
ret i32 0
}
/* Variables and functions */
scalar_t__ accept(char *);
int /*<<< orphan*/ get_token();
void type_name() {
  get_token();
  while (accept("*")) {
  }
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_token@plt>
lea    0xece(%rip),%rdi
call   1030 <accept@plt>
cmp    $0x0,%rax
je     1146 <type_name+0x26>
jmp    112b <type_name+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
push   %rbx
xor    %eax,%eax
call   1040 <get_token@plt>
lea    0xed1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <accept@plt>
test   %rax,%rax
jne    1130 <type_name+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
define void @type_name() {
%1 = call i32 (...) @get_token()
br label %2
2: ; preds = %5, %0
%3 = call i64 @accept(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2
br label %2
6: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"*\00"
define void @type_name() {
%1 = tail call i32 (...) @get_token()
br label %2
2: ; preds = %2, %0
%3 = tail call i64 @accept(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %2
5: ; preds = %2
ret void
}
void rtc_init(void) {}


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

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

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

LLVM IR (-O2):
define void @rtc_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ I_Exit(int /*<<< orphan*/);
void M_QuitDOOM(int choice) { I_Exit(0); }


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

x86 assembly (clang, -O2):
<M_QuitDOOM>:
xor    %edi,%edi
jmp    1030 <I_Exit@plt>

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

LLVM IR (-O2):
define void @M_QuitDOOM(i32 %0) {
%2 = tail call i32 @I_Exit(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ is_dir(char const *);
scalar_t__ is_unc_root(char const *);
int is_valid_dir(const char *path) { return is_dir(path) || is_unc_root(path); }


x86 assembly (clang, -O0):
<is_valid_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_dir@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <is_valid_dir+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <is_unc_root@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_dir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_dir@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <is_valid_dir+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <is_unc_root@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_valid_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @is_dir(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @is_unc_root(i8* %7)
%9 = icmp ne i64 %8, 0
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 @is_valid_dir(i8* %0) {
%2 = tail call i64 @is_dir(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_unc_root(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void *LoadAcquire(void *volatile const *addr) {
  void *v = *addr;
  ReadFence();
  return v;
}


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

x86 assembly (clang, -O2):
<LoadAcquire>:
push   %rbx
mov    (%rdi),%rbx
xor    %eax,%eax
call   1030 <ReadFence@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @LoadAcquire(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load volatile i8*, i8** %4
store i8* %5, i8** %3
%6 = call i32 (...) @ReadFence()
%7 = load i8*, i8** %3
ret i8* %7
}

LLVM IR (-O2):
define i8* @LoadAcquire(i8** %0) {
%2 = load volatile i8*, i8** %0
%3 = tail call i32 (...) @ReadFence()
ret i8* %2
}
/* Variables and functions */
int is_first_char(const char *start, const char *pos) {
  const char *p = NULL;
  for (p = start; p < pos; p++) {
    if (*p != ' ') {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_first_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115c <is_first_char+0x5c>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1146 <is_first_char+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1163 <is_first_char+0x63>
jmp    114b <is_first_char+0x4b>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <is_first_char+0x1c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_first_char>:
mov    $0x1,%eax
cmp    %rsi,%rdi
jae    111f <is_first_char+0x1f>
sub    %rdi,%rsi
xor    %ecx,%ecx
nop
cmpb   $0x20,(%rdi,%rcx,1)
jne    1120 <is_first_char+0x20>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <is_first_char+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_first_char(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* null, i8** %6
%7 = load i8*, i8** %4
store i8* %7, i8** %6
br label %8
8: ; preds = %19, %2
%9 = load i8*, i8** %6
%10 = load i8*, i8** %5
%11 = icmp ult i8* %9, %10
br i1 %11, label %12, label %22
12: ; preds = %8
%13 = load i8*, i8** %6
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 32
br i1 %16, label %17, label %18
17: ; preds = %12
store i32 0, i32* %3
br label %23
18: ; preds = %12
br label %19
19: ; preds = %18
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %6
br label %8
22: ; preds = %8
store i32 1, i32* %3
br label %23
23: ; preds = %22, %17
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_first_char(i8* %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %11
9: ; preds = %11
%10 = icmp eq i8* %15, %8
br i1 %10, label %16, label %11
11: ; preds = %4, %9
%12 = phi i8* [ %15, %9 ], [ %0, %4 ]
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 32
%15 = getelementptr inbounds i8, i8* %12, i64 1
br i1 %14, label %9, label %16
16: ; preds = %11, %9, %2
%17 = phi i32 [ 1, %2 ], [ 1, %9 ], [ 0, %11 ]
ret i32 %17
}
void main(int argc, char **argv) {
  const int nrow = 4;
  const int ncol = 3;
  double x[nrow * ncol];
  for (int i = 0; i < nrow; i++) {
    for (int j = 0; j < ncol; j++) {
      x[i * ncol + j] = i * j;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
mov    %rsp,%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x4,-0x24(%rbp)
jge    1184 <main+0x84>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    1171 <main+0x71>
mov    -0x24(%rbp),%eax
imul   -0x28(%rbp),%eax
cvtsi2sd %eax,%xmm0
imul   $0x3,-0x24(%rbp),%eax
add    -0x28(%rbp),%eax
cltq
movsd  %xmm0,-0x90(%rbp,%rax,8)
ff ff
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    113c <main+0x3c>
jmp    1176 <main+0x76>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112b <main+0x2b>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 4, i32* %5
store i32 3, i32* %6
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %7
%11 = alloca double, i64 12
store i32 0, i32* %8
br label %12
12: ; preds = %34, %2
%13 = load i32, i32* %8
%14 = icmp slt i32 %13, 4
br i1 %14, label %15, label %37
15: ; preds = %12
store i32 0, i32* %9
br label %16
16: ; preds = %30, %15
%17 = load i32, i32* %9
%18 = icmp slt i32 %17, 3
br i1 %18, label %19, label %33
19: ; preds = %16
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = mul nsw i32 %20, %21
%23 = sitofp i32 %22 to double
%24 = load i32, i32* %8
%25 = mul nsw i32 %24, 3
%26 = load i32, i32* %9
%27 = add nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %11, i64 %28
store double %23, double* %29
br label %30
30: ; preds = %19
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %16
33: ; preds = %16
br label %34
34: ; preds = %33
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %12
37: ; preds = %12
%38 = load i8*, i8** %7
ret void
}

LLVM IR (-O2):
define void @main(i32 %0, i8** nocapture %1) {
ret void
}
double F2C(double tempF) { return (1. * 5 / 9) * (tempF - 32.0); }


x86 assembly (clang, -O0):
<F2C>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  0xef2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xede(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F2C>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @F2C(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 3.200000e+01
%5 = fmul double 0x3FE1C71C71C71C72, %4
ret double %5
}

LLVM IR (-O2):
define double @F2C(double %0) {
%2 = fadd double %0, -3.200000e+01
%3 = fmul double %2, 0x3FE1C71C71C71C72
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void ScreenSep(void) {
  fprintf(stdout, "flag | opts  |  explanation (* = default; # = an integer)\n"
                  "-----+-------+----------------------------------------------"
                  "----------------\n");
}


x86 assembly (clang, -O0):
<ScreenSep>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScreenSep>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [136 x i8] c"flag | opts | explanation (* = default; # = an integer)\0A-----+-------+--------------------------------------------------------------\0A\00"
define void @ScreenSep() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [136 x i8] c"flag | opts | explanation (* = default; # = an integer)\0A-----+-------+--------------------------------------------------------------\0A\00"
define void @ScreenSep() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *myfopen();
int main() {
  FILE *fp1;
  FILE *fp2;
  fp1 = myfopen();
  fp2 = myfopen();
  fprintf(fp1, "Testing...\n");
  fclose(fp1);
  fprintf(fp2, "Testing...\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <myfopen@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <myfopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rdi
lea    0xe8e(%rip),%rsi
call   1050 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1030 <myfopen@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <myfopen@plt>
mov    %rax,%r14
lea    0xeb0(%rip),%r15
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    $0xb,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %r14,%rcx
call   1050 <fwrite@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @myfopen()
store i32* %3, i32** %1
%4 = call i32* (...) @myfopen()
store i32* %4, i32** %2
%5 = load i32*, i32** %1
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %1
%8 = call i32 @fclose(i32* %7)
%9 = load i32*, i32** %2
%10 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = tail call i32* (...) @myfopen()
%2 = tail call i32* (...) @myfopen()
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %1)
%4 = tail call i32 @fclose(i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emit_adc(int, int, int);
int /*<<< orphan*/ emit_adcs(int, int, int);
int /*<<< orphan*/ emit_lsrs_imm(int, int, int);
void emit_addc(int s, int t, int sr) {
  emit_lsrs_imm(sr, 1, sr);
  emit_adcs(s, t, t);
  emit_adc(sr, sr, sr);
}


x86 assembly (clang, -O0):
<emit_addc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_lsrs_imm@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1040 <emit_adcs@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <emit_adc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_addc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    %edx,%edi
mov    $0x1,%esi
call   1030 <emit_lsrs_imm@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebp,%edx
call   1040 <emit_adcs@plt>
mov    %ebx,%edi
mov    %ebx,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <emit_adc@plt>

LLVM IR (-O0):
define void @emit_addc(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* %6
%8 = load i32, i32* %6
%9 = call i32 @emit_lsrs_imm(i32 %7, i32 1, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @emit_adcs(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %6
%17 = call i32 @emit_adc(i32 %14, i32 %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @emit_addc(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit_lsrs_imm(i32 %2, i32 1, i32 %2)
%5 = tail call i32 @emit_adcs(i32 %0, i32 %1, i32 %1)
%6 = tail call i32 @emit_adc(i32 %2, i32 %2, i32 %2)
ret void
}
int test_imm_73uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x73 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_73uint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 115
%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_73uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 7536640
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(long, char, long, char);
long main() {
  long x;
  x = 5;
  f(x, 'a', x + 1, 'b');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x5,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x10(%rbp),%rdx
add    $0x1,%rdx
mov    $0x61,%esi
mov    $0x62,%ecx
call   1030 <f@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%edi
mov    $0x6,%edx
mov    $0x61,%esi
mov    $0x62,%ecx
jmp    1030 <f@plt>

LLVM IR (-O0):
define i64 @main() {
%1 = alloca i64
%2 = alloca i64
store i64 5, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = add nsw i64 %4, 1
%6 = call i32 @f(i64 %3, i8 signext 97, i64 %5, i8 signext 98)
%7 = load i64, i64* %1
ret i64 %7
}

LLVM IR (-O2):
define i64 @main() {
%1 = tail call i32 @f(i64 5, i8 signext 97, i64 6, i8 signext 98)
ret i64 undef
}
int is_less(double a, double b) {
  int result = 0;
  if (a != (-1.0)) {
    if (b != (-1.0))
      result = (a < b);
    else
      result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<is_less>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1137 <is_less+0x37>
jp     1137 <is_less+0x37>
jmp    1183 <is_less+0x83>
movsd  -0x10(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1159 <is_less+0x59>
jp     1159 <is_less+0x59>
jmp    1177 <is_less+0x77>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
jmp    117e <is_less+0x7e>
movl   $0x1,-0x14(%rbp)
jmp    1183 <is_less+0x83>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_less>:
ucomisd 0xef8(%rip),%xmm0
jne    110c <is_less+0xc>
jnp    1122 <is_less+0x22>
ucomisd 0xeec(%rip),%xmm1
jne    1118 <is_less+0x18>
jnp    1125 <is_less+0x25>
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_less(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store double %0, double* %3
store double %1, double* %4
store i32 0, i32* %5
%6 = load double, double* %3
%7 = fcmp une double %6, -1.000000e+00
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load double, double* %4
%10 = fcmp une double %9, -1.000000e+00
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load double, double* %3
%13 = load double, double* %4
%14 = fcmp olt double %12, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %5
br label %17
16: ; preds = %8
store i32 1, i32* %5
br label %17
17: ; preds = %16, %11
br label %18
18: ; preds = %17, %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_less(double %0, double %1) {
%3 = fcmp une double %0, -1.000000e+00
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = fcmp une double %1, -1.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = fcmp olt double %0, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %6, %2
%10 = phi i32 [ %8, %6 ], [ 0, %2 ], [ 1, %4 ]
ret i32 %10
}
void gtk_widget_class_find_style_property() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_class_find_style_property() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ consoleCmdVertexDeselect();
int /*<<< orphan*/ drawerSetDim(int);
int /*<<< orphan*/ figureNew(int);
void consoleCmdClose() {
  consoleCmdVertexDeselect();
  figureNew(-1);
  drawerSetDim(-1);
}


x86 assembly (clang, -O0):
<consoleCmdClose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <consoleCmdVertexDeselect@plt>
mov    $0xffffffff,%edi
call   1050 <figureNew@plt>
mov    $0xffffffff,%edi
call   1040 <drawerSetDim@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<consoleCmdClose>:
push   %rax
xor    %eax,%eax
call   1030 <consoleCmdVertexDeselect@plt>
mov    $0xffffffff,%edi
call   1050 <figureNew@plt>
mov    $0xffffffff,%edi
pop    %rax
jmp    1040 <drawerSetDim@plt>

LLVM IR (-O0):
define void @consoleCmdClose() {
%1 = call i32 (...) @consoleCmdVertexDeselect()
%2 = call i32 @figureNew(i32 -1)
%3 = call i32 @drawerSetDim(i32 -1)
ret void
}

LLVM IR (-O2):
define void @consoleCmdClose() {
%1 = tail call i32 (...) @consoleCmdVertexDeselect()
%2 = tail call i32 @figureNew(i32 -1)
%3 = tail call i32 @drawerSetDim(i32 -1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__ **, int *, int);
uint16_t ojp_htons(uint16_t val) {
  uint8_t bytes[2] = {0};
  memcpy(&bytes, &val, 2);
  return ((uint16_t)bytes[1] << 0) | ((uint16_t)bytes[0] << 8);
}


x86 assembly (clang, -O0):
<ojp_htons>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
lea    -0x20(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
shl    $0x0,%eax
mov    -0x20(%rbp),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ojp_htons>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
mov    0x10(%rsp),%eax
shl    $0x8,%eax
or     0x18(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @ojp_htons(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i64]
store i32 %0, i32* %2
%4 = bitcast [2 x i64]* %3 to i8*
%5 = bitcast [2 x i64]* %3 to i64**
%6 = call i32 @memcpy(i64** %5, i32* %2, i32 2)
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = shl i32 %9, 0
%11 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%12 = load i64, i64* %11
%13 = trunc i64 %12 to i32
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @ojp_htons(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i64]
store i32 %0, i32* %2
%4 = bitcast [2 x i64]* %3 to i8*
%5 = bitcast [2 x i64]* %3 to i64**
%6 = call i32 @memcpy(i64** %5, i32* %2, i32 2)
%7 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %13, %9
ret i32 %14
}
/* Type definitions */
struct TransportProtocol {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct TransportProtocol *);
void freeTransportProtocol(struct TransportProtocol *transportProtocol) {
  free(transportProtocol);
}


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

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

LLVM IR (-O0):
%struct.TransportProtocol = type { i32 }
define void @freeTransportProtocol(%struct.TransportProtocol* %0) {
%2 = alloca %struct.TransportProtocol*
store %struct.TransportProtocol* %0, %struct.TransportProtocol** %2
%3 = load %struct.TransportProtocol*, %struct.TransportProtocol** %2
%4 = call i32 @free(%struct.TransportProtocol* %3)
ret void
}

LLVM IR (-O2):
%struct.TransportProtocol = type { i32 }
define void @freeTransportProtocol(%struct.TransportProtocol* nocapture %0) {
%2 = tail call i32 @free(%struct.TransportProtocol* %0)
ret void
}
/* Variables and functions */
int test_read(int, unsigned char **, int);
int /*<<< orphan*/ usleep(int);
void flush_received(int port) {
  unsigned char *dummy;
  while ((test_read(port, &dummy, 1)) != -1)
    usleep(50);
}


x86 assembly (clang, -O0):
<flush_received>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <test_read@plt>
cmp    $0xffffffff,%eax
je     1154 <flush_received+0x34>
mov    $0x32,%edi
call   1040 <usleep@plt>
jmp    112b <flush_received+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_received>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %rsp,%rsi
mov    $0x1,%edx
call   1030 <test_read@plt>
cmp    $0xffffffff,%eax
je     115e <flush_received+0x3e>
mov    %rsp,%r14
nopl   0x0(%rax,%rax,1)
mov    $0x32,%edi
call   1040 <usleep@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <test_read@plt>
cmp    $0xffffffff,%eax
jne    1140 <flush_received+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @flush_received(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = call i32 @test_read(i32 %5, i8** %3, i32 1)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call i32 @usleep(i32 50)
br label %4
10: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @flush_received(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @test_read(i32 %0, i8** %2, i32 1)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1, %6
%7 = call i32 @usleep(i32 50)
%8 = call i32 @test_read(i32 %0, i8** %2, i32 1)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %6
10: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msm_panic_wdt_set(unsigned int);
void panic_watchdog_set(unsigned int t) { msm_panic_wdt_set(t); }


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

x86 assembly (clang, -O2):
<panic_watchdog_set>:
jmp    1030 <msm_panic_wdt_set@plt>

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

LLVM IR (-O2):
define void @panic_watchdog_set(i32 %0) {
%2 = tail call i32 @msm_panic_wdt_set(i32 %0)
ret void
}
void free_3d_float(float ***p, int ndim1) {
  int i;
  free(p[0][0]);
  for (i = 0; i < ndim1; i++)
    free(p[i]);
  free(p);
}


x86 assembly (clang, -O0):
<free_3d_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <free_3d_float+0x50>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <free_3d_float+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_3d_float>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
test   %ebp,%ebp
jle    1142 <free_3d_float+0x32>
mov    %ebp,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <free_3d_float+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_3d_float(float*** nocapture %0, i32 %1) {
%3 = bitcast float*** %0 to i8***
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
tail call void @free(i8* %5)
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds float**, float*** %0, i64 %10
%12 = bitcast float*** %11 to i8**
%13 = load i8*, i8** %12
tail call void @free(i8* %13)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %2
%17 = bitcast float*** %0 to i8*
tail call void @free(i8* %17)
ret void
}
int foo() { return 9; }


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

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 9
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 9
}
int watchdog_set_timeout(unsigned t) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @watchdog_set_timeout(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
int /*<<< orphan*/ foo(int);
int main() {
  foo(12);
  bar(80);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1040 <foo@plt>
mov    $0x50,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edi
call   1040 <foo@plt>
mov    $0x50,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foo(i32 12)
%2 = call i32 @bar(i32 80)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 12)
%2 = tail call i32 @bar(i32 80)
ret i32 0
}
/* Variables and functions */
int f80(int *);
int f81(int *p) { return f80(p); }


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

x86 assembly (clang, -O2):
<f81>:
jmp    1030 <f80@plt>

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

LLVM IR (-O2):
define i32 @f81(i32* %0) {
%2 = tail call i32 @f80(i32* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get32_be(void *p) {
  return *(uint8_t *)p << 24 | *((uint8_t *)p + 1) << 16 |
         *((uint8_t *)p + 2) << 8 | *((uint8_t *)p + 3);
}


x86 assembly (clang, -O0):
<get32_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32_be>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get32_be(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 12
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_bin(int number) {
  int valor = 0;
  for (int count_bin = 0; count_bin < 32; count_bin++) {
    valor = number & (1 << (count_bin));
    printf("%d", valor > 0 ? 1 : 0);
  }
}


x86 assembly (clang, -O0):
<print_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1171 <print_bin+0x61>
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    $0x1,%eax
cmp    $0x0,%ecx
cmovg  %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <print_bin+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bin>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
xor    %ebp,%ebp
lea    0xee1(%rip),%r14
nop
mov    $0x1,%eax
mov    %ebp,%ecx
shl    %cl,%eax
xor    %esi,%esi
test   %ebx,%eax
setg   %sil
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    $0x20,%ebp
jne    1120 <print_bin+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @print_bin(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 32
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32, i32* %2
%10 = load i32, i32* %4
%11 = shl i32 1, %10
%12 = and i32 %9, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 1, i32 0
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %8
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %5
21: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @print_bin(i32 %0) {
br label %3
2: ; preds = %3
ret void
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %10, %3 ]
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %0
%7 = icmp sgt i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 32
br i1 %11, label %2, label %3
}
void _Z39_Jv_ThrowNoClassDefFoundErrorTrampolineP7ffi_cifPvPS1_S1_(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z39_Jv_ThrowNoClassDefFoundErrorTrampolineP7ffi_cifPvPS1_S1_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char const *);
int strtol(char const *, char **, int);
int parse_integer(const char *string) {
  int val;
  char *parse_end;
  val = strtol(string, &parse_end, 10);
  if (parse_end == string)
    fatal_error("Invalid number: %s", string);
  return val;
}


x86 assembly (clang, -O0):
<parse_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    115f <parse_integer+0x3f>
mov    -0x8(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1040 <fatal_error@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_integer>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %eax,%ebp
cmp    %rbx,(%rsp)
jne    114a <parse_integer+0x2a>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1040 <fatal_error@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Invalid number: %s\00"
define i32 @parse_integer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strtol(i8* %5, i8** %4, i32 10)
store i32 %6, i32* %3
%7 = load i8*, i8** %4
%8 = load i8*, i8** %2
%9 = icmp eq i8* %7, %8
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @fatal_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [19 x i8] c"Invalid number: %s\00"
define i32 @parse_integer(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, %0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @fatal_error(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
ret i32 %4
}