xunge/DecIR huggingface dataset:
int bitCount(unsigned x) {
  int b;
  for (b = 0; x != 0; x >>= 1) {
    if (x & 01) {
      b++;
    }
  }
  return b;
}


x86 assembly (clang, -O0):
<bitCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <bitCount+0x43>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1130 <bitCount+0x30>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <bitCount+0x35>
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110e <bitCount+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount>:
xor    %eax,%eax
test   %edi,%edi
je     1120 <bitCount+0x20>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <bitCount+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitCount(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = and i32 %5, 1
%7 = add nuw nsw i32 %4, %6
%8 = lshr i32 %5, 1
%9 = icmp ult i32 %5, 2
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
int isprint(int c) {
  if ((c <= 0x7E) && (c >= 0x20))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <isprint+0x27>
cmpl   $0x20,-0x8(%rbp)
jl     1127 <isprint+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isprint+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 126
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sge i32 %7, 32
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
unsigned int rightrot(unsigned int x, int n) {
  unsigned int tail = x << (32 - n);
  return x >> n | tail;
}


x86 assembly (clang, -O0):
<rightrot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightrot>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 32, %7
%9 = shl i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = lshr i32 %10, %11
%13 = load i32, i32* %5
%14 = or i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @rightrot(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = shl i32 %0, %3
%5 = lshr i32 %0, %1
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ cs_high();
int rf_meter_hal_init() {
  cs_high();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @rf_meter_hal_init() {
%1 = call i32 (...) @cs_high()
ret i32 0
}

LLVM IR (-O2):
define i32 @rf_meter_hal_init() {
%1 = tail call i32 (...) @cs_high()
ret i32 0
}
int get_suggested_cluster_size(void) {
  int r;
  r = 32 + 32 / 10;
  if (r < 32 + 5)
    r = 32 + 5;
  return r;
}


x86 assembly (clang, -O0):
<get_suggested_cluster_size>:
push   %rbp
mov    %rsp,%rbp
movl   $0x23,-0x4(%rbp)
cmpl   $0x25,-0x4(%rbp)
jge    111c <get_suggested_cluster_size+0x1c>
movl   $0x25,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_suggested_cluster_size() {
%1 = alloca i32
store i32 35, i32* %1
%2 = load i32, i32* %1
%3 = icmp slt i32 %2, 37
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 37, i32* %1
br label %5
5: ; preds = %4, %0
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_suggested_cluster_size() {
ret i32 37
}
float m_saturate(float value, float min, float max) {
  if (value < min)
    value = min;
  if (value > max)
    value = max;
  return value;
}


x86 assembly (clang, -O0):
<m_saturate>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <m_saturate+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1149 <m_saturate+0x49>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_saturate>:
maxss  %xmm0,%xmm1
minss  %xmm1,%xmm2
movaps %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define float @m_saturate(float %0, float %1, float %2) {
%4 = fcmp olt float %0, %1
%5 = select i1 %4, float %1, float %0
%6 = fcmp ogt float %5, %2
%7 = select i1 %6, float %2, float %5
ret float %7
}
/* Variables and functions */
char *julian_to_yyyy_mm_dd(double);
char *julian_display(double current) { return julian_to_yyyy_mm_dd(current); }


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

x86 assembly (clang, -O2):
<julian_display>:
jmp    1030 <julian_to_yyyy_mm_dd@plt>

LLVM IR (-O0):
define i8* @julian_display(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i8* @julian_to_yyyy_mm_dd(double %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @julian_display(double %0) {
%2 = tail call i8* @julian_to_yyyy_mm_dd(double %0)
ret i8* %2
}
/* Variables and functions */
int maxProduct(char **, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  char **s = argv + 1;
  printf("Maxp product of word lengths: %d\n", maxProduct(s, argc - 1));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"Maxp product of word lengths: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
store i8** %8, i8*** %6
%9 = load i8**, i8*** %6
%10 = load i32, i32* %4
%11 = sub nsw i32 %10, 1
%12 = call i32 @maxProduct(i8** %9, i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Maxp product of word lengths: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @maxProduct(i8** %3, i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int GL_COLOR_BUFFER_BIT;
int GL_DEPTH_BUFFER_BIT;
int /*<<< orphan*/ glClear(int);
int /*<<< orphan*/ glColor4f(double, double, double, double);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ glutWireIcosahedron();
void display(void) {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glColor4f(1.0, 1.0, 1.0, 1.0);
  glutWireIcosahedron();
  glFlush();
}


x86 assembly (clang, -O0):
<display>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e94(%rip),%rax
or     (%rax),%edi
call   1040 <glClear@plt>
movsd  0xe9d(%rip),%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glColor4f@plt>
mov    $0x0,%al
call   1060 <glutWireIcosahedron@plt>
mov    $0x0,%al
call   1050 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display>:
push   %rax
mov    0x2e90(%rip),%rax
mov    0x2e99(%rip),%rcx
mov    (%rcx),%edi
or     (%rax),%edi
call   1040 <glClear@plt>
movsd  0xea0(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
movaps %xmm0,%xmm3
call   1030 <glColor4f@plt>
xor    %eax,%eax
call   1060 <glutWireIcosahedron@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <glFlush@plt>

LLVM IR (-O0):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %1, %2
%4 = call i32 @glClear(i32 %3)
%5 = call i32 @glColor4f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%6 = call i32 (...) @glutWireIcosahedron()
%7 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@GL_COLOR_BUFFER_BIT = global i32 0
@GL_DEPTH_BUFFER_BIT = global i32 0
define void @display() {
%1 = load i32, i32* @GL_COLOR_BUFFER_BIT
%2 = load i32, i32* @GL_DEPTH_BUFFER_BIT
%3 = or i32 %2, %1
%4 = tail call i32 @glClear(i32 %3)
%5 = tail call i32 @glColor4f(double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00)
%6 = tail call i32 (...) @glutWireIcosahedron()
%7 = tail call i32 (...) @glFlush()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void afficherMenu() {
  printf("Que vouslez-vous faire ?\n\t1 - Consulter un compte;\n\t2 - "
         "Effectuer un transfert;\n\t3 - Afficher l'etat des comptes;\n\t4 - "
         "Quitter.\nVeuillez entrer le chiffre correspondant a votre choix.\n");
}


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

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

LLVM IR (-O0):
@.str = [185 x i8] c"Que vouslez-vous faire ?\0A\091 - Consulter un compte;\0A\092 - Effectuer un transfert;\0A\093 - Afficher l'etat des comptes;\0A\094 - Quitter.\0AVeuillez entrer le chiffre correspondant a votre choix.\0A\00"
define void @afficherMenu() {
%1 = call i32 @printf(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [184 x i8] c"Que vouslez-vous faire ?\0A\091 - Consulter un compte;\0A\092 - Effectuer un transfert;\0A\093 - Afficher l'etat des comptes;\0A\094 - Quitter.\0AVeuillez entrer le chiffre correspondant a votre choix.\00"
define void @afficherMenu() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([184 x i8], [184 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timespec {
  long long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
long long time_to_ns(struct timespec *ts) {
  return (long long)ts->tv_sec * 1000 * 1000 * 1000 + ts->tv_nsec;
}


x86 assembly (clang, -O0):
<time_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,0x8(%rax),%rax
imul   $0x3e8,%rax,%rax
imul   $0x3e8,%rax,%rax
mov    -0x8(%rbp),%rcx
add    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_to_ns>:
imul   $0x3b9aca00,0x8(%rdi),%rax
3b
add    (%rdi),%rax
ret

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

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @time_to_ns(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = add nsw i64 %4, %6
ret i64 %7
}
float zero_to_one(float n) {
  if (n < 0.0)
    return 0.0;
  if (n > 1.0)
    return 1.0;
  return n;
}


x86 assembly (clang, -O0):
<zero_to_one>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    112c <zero_to_one+0x2c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <zero_to_one+0x63>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1159 <zero_to_one+0x59>
movss  0xeb9(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1163 <zero_to_one+0x63>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_to_one>:
movss  0xef8(%rip),%xmm1
minss  %xmm0,%xmm1
xorps  %xmm2,%xmm2
cmpltss %xmm2,%xmm0
andnps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @zero_to_one(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
void foo() {
  struct {
    int a : 1;
    int b : 1;
  } entry = {0};
}


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

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

LLVM IR (-O0):
%struct.anon = type { i8, [3 x i8] }
@__const.foo.entry = %struct.anon { i8 0, [3 x i8] undef }
define void @foo() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
char *strdup(char *);
int strlen(char *);
char *removeQuotes(char *argument) {
  char *str = strdup(&argument[1]);
  str[strlen(str) - 1] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<removeQuotes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<removeQuotes>:
push   %rbx
add    $0x1,%rdi
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @removeQuotes(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i8* @strdup(i8* %2)
%4 = tail call i32 @strlen(i8* %3)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
store i8 0, i8* %7
ret i8* %3
}
void clamp(float *f, float min, float max) {
  if (*f < min)
    *f = min;
  else if (*f > max)
    *f = max;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    113a <clamp+0x3a>
movss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
jmp    115e <clamp+0x5e>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1159 <clamp+0x59>
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
jmp    115e <clamp+0x5e>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
movss  (%rdi),%xmm2
ucomiss %xmm2,%xmm0
ja     1111 <clamp+0x11>
ucomiss %xmm1,%xmm2
movaps %xmm1,%xmm0
jbe    1115 <clamp+0x15>
movss  %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @clamp(float* nocapture %0, float %1, float %2) {
%4 = load float, float* %0
%5 = fcmp olt float %4, %1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = fcmp ogt float %4, %2
br i1 %7, label %8, label %10
8: ; preds = %6, %3
%9 = phi float [ %1, %3 ], [ %2, %6 ]
store float %9, float* %0
br label %10
10: ; preds = %8, %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int ipsec_validate_key_information(u_int8_t *buf, size_t sz) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ipsec_validate_key_information(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
void c_pomp_taskwait_enter_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_taskwait_enter_(%struct.ompregdescr* nocapture %0) {
ret void
}
void vgSeti(VGParamType, VGint) {}


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

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

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

LLVM IR (-O2):
define void @vgSeti(i32 %0, i32 %1) {
ret void
}
float f(b, l, t)
float b, t;
long int l;
{ return (power(b, l + 1) - b - (t * b) + t); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm1,-0x20(%rbp)
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%al
call   1030 <power@plt>
cvtsi2ss %eax,%xmm1
subss  -0x4(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
addss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
cvtsd2ss %xmm0,%xmm2
movss  %xmm2,(%rsp)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm2,%xmm0
add    $0x1,%rdi
mov    $0x1,%al
call   1030 <power@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  (%rsp),%xmm2
subss  %xmm2,%xmm0
movss  0x4(%rsp),%xmm1
mulss  %xmm1,%xmm2
subss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f(double %0, i64 %1, double %2) {
%4 = alloca float
%5 = alloca i64
%6 = alloca float
%7 = fptrunc double %0 to float
%8 = fptrunc double %2 to float
store float %7, float* %4
store i64 %1, i64* %5
store float %8, float* %6
%9 = load float, float* %4
%10 = fpext float %9 to double
%11 = load i64, i64* %5
%12 = add nsw i64 %11, 1
%13 = call i32 (double, i64, ...) bitcast (i32 (...)* @power to i32 (double, i64, ...)*)(double %10, i64 %12)
%14 = sitofp i32 %13 to float
%15 = load float, float* %4
%16 = fsub float %14, %15
%17 = load float, float* %6
%18 = load float, float* %4
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float %16)
%21 = load float, float* %6
%22 = fadd float %20, %21
ret float %22
}

LLVM IR (-O2):
define float @f(double %0, i64 %1, double %2) {
%4 = fptrunc double %0 to float
%5 = fptrunc double %2 to float
%6 = fpext float %4 to double
%7 = add nsw i64 %1, 1
%8 = tail call i32 (double, i64, ...) bitcast (i32 (...)* @power to i32 (double, i64, ...)*)(double %6, i64 %7)
%9 = sitofp i32 %8 to float
%10 = fsub float %9, %4
%11 = fneg float %5
%12 = tail call float @llvm.fmuladd.f32(float %11, float %4, float %10)
%13 = fadd float %12, %5
ret float %13
}
int compare_strings(ptr1, ptr2)
char **ptr1, **ptr2;
{ return strcmp(*ptr1, *ptr2); }


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

x86 assembly (clang, -O2):
<compare_strings>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compare_strings(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int **combinationSum(int *, int, int, int **, int *);
int main(void) {
  int x[] = {8, 7, 4, 3}, *col, size, **res;
  res = combinationSum(x, sizeof(x) / sizeof(x[0]), 11, &col, &size);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0xb,%edx
lea    -0x28(%rbp),%rcx
lea    -0x2c(%rbp),%r8
call   1030 <combinationSum@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0x20(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x4,%esi
mov    $0xb,%edx
call   1030 <combinationSum@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [4 x i32] [i32 8, i32 7, i32 4, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32**
store i32 0, i32* %1
%6 = bitcast [4 x i32]* %2 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = call i32** @combinationSum(i32* %7, i32 4, i32 11, i32** %3, i32* %4)
store i32** %8, i32*** %5
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [4 x i32] [i32 8, i32 7, i32 4, i32 3]
define i32 @main() {
%1 = alloca [4 x i32]
%2 = alloca i32*
%3 = alloca i32
%4 = bitcast [4 x i32]* %1 to i8*
%5 = bitcast i32** %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%8 = call i32** @combinationSum(i32* %7, i32 4, i32 11, i32** %2, i32* %3)
ret i32 0
}
unsigned int get_color(unsigned int base_shift, double intensity) {
  unsigned int color = 0xFF * (intensity / 20);
  return (0xFFFFFF & (color << base_shift));
}


x86 assembly (clang, -O0):
<get_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee3(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    %cl,%eax
and    $0xffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_color>:
mov    %edi,%ecx
divsd  0xef6(%rip),%xmm0
mulsd  0xef6(%rip),%xmm0
cvttsd2si %xmm0,%rax
shl    %cl,%eax
and    $0xffffff,%eax
ret

LLVM IR (-O0):
define i32 @get_color(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store i32 %0, i32* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fdiv double %6, 2.000000e+01
%8 = fmul double 2.550000e+02, %7
%9 = fptoui double %8 to i32
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = shl i32 %10, %11
%13 = and i32 16777215, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_color(i32 %0, double %1) {
%3 = fdiv double %1, 2.000000e+01
%4 = fmul double %3, 2.550000e+02
%5 = fptoui double %4 to i32
%6 = shl i32 %5, %0
%7 = and i32 %6, 16777215
ret i32 %7
}
int HelpItem4(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem4() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("No X on this computer\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"No X on this computer\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void gdk_draw_pixbuf() {}


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

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

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

LLVM IR (-O2):
define void @gdk_draw_pixbuf() {
ret void
}
/* Type definitions */
typedef unsigned long long uint8_t;
typedef unsigned long long uint64_t;

/* Variables and functions */
void volatile_set_bit_u64(uint64_t *mask, uint8_t bit) {
  *((volatile uint64_t *)mask) |= 1ULL << bit;
}


x86 assembly (clang, -O0):
<volatile_set_bit_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     %rdx,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_set_bit_u64>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
or     %rax,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_set_bit_u64(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = shl i64 1, %5
%7 = load i64*, i64** %3
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %6
store volatile i64 %9, i64* %7
ret void
}

LLVM IR (-O2):
define void @volatile_set_bit_u64(i64* %0, i64 %1) {
%3 = shl nuw i64 1, %1
%4 = load volatile i64, i64* %0
%5 = or i64 %4, %3
store volatile i64 %5, i64* %0
ret void
}
void ads_init(void) {}


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

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

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

LLVM IR (-O2):
define void @ads_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CP15DCacheEnable();
int /*<<< orphan*/ CP15ICacheEnable();
void cache_enable(void) {
  CP15ICacheEnable();
  CP15DCacheEnable();
}


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

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

LLVM IR (-O0):
define void @cache_enable() {
%1 = call i32 (...) @CP15ICacheEnable()
%2 = call i32 (...) @CP15DCacheEnable()
ret void
}

LLVM IR (-O2):
define void @cache_enable() {
%1 = tail call i32 (...) @CP15ICacheEnable()
%2 = tail call i32 (...) @CP15DCacheEnable()
ret void
}
int square_root(int n) {
  int i;
  if (n < 0)
    return -1;
  for (i = 0; i <= n; i++) {
    if (i * i == n)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<square_root>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <square_root+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1165 <square_root+0x65>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     115e <square_root+0x5e>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114b <square_root+0x4b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1165 <square_root+0x65>
jmp    1150 <square_root+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <square_root+0x24>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_root>:
mov    $0xffffffff,%eax
test   %edi,%edi
js     1120 <square_root+0x20>
lea    0x1(%rdi),%edx
xor    %ecx,%ecx
xchg   %ax,%ax
mov    %ecx,%esi
imul   %ecx,%esi
cmp    %edi,%esi
je     1121 <square_root+0x21>
add    $0x1,%ecx
cmp    %ecx,%edx
jne    1110 <square_root+0x10>
ret
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @square_root(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %26
8: ; preds = %1
store i32 0, i32* %4
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load i32, i32* %4
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = load i32, i32* %3
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %26
21: ; preds = %13
br label %22
22: ; preds = %21
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %9
25: ; preds = %9
store i32 -1, i32* %2
br label %26
26: ; preds = %25, %19, %7
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @square_root(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ 0, %1 ]
%5 = mul nsw i32 %4, %4
%6 = icmp eq i32 %5, %0
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nuw i32 %4, 1
%9 = icmp eq i32 %4, %0
br i1 %9, label %10, label %3
10: ; preds = %3, %7, %1
%11 = phi i32 [ -1, %1 ], [ %4, %3 ], [ -1, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ i2c_wr(int, int /*<<< orphan*/, int /*<<< orphan*/ *, int);
void i2c_wr8(int fd, uint16_t reg, uint8_t val) { i2c_wr(fd, reg, &val, 1); }


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

x86 assembly (clang, -O2):
<i2c_wr8>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x1,%ecx
call   1030 <i2c_wr@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @i2c_wr8(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 = call i32 @i2c_wr(i32 %7, i32 %8, i32* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @i2c_wr8(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @i2c_wr(i32 %0, i32 %1, i32* %4, i32 1)
ret void
}
char min(char a, char b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jge    112c <min+0x2c>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <min+0x33>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %al,%dil
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @min(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
br label %16
13: ; preds = %2
%14 = load i8, i8* %4
%15 = sext i8 %14 to i32
br label %16
16: ; preds = %13, %10
%17 = phi i32 [ %12, %10 ], [ %15, %13 ]
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @min(i8 signext %0, i8 signext %1) {
%3 = icmp slt i8 %0, %1
%4 = select i1 %3, i8 %0, i8 %1
ret i8 %4
}
void yy_1_XmlAttributeGarbage(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_XmlAttributeGarbage(i8* nocapture %0, i32 %1) {
ret void
}
unsigned test2(unsigned n, unsigned p) {
  static struct { char c; } s;
  unsigned x;
  assert(__alignof__(s) != 64);
  asm("" : "=g"(x), "+m"(s) : "0"(&x));
  return n ? test2(n - 1, x) : (x ^ p);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <assert@plt>
lea    -0xc(%rbp),%rax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1161 <test2+0x41>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
call   1040 <test2@plt>
mov    %eax,-0x10(%rbp)
jmp    116a <test2+0x4a>
mov    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <assert@plt>
lea    0x4(%rsp),%rax
mov    %eax,0x4(%rsp)
test   %ebp,%ebp
je     1152 <test2+0x32>
add    $0xffffffff,%ebp
mov    0x4(%rsp),%esi
mov    %ebp,%edi
call   1040 <test2@plt>
mov    %eax,%ebx
jmp    1156 <test2+0x36>
xor    0x4(%rsp),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.anon = type { i8 }
@test2.s = internal global %struct.anon zeroinitializer
define i32 @test2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* %3
%11 = sub i32 %10, 1
%12 = load i32, i32* %5
%13 = call i32 @test2(i32 %11, i32 %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = xor i32 %15, %16
br label %18
18: ; preds = %14, %9
%19 = phi i32 [ %13, %9 ], [ %17, %14 ]
ret i32 %19
}

LLVM IR (-O2):
%struct.anon = type { i8 }
@test2.s = internal global %struct.anon zeroinitializer
define i32 @test2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 1)
%6 = icmp eq i32 %0, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = add i32 %0, -1
%9 = load i32, i32* %3
%10 = call i32 @test2(i32 %8, i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* %3
%13 = xor i32 %12, %1
br label %14
14: ; preds = %11, %7
%15 = phi i32 [ %10, %7 ], [ %13, %11 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  puts("Hello World");
  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)
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\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 = call i32 @puts(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"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(char *, char *);
int f_udf(int mode, unsigned char **sec, float *data, unsigned int ndata,
          char *inv_out, void **local, const char *arg1, const char *arg2) {
  fatal_error("User Defined Functions are not installed", "");
  return 1;
}


x86 assembly (clang, -O0):
<f_udf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
lea    0xec3(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <fatal_error@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_udf>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1030 <fatal_error@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"User Defined Functions are not installed\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @f_udf(i32 %0, i8** %1, float* %2, i32 %3, i8* %4, i8** %5, i8* %6, i8* %7) {
%9 = alloca i32
%10 = alloca i8**
%11 = alloca float*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8**
%15 = alloca i8*
%16 = alloca i8*
store i32 %0, i32* %9
store i8** %1, i8*** %10
store float* %2, float** %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i8** %5, i8*** %14
store i8* %6, i8** %15
store i8* %7, i8** %16
%17 = call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [41 x i8] c"User Defined Functions are not installed\00"
@.str.1 = [1 x i8] zeroinitializer
define i32 @f_udf(i32 %0, i8** nocapture readnone %1, float* nocapture readnone %2, i32 %3, i8* nocapture readnone %4, i8** nocapture readnone %5, i8* nocapture readnone %6, i8* nocapture readnone %7) {
%9 = tail call i32 @fatal_error(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret i32 1
}
void TZX_OpenOutputFile(char *OutputFilename) {}


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

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

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

LLVM IR (-O2):
define void @TZX_OpenOutputFile(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void f3(char *x) { free(x); }


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

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

LLVM IR (-O2):
define void @f3(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ displays_expect_equal_failed(int, int, char const *, int);
void Displayer_display_expect_equal_failed(int exp, int act, const char *file,
                                           int line) {
  displays_expect_equal_failed(exp, act, file, line);
}


x86 assembly (clang, -O0):
<Displayer_display_expect_equal_failed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <displays_expect_equal_failed@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Displayer_display_expect_equal_failed>:
jmp    1030 <displays_expect_equal_failed@plt>

LLVM IR (-O0):
define void @Displayer_display_expect_equal_failed(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @displays_expect_equal_failed(i32 %9, i32 %10, i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @Displayer_display_expect_equal_failed(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @displays_expect_equal_failed(i32 %0, i32 %1, i8* %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_clear(int);
int /*<<< orphan*/ mi_get_commands();
int /*<<< orphan*/ mi_send_status();
int mi_event(void) {
  mi_get_commands();
  mi_send_status();
  error_clear(0xFFFFFFFF);
  return 0;
}


x86 assembly (clang, -O0):
<mi_event>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <mi_get_commands@plt>
mov    $0x0,%al
call   1030 <mi_send_status@plt>
mov    $0xffffffff,%edi
call   1040 <error_clear@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_event>:
push   %rax
xor    %eax,%eax
call   1050 <mi_get_commands@plt>
xor    %eax,%eax
call   1030 <mi_send_status@plt>
mov    $0xffffffff,%edi
call   1040 <error_clear@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mi_event() {
%1 = call i32 (...) @mi_get_commands()
%2 = call i32 (...) @mi_send_status()
%3 = call i32 @error_clear(i32 -1)
ret i32 0
}

LLVM IR (-O2):
define i32 @mi_event() {
%1 = tail call i32 (...) @mi_get_commands()
%2 = tail call i32 (...) @mi_send_status()
%3 = tail call i32 @error_clear(i32 -1)
ret i32 0
}
int test_imm_7Bint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x7B << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Bint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 528280977408
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}