xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ u_long;
typedef int /*<<< orphan*/ u_char;

/* Variables and functions */
int /*<<< orphan*/ NS_GET32(int /*<<< orphan*/, int /*<<< orphan*/ const *);
u_long _getlong(const u_char *src) {
  u_long dst;
  NS_GET32(dst, src);
  return dst;
}


x86 assembly (clang, -O0):
<_getlong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <NS_GET32@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_getlong(i32* %0) {
%2 = tail call i32 @NS_GET32(i32 undef, i32* %0)
ret i32 undef
}
/* Type definitions */
struct object {
  int dummy;
};
struct class_t {
  int dummy;
};

/* Variables and functions */
struct object *run_class(struct class_t *namespace) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.object = type { i32 }
%struct.class_t = type { i32 }
define %struct.object* @run_class(%struct.class_t* %0) {
%2 = alloca %struct.class_t*
store %struct.class_t* %0, %struct.class_t** %2
ret %struct.object* null
}

LLVM IR (-O2):
%struct.object = type { i32 }
%struct.class_t = type { i32 }
define noalias %struct.object* @run_class(%struct.class_t* nocapture readnone %0) {
ret %struct.object* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main(int argc, const char **argv) {
  for (int fahr = 0; fahr <= 300; fahr += 20) {
    int celsius = 5 * (fahr - 32) / 9;
    printf("%d\t%d\n", fahr, celsius);
  }
  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)
movl   $0x0,-0x14(%rbp)
cmpl   $0x12c,-0x14(%rbp)
jg     116e <main+0x5e>
mov    -0x14(%rbp),%eax
sub    $0x20,%eax
imul   $0x5,%eax,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0xffffffec,%ebx
mov    $0xff60,%r15w
lea    0xeda(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
add    $0x14,%ebx
movswl %r15w,%eax
imul   $0x1c72,%eax,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
shr    $0x10,%eax
add    %ecx,%eax
movswl %ax,%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x64,%r15d
cmp    $0x119,%ebx
jb     1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %19, %2
%9 = load i32, i32* %6
%10 = icmp sle i32 %9, 300
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %6
%13 = sub nsw i32 %12, 32
%14 = mul nsw i32 5, %13
%15 = sdiv i32 %14, 9
store i32 %15, i32* %7
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 20
store i32 %21, i32* %6
br label %8
22: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %4
3: ; preds = %4
ret i32 0
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %12, %4 ]
%6 = trunc i32 %5 to i16
%7 = mul nuw nsw i16 %6, 5
%8 = add nsw i16 %7, -160
%9 = sdiv i16 %8, 9
%10 = sext i16 %9 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %10)
%12 = add nuw nsw i32 %5, 20
%13 = icmp ult i32 %5, 281
br i1 %13, label %4, label %3
}
int mystrlen(char string[]) {
  int n = 0;
  while (string[++n] != '\0')
    ;
  return n;
}


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

x86 assembly (clang, -O2):
<mystrlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <mystrlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @mystrlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %4, %2 ], [ 0, %1 ]
%4 = add nuw nsw i64 %3, 1
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %4 to i32
ret i32 %9
}
_Bool is_ready(char *comet, char *group) {
  return mod47(comet) == mod47(group);
}


x86 assembly (clang, -O0):
<is_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <mod47@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <mod47@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_ready>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <mod47@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <mod47@plt>
cmp    %eax,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i1 @is_ready(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 = call i32 (i8*, ...) bitcast (i32 (...)* @mod47 to i32 (i8*, ...)*)(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @mod47 to i32 (i8*, ...)*)(i8* %7)
%9 = icmp eq i32 %6, %8
ret i1 %9
}

LLVM IR (-O2):
define zeroext i1 @is_ready(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mod47 to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @mod47 to i32 (i8*, ...)*)(i8* %1)
%5 = icmp eq i32 %3, %4
ret i1 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ times_two(int *);
int main() {
  int num = 13;
  times_two(&num);
  printf("%d", num);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xd,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <times_two@plt>
mov    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 13, i32* %1
%3 = call i32 @times_two(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _eject_error(char const *message, int ret) {
  fputs("eject"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_eject_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eject_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"eject: \00"
@stderr = global i32 0
define i32 @_eject_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [8 x i8] c"eject: \00"
@stderr = global i32 0
define i32 @_eject_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
int writeConf(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @writeConf() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ s2qvp(float *, float *, float *, float *, float *, float *);
void s2qvp_(float *dx1, float *dx2, float *dy1, float *dy2, float *dz1,
            float *dz2) {
  s2qvp(dx1, dx2, dy1, dy2, dz1, dz2);
}


x86 assembly (clang, -O0):
<s2qvp_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <s2qvp@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2qvp_>:
jmp    1030 <s2qvp@plt>

LLVM IR (-O0):
define void @s2qvp_(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5) {
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca float*
%11 = alloca float*
%12 = alloca float*
store float* %0, float** %7
store float* %1, float** %8
store float* %2, float** %9
store float* %3, float** %10
store float* %4, float** %11
store float* %5, float** %12
%13 = load float*, float** %7
%14 = load float*, float** %8
%15 = load float*, float** %9
%16 = load float*, float** %10
%17 = load float*, float** %11
%18 = load float*, float** %12
%19 = call i32 @s2qvp(float* %13, float* %14, float* %15, float* %16, float* %17, float* %18)
ret void
}

LLVM IR (-O2):
define void @s2qvp_(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5) {
%7 = tail call i32 @s2qvp(float* %0, float* %1, float* %2, float* %3, float* %4, float* %5)
ret void
}
int foo2(void) {
  volatile union {
    char a[sizeof(unsigned)];
    unsigned b;
  } u;
  u.b = 0x01;
  return u.a[0];
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
movl   $0x1,-0x4(%rsp)
movsbl -0x4(%rsp),%eax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @foo2() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i32*
store volatile i32 1, i32* %2
%3 = bitcast %union.anon* %1 to [4 x i8]*
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = load volatile i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 1, i32* %1
%3 = load volatile i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}
double f(double a) { return (4.0 / (1.0 + a * a)); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
mulsd  %xmm0,%xmm1
movsd  0xee9(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xed5(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mulsd  %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
movsd  0xef4(%rip),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double %3, double %4, double 1.000000e+00)
%6 = fdiv double 4.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = fdiv double 4.000000e+00, %2
ret double %3
}
/* Type definitions */
struct backlight {
  int dummy;
};

/* Variables and functions */
int EOPNOTSUPP;
int default_set_brightness(struct backlight *b, int value) {
  return -EOPNOTSUPP;
}


x86 assembly (clang, -O0):
<default_set_brightness>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_set_brightness>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.backlight = type { i32 }
@EOPNOTSUPP = global i32 0
define i32 @default_set_brightness(%struct.backlight* %0, i32 %1) {
%3 = alloca %struct.backlight*
%4 = alloca i32
store %struct.backlight* %0, %struct.backlight** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EOPNOTSUPP
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.backlight = type { i32 }
@EOPNOTSUPP = global i32 0
define i32 @default_set_brightness(%struct.backlight* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EOPNOTSUPP
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ put8(unsigned char);
void mov_preg64preg64_imm8(int reg1, int reg2, unsigned char imm8) {
  put8(0xC6);
  put8(0x04);
  put8((reg1 << 3) | reg2);
  put8(imm8);
}


x86 assembly (clang, -O0):
<mov_preg64preg64_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0xc6,%edi
call   1030 <put8@plt>
mov    $0x4,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
or     -0x8(%rbp),%eax
movzbl %al,%edi
call   1030 <put8@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_preg64preg64_imm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xc6,%edi
call   1030 <put8@plt>
mov    $0x4,%edi
call   1030 <put8@plt>
shl    $0x3,%ebx
or     %ebp,%ebx
movzbl %bl,%edi
call   1030 <put8@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @mov_preg64preg64_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = call i32 @put8(i8 zeroext -58)
%8 = call i32 @put8(i8 zeroext 4)
%9 = load i32, i32* %4
%10 = shl i32 %9, 3
%11 = load i32, i32* %5
%12 = or i32 %10, %11
%13 = trunc i32 %12 to i8
%14 = call i32 @put8(i8 zeroext %13)
%15 = load i8, i8* %6
%16 = call i32 @put8(i8 zeroext %15)
ret void
}

LLVM IR (-O2):
define void @mov_preg64preg64_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @put8(i8 zeroext -58)
%5 = tail call i32 @put8(i8 zeroext 4)
%6 = shl i32 %0, 3
%7 = or i32 %6, %1
%8 = trunc i32 %7 to i8
%9 = tail call i32 @put8(i8 zeroext %8)
%10 = tail call i32 @put8(i8 zeroext %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t my_gettid() {
  pid_t tid;
  tid = syscall(SYS_gettid);
  return tid;
}


x86 assembly (clang, -O0):
<my_gettid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_gettid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @my_gettid() {
%1 = alloca i32
%2 = load i32, i32* @SYS_gettid
%3 = call i32 @syscall(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @my_gettid() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
isKanji(c) {
  c &= 0xff;
  return (c > 0x80 && c < 0xa0 || c > 0xdf && c < 0xfd);
}


x86 assembly (clang, -O0):
<isKanji>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jle    1131 <isKanji+0x31>
mov    $0x1,%al
cmpl   $0xa0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1156 <isKanji+0x56>
xor    %eax,%eax
cmpl   $0xdf,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jle    1150 <isKanji+0x50>
cmpl   $0xfd,-0x4(%rbp)
setl   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isKanji>:
movzbl %dil,%eax
lea    -0x81(%rax),%ecx
cmp    $0x1f,%ecx
setb   %cl
add    $0xffffff20,%eax
cmp    $0x1d,%eax
setb   %al
or     %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @isKanji(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 128
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 160
br i1 %9, label %18, label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 223
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp slt i32 %14, 253
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ false, %10 ], [ %15, %13 ]
br label %18
18: ; preds = %16, %7
%19 = phi i1 [ true, %7 ], [ %17, %16 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @isKanji(i32 %0) {
%2 = and i32 %0, 255
%3 = add nsw i32 %2, -129
%4 = icmp ult i32 %3, 31
%5 = add nsw i32 %2, -224
%6 = icmp ult i32 %5, 29
%7 = select i1 %4, i1 true, i1 %6
%8 = zext i1 %7 to i32
ret i32 %8
}
long double test5l(long double a, long double b) {
  return __builtin_copysignl(a, b);
}


x86 assembly (clang, -O0):
<test5l>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fstpt  -0x30(%rbp)
fabs
fld    %st(0)
fchs
mov    -0x27(%rbp),%al
test   $0x80,%al
fxch   %st(1)
fcmovne %st(1),%st
fstp   %st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5l>:
fldt   0x8(%rsp)
fldt   0x18(%rsp)
fstpt  -0x18(%rsp)
fabs
testb  $0x80,-0xf(%rsp)
fld    %st(0)
fchs
fxch   %st(1)
fcmovne %st(1),%st
fstp   %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @test5l(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = call x86_fp80 @llvm.copysign.f80(x86_fp80 %5, x86_fp80 %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @test5l(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call x86_fp80 @llvm.copysign.f80(x86_fp80 %0, x86_fp80 %1)
ret x86_fp80 %3
}
is_op(c) char c;
{
  if (any(c, "+-*/&%|^<>"))
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<is_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
lea    0xed7(%rip),%rsi
mov    $0x0,%al
call   1030 <any@plt>
cmp    $0x0,%eax
je     1145 <is_op+0x35>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_op+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_op>:
push   %rax
movsbl %dil,%edi
lea    0xee4(%rip),%rsi
xor    %eax,%eax
call   1030 <any@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"+-*/&%|^<>\00"
define i32 @is_op(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [11 x i8] c"+-*/&%|^<>\00"
define i32 @is_op(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @any to i32 (i32, i8*, ...)*)(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ sl_hwaddr_parse(char const *, unsigned char *);
int sl_hwaddr_aton(const char *txt, unsigned char *addr) {
  return sl_hwaddr_parse(txt, addr) ? 0 : -1;
}


x86 assembly (clang, -O0):
<sl_hwaddr_aton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sl_hwaddr_parse@plt>
mov    %rax,%rdx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_hwaddr_aton>:
push   %rax
call   1030 <sl_hwaddr_parse@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @sl_hwaddr_aton(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** %4
%7 = call i64 @sl_hwaddr_parse(i8* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 -1
ret i32 %10
}

LLVM IR (-O2):
define i32 @sl_hwaddr_aton(i8* %0, i8* %1) {
%3 = tail call i64 @sl_hwaddr_parse(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
char *strchr(char const *, int);
char *mc_strrchr(const char *s, int c) { return strchr(s, c); }


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

x86 assembly (clang, -O2):
<mc_strrchr>:
jmp    1030 <strchr@plt>

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

LLVM IR (-O2):
define i8* @mc_strrchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
ret i8* %3
}
unsigned int adfs_time(unsigned int load, unsigned int exec) {
  unsigned int high, low;
  high = ((load << 24) | (exec >> 8)) - 0x336e996a;
  low = exec & 255;
  return (((high % 100) << 8) + low) / 100 + (high / 100 << 8);
}


x86 assembly (clang, -O0):
<adfs_time>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
shr    $0x8,%ecx
or     %ecx,%eax
sub    $0x336e996a,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
shl    $0x8,%eax
add    -0x10(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adfs_time>:
shld   $0x18,%esi,%edi
add    $0xcc916696,%edi
and    $0xfc,%esi
imul   $0x51eb851f,%rdi,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%ecx
sub    %ecx,%edi
shl    $0x8,%edi
or     %esi,%edi
imul   $0x51eb851f,%rdi,%rcx
shr    $0x25,%rcx
shl    $0x8,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @adfs_time(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = shl i32 %7, 24
%9 = load i32, i32* %4
%10 = lshr i32 %9, 8
%11 = or i32 %8, %10
%12 = sub i32 %11, 862886250
store i32 %12, i32* %5
%13 = load i32, i32* %4
%14 = and i32 %13, 255
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = urem i32 %15, 100
%17 = shl i32 %16, 8
%18 = load i32, i32* %6
%19 = add i32 %17, %18
%20 = udiv i32 %19, 100
%21 = load i32, i32* %5
%22 = udiv i32 %21, 100
%23 = shl i32 %22, 8
%24 = add i32 %20, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @adfs_time(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %1, i32 24)
%4 = add i32 %3, -862886250
%5 = and i32 %1, 252
%6 = urem i32 %4, 100
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %5
%9 = udiv i32 %8, 100
%10 = udiv i32 %4, 100
%11 = shl i32 %10, 8
%12 = add i32 %9, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("argc = %d\n", argc);
  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    -0x8(%rbp),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"argc = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int stress_qsort_cmp_1(void const *, void const *);
int stress_qsort_cmp_2(const void *p1, const void *p2) {
  return stress_qsort_cmp_1(p2, p1);
}


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

x86 assembly (clang, -O2):
<stress_qsort_cmp_2>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <stress_qsort_cmp_1@plt>

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

LLVM IR (-O2):
define i32 @stress_qsort_cmp_2(i8* %0, i8* %1) {
%3 = tail call i32 @stress_qsort_cmp_1(i8* %1, i8* %0)
ret i32 %3
}
/* Variables and functions */
int cosf(float);
float cosine_interp(float p1, float p2, float amount) {
  float mu2 = (1 - cosf(amount * 3.14159265358979323846f)) / 2;
  return (p2 * (1 - mu2) + p1 * mu2);
}


x86 assembly (clang, -O0):
<cosine_interp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xed5(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1030 <cosf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xea0(%rip),%xmm2
subss  -0x10(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosine_interp>:
push   %rax
movss  %xmm1,0x4(%rsp)
movss  %xmm0,(%rsp)
mulss  0xedc(%rip),%xmm2
movaps %xmm2,%xmm0
call   1030 <cosf@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
xorps  %xmm1,%xmm1
cvtsi2ss %eax,%xmm1
movss  0xeb9(%rip),%xmm0
subss  %xmm1,%xmm0
movss  (%rsp),%xmm2
mulss  %xmm1,%xmm2
mulss  0x4(%rsp),%xmm0
addss  %xmm2,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @cosine_interp(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %6
%9 = fmul float %8, 0x400921FB60000000
%10 = call i32 @cosf(float %9)
%11 = sub nsw i32 1, %10
%12 = sdiv i32 %11, 2
%13 = sitofp i32 %12 to float
store float %13, float* %7
%14 = load float, float* %5
%15 = load float, float* %7
%16 = fsub float 1.000000e+00, %15
%17 = load float, float* %4
%18 = load float, float* %7
%19 = fmul float %17, %18
%20 = call float @llvm.fmuladd.f32(float %14, float %16, float %19)
ret float %20
}

LLVM IR (-O2):
define float @cosine_interp(float %0, float %1, float %2) {
%4 = fmul float %2, 0x400921FB60000000
%5 = tail call i32 @cosf(float %4)
%6 = sub nsw i32 1, %5
%7 = sdiv i32 %6, 2
%8 = sitofp i32 %7 to float
%9 = fsub float 1.000000e+00, %8
%10 = fmul float %8, %0
%11 = tail call float @llvm.fmuladd.f32(float %1, float %9, float %10)
ret float %11
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mcp2515_spi_select();
int /*<<< orphan*/ mcp2515_spi_transfer(int, int *);
int /*<<< orphan*/ mcp2515_spi_unselect();
void mcp2515_read(uint8_t regAddr, uint8_t *dataAddr) {
  assert(dataAddr != 0);
  mcp2515_spi_select();
  mcp2515_spi_transfer(0x03, NULL);
  mcp2515_spi_transfer(regAddr, NULL);
  mcp2515_spi_transfer(0, dataAddr);
  mcp2515_spi_unselect();
}


x86 assembly (clang, -O0):
<mcp2515_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    $0x0,%al
call   1030 <mcp2515_spi_select@plt>
mov    $0x3,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <mcp2515_spi_transfer@plt>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <mcp2515_spi_transfer@plt>
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1050 <mcp2515_spi_transfer@plt>
mov    $0x0,%al
call   1060 <mcp2515_spi_unselect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcp2515_read>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1040 <assert@plt>
xor    %eax,%eax
call   1030 <mcp2515_spi_select@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1050 <mcp2515_spi_transfer@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1050 <mcp2515_spi_transfer@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1050 <mcp2515_spi_transfer@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mcp2515_spi_unselect@plt>

LLVM IR (-O0):
define void @mcp2515_read(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = icmp ne i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = call i32 (...) @mcp2515_spi_select()
%10 = call i32 @mcp2515_spi_transfer(i32 3, i32* null)
%11 = load i32, i32* %3
%12 = call i32 @mcp2515_spi_transfer(i32 %11, i32* null)
%13 = load i32*, i32** %4
%14 = call i32 @mcp2515_spi_transfer(i32 0, i32* %13)
%15 = call i32 (...) @mcp2515_spi_unselect()
ret void
}

LLVM IR (-O2):
define void @mcp2515_read(i32 %0, i32* %1) {
%3 = icmp ne i32* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 (...) @mcp2515_spi_select()
%7 = tail call i32 @mcp2515_spi_transfer(i32 3, i32* null)
%8 = tail call i32 @mcp2515_spi_transfer(i32 %0, i32* null)
%9 = tail call i32 @mcp2515_spi_transfer(i32 0, i32* %1)
%10 = tail call i32 (...) @mcp2515_spi_unselect()
ret void
}
int is_char_in(char find, char *haystack, int len) {
  int i;
  for (i = 0; i < len; i++) {
    if (haystack[i] == find) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_char_in>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115b <is_char_in+0x5b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1148 <is_char_in+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1162 <is_char_in+0x62>
jmp    114d <is_char_in+0x4d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1118 <is_char_in+0x18>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_char_in>:
test   %edx,%edx
jle    111f <is_char_in+0x1f>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %dil,(%rsi,%rcx,1)
je     1122 <is_char_in+0x22>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <is_char_in+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_char_in(i8 signext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i8, i8* %1, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
void string_cat_double(struct string_t *string, double val, int digits) {}


x86 assembly (clang, -O0):
<string_cat_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.string_t = type opaque
define void @string_cat_double(%struct.string_t* %0, double %1, i32 %2) {
%4 = alloca %struct.string_t*
%5 = alloca double
%6 = alloca i32
store %struct.string_t* %0, %struct.string_t** %4
store double %1, double* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.string_t = type opaque
define void @string_cat_double(%struct.string_t* nocapture %0, double %1, i32 %2) {
ret void
}
void foo_1_1_2_2_1_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_2_1_1_1_2_2() {
ret void
}
main() {
  return 0;
  int i;
  for (i = 0; i < 10; i++)
    ;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int validateRecursivo(int /*<<< orphan*/ *, char **, char);
int validate(char *text, char **errmsg) {
  char **pointerToText = &text;
  int error = validateRecursivo(NULL, pointerToText, **errmsg);
  return 0;
}


x86 assembly (clang, -O0):
<validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
xor    %ecx,%ecx
mov    %ecx,%edi
movsbl (%rax),%edx
call   1030 <validateRecursivo@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate>:
push   %rax
mov    %rdi,(%rsp)
mov    (%rsi),%rax
movsbl (%rax),%edx
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <validateRecursivo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @validate(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %3
store i8** %1, i8*** %4
store i8** %3, i8*** %5
%7 = load i8**, i8*** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8, i8* %9
%11 = call i32 @validateRecursivo(i32* null, i8** %7, i8 signext %10)
store i32 %11, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @validate(i8* %0, i8** nocapture %1) {
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %1
%5 = load i8, i8* %4
%6 = call i32 @validateRecursivo(i32* null, i8** %3, i8 signext %5)
ret i32 0
}
void efuse_deinit(void) { ; }


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

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

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

LLVM IR (-O2):
define void @efuse_deinit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ string_reverse(char *);
int main(void) {
  char string[] = "Hello!";
  string_reverse(string);
  printf("%s\n", string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0xb(%rbp),%rdi
call   1040 <string_reverse@plt>
lea    -0xb(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x216f6c,0xb(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <string_reverse@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.string = [7 x i8] c"Hello!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
store i32 0, i32* %1
%3 = bitcast [7 x i8]* %2 to i8*
%4 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%5 = call i32 @string_reverse(i8* %4)
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [7 x i8] c"Hello!\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @string_reverse(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_set_name() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_set_name"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"NOT IMPLEMENTED:pa_stream_set_name\0A\00"
define i32 @pa_stream_set_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [35 x i8] c"NOT IMPLEMENTED:pa_stream_set_name\00"
define i32 @pa_stream_set_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct termios {
  void *c_ospeed;
  void *c_ispeed;
};
typedef void *speed_t;

/* Variables and functions */
int cfsetspeed(struct termios *termios_p, speed_t speed) {
  termios_p->c_ispeed = speed;
  termios_p->c_ospeed = speed;
  return 0;
}


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

x86 assembly (clang, -O2):
<cfsetspeed>:
mov    %rsi,0x8(%rdi)
mov    %rsi,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.termios = type { i8*, i8* }
define i32 @cfsetspeed(%struct.termios* %0, i8* %1) {
%3 = alloca %struct.termios*
%4 = alloca i8*
store %struct.termios* %0, %struct.termios** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load %struct.termios*, %struct.termios** %3
%7 = getelementptr inbounds %struct.termios, %struct.termios* %6, i32 0, i32 1
store i8* %5, i8** %7
%8 = load i8*, i8** %4
%9 = load %struct.termios*, %struct.termios** %3
%10 = getelementptr inbounds %struct.termios, %struct.termios* %9, i32 0, i32 0
store i8* %8, i8** %10
ret i32 0
}

LLVM IR (-O2):
%struct.termios = type { i8*, i8* }
define i32 @cfsetspeed(%struct.termios* nocapture writeonly %0, i8* %1) {
%3 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 1
store i8* %1, i8** %3
%4 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
store i8* %1, i8** %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ KeSetEvent(int, int /*<<< orphan*/, int /*<<< orphan*/);
int DiskPerfIrpCompletion(int DeviceObject, int Irp, int Context) {
  int Event;
  {
    {
      Event = Context;
      KeSetEvent(Event, 0, 0);
    }
    return (-1073741802);
  }
}


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

x86 assembly (clang, -O2):
<DiskPerfIrpCompletion>:
push   %rax
mov    %edx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <KeSetEvent@plt>
mov    $0xc0000016,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @DiskPerfIrpCompletion(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @KeSetEvent(i32 %2, i32 0, i32 0)
ret i32 -1073741802
}
/* Variables and functions */
double sin(double);
double test(double f) { return sin(f); }


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <sin@plt>

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

LLVM IR (-O2):
define double @test(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ send_icmp();
void sig_alrm(int signo) {
  send_icmp();
  alarm(1);
  return;
}


x86 assembly (clang, -O0):
<sig_alrm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <send_icmp@plt>
mov    $0x1,%edi
call   1040 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_alrm>:
push   %rax
xor    %eax,%eax
call   1030 <send_icmp@plt>
mov    $0x1,%edi
pop    %rax
jmp    1040 <alarm@plt>

LLVM IR (-O0):
define void @sig_alrm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @send_icmp()
%4 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
define void @sig_alrm(i32 %0) {
%2 = tail call i32 (...) @send_icmp()
%3 = tail call i32 @alarm(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void sig_int(int what) {
  printf("We have received SIGINT:"
         "Will sleep for 5  seconds and continue\n");
  sleep(5);
  printf(" done sleeping\n");
}


x86 assembly (clang, -O0):
<sig_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_int>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
lea    0xf01(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"We have received SIGINT:Will sleep for 5 seconds and continue\0A\00"
@.str.1 = [16 x i8] c" done sleeping\0A\00"
define void @sig_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep(i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"We have received SIGINT:Will sleep for 5 seconds and continue\00"
@str.2 = [15 x i8] c" done sleeping\00"
define void @sig_int(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 5)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
ret void
}