xunge/DecIR huggingface dataset:
/* Variables and functions */
int f();
int g(void) { return f(); }


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

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

LLVM IR (-O0):
define i32 @g() {
%1 = call i32 (...) @f()
ret i32 %1
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
void INT_Excep_TPU8_TCI8V(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU8_TCI8V() {
ret void
}
float f(float x) { return (x * x - x - 6); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xecb(%rip),%xmm1
subss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
subss  %xmm0,%xmm1
addss  0xeed(%rip),%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = load float, float* %2
%5 = load float, float* %2
%6 = fneg float %5
%7 = call float @llvm.fmuladd.f32(float %3, float %4, float %6)
%8 = fsub float %7, 6.000000e+00
ret float %8
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fneg float %0
%3 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %2)
%4 = fadd float %3, -6.000000e+00
ret float %4
}
/* Variables and functions */
scalar_t__ __floatdidf(long long);
float __floatdisf(register long long a1) { (float)__floatdidf(a1); }


x86 assembly (clang, -O0):
<__floatdisf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <__floatdidf@plt>
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__floatdisf>:
jmp    1030 <__floatdidf@plt>

LLVM IR (-O0):
define float @__floatdisf(i64 %0) {
%2 = alloca float
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = call i64 @__floatdidf(i64 %4)
%6 = sitofp i64 %5 to float
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
define float @__floatdisf(i64 %0) {
%2 = tail call i64 @__floatdidf(i64 %0)
ret float undef
}
/* Type definitions */
typedef int /*<<< orphan*/ cwd;

/* Variables and functions */
scalar_t__ getcwd(char *, int);
char *short_filename_cwd(char const *, char *);
char *xstrdup(char const *);
char *short_filename(const char *absolute) {
  char cwd[8192];
  if (getcwd(cwd, sizeof(cwd))) {
    return short_filename_cwd(absolute, cwd);
  }
  return xstrdup(absolute);
}


x86 assembly (clang, -O0):
<short_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2010,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x2010(%rbp),%rdi
mov    $0x2000,%esi
call   1040 <getcwd@plt>
cmp    $0x0,%rax
je     1173 <short_filename+0x43>
mov    -0x10(%rbp),%rdi
lea    -0x2010(%rbp),%rsi
call   1030 <short_filename_cwd@plt>
mov    %rax,-0x8(%rbp)
jmp    1180 <short_filename+0x50>
mov    -0x10(%rbp),%rdi
call   1050 <xstrdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<short_filename>:
push   %rbx
sub    $0x2000,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
mov    $0x2000,%esi
call   1040 <getcwd@plt>
test   %rax,%rax
je     115a <short_filename+0x2a>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <short_filename_cwd@plt>
jmp    1162 <short_filename+0x32>
mov    %rbx,%rdi
call   1050 <xstrdup@plt>
add    $0x2000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @short_filename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [8192 x i8]
store i8* %0, i8** %3
%5 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%6 = call i64 @getcwd(i8* %5, i32 8192)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [8192 x i8], [8192 x i8]* %4, i64 0, i64 0
%11 = call i8* @short_filename_cwd(i8* %9, i8* %10)
store i8* %11, i8** %2
br label %15
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i8* @xstrdup(i8* %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %12, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @short_filename(i8* %0) {
%2 = alloca [8192 x i8]
%3 = getelementptr inbounds [8192 x i8], [8192 x i8]* %2, i64 0, i64 0
%4 = call i64 @getcwd(i8* %3, i32 8192)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i8* @short_filename_cwd(i8* %0, i8* %3)
br label %10
8: ; preds = %1
%9 = call i8* @xstrdup(i8* %0)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %7, %6 ], [ %9, %8 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ hash(char *);
char *insertFind(int /*<<< orphan*/, char *);
char *assign_id_str(char *s) {
  char *puntatore;
  puntatore = insertFind(hash(s), s);
  return puntatore;
}


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

x86 assembly (clang, -O2):
<assign_id_str>:
push   %rbx
mov    %rdi,%rbx
call   1030 <hash@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <insertFind@plt>

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

LLVM IR (-O2):
define i8* @assign_id_str(i8* %0) {
%2 = tail call i32 @hash(i8* %0)
%3 = tail call i8* @insertFind(i32 %2, i8* %0)
ret i8* %3
}
int *funcp(int *a) {
  {
    a = a + 1;
    return (a);
  }
}


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

x86 assembly (clang, -O2):
<funcp>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @funcp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32* %4, i32** %2
%5 = load i32*, i32** %2
ret i32* %5
}

LLVM IR (-O2):
define i32* @funcp(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ gmx_dipoles(int, char **);
int main(int argc, char *argv[]) {
  gmx_dipoles(argc, argv);
  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),%edi
mov    -0x10(%rbp),%rsi
call   1030 <gmx_dipoles@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_dipoles(i32 %0, i8** %1)
ret i32 0
}
void dummy0(void) {}


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

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

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

LLVM IR (-O2):
define void @dummy0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  switch (3) {
  case 0:
    while (1) {
    case 3:
      printf("in case 3 ");
      break;
    }
  }
  exit(EXIT_SUCCESS);
}


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)
xor    %eax,%eax
test   %al,%al
jne    1154 <main+0x34>
jmp    1145 <main+0x25>
mov    $0x1,%al
test   %al,%al
jne    115e <main+0x3e>
jmp    116f <main+0x4f>
jmp    1159 <main+0x39>
jmp    115e <main+0x3e>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <main+0x4f>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"in case 3 \00"
@EXIT_SUCCESS = global i32 0
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
switch i32 3, label %11 [
i32 0, label %6
i32 3, label %8
]
6: ; preds = %2
br label %7
7: ; preds = %6
br label %8
8: ; preds = %2, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
br label %11
11: ; preds = %10, %2
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"in case 3 \00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int SIGALRM;
int kill(scalar_t__, int);
int test(void) {
  pid_t pid;
  int signal_number;
  int result;
  pid = 0;
  signal_number = SIGALRM;
  result = kill(pid, signal_number);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <kill@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
jmp    1030 <kill@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define i32 @test() {
%1 = alloca i64
%2 = alloca i32
%3 = alloca i32
store i64 0, i64* %1
%4 = load i32, i32* @SIGALRM
store i32 %4, i32* %2
%5 = load i64, i64* %1
%6 = load i32, i32* %2
%7 = call i32 @kill(i64 %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define i32 @test() {
%1 = load i32, i32* @SIGALRM
%2 = tail call i32 @kill(i64 0, i32 %1)
ret i32 %2
}
char ck_visible(char c) {
  if (c < 33 || c > 126) {
    return ' ';
  } else {
    return c;
  }
}


x86 assembly (clang, -O0):
<ck_visible>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x21,%eax
jl     1124 <ck_visible+0x24>
movsbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jle    112d <ck_visible+0x2d>
movb   $0x20,-0x1(%rbp)
jmp    1133 <ck_visible+0x33>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ck_visible>:
lea    -0x7f(%rdi),%eax
cmp    $0xa2,%al
mov    $0x20,%eax
cmovae %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @ck_visible(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 33
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 126
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 32, i8* %2
br label %14
12: ; preds = %7
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @ck_visible(i8 signext %0) {
%2 = add i8 %0, -127
%3 = icmp ult i8 %2, -94
%4 = select i1 %3, i8 32, i8 %0
ret i8 %4
}
void ARGBToYRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToYRow_Any_SSSE3() {
ret void
}
/* Variables and functions */
char *cleanLine(char *);
int /*<<< orphan*/ parseCType(char *, unsigned short *, unsigned char *,
                              unsigned char *);
int isInstruction(char *line) {
  line = cleanLine(line);
  if (line[0] == '@')
    return 1;
  unsigned short comp;
  unsigned char dest, jump;
  parseCType(line, &comp, &dest, &jump);
  return comp != 0xef;
}


x86 assembly (clang, -O0):
<isInstruction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <cleanLine@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jne    1155 <isInstruction+0x35>
movl   $0x1,-0x4(%rbp)
jmp    117e <isInstruction+0x5e>
mov    -0x10(%rbp),%rdi
lea    -0x12(%rbp),%rsi
lea    -0x13(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1040 <parseCType@plt>
movzwl -0x12(%rbp),%eax
cmp    $0xef,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInstruction>:
push   %rax
call   1030 <cleanLine@plt>
mov    %rax,%rdi
mov    $0x1,%eax
cmpb   $0x40,(%rdi)
je     1157 <isInstruction+0x37>
lea    0x4(%rsp),%rsi
lea    0x7(%rsp),%rdx
lea    0x6(%rsp),%rcx
call   1040 <parseCType@plt>
movzwl 0x4(%rsp),%ecx
xor    %eax,%eax
cmp    $0xef,%ecx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isInstruction(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @cleanLine(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 64
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %2
br label %22
15: ; preds = %1
%16 = load i8*, i8** %3
%17 = call i32 @parseCType(i8* %16, i16* %4, i8* %5, i8* %6)
%18 = load i16, i16* %4
%19 = zext i16 %18 to i32
%20 = icmp ne i32 %19, 239
%21 = zext i1 %20 to i32
store i32 %21, i32* %2
br label %22
22: ; preds = %15, %14
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @isInstruction(i8* %0) {
%2 = alloca i16
%3 = alloca i8
%4 = alloca i8
%5 = tail call i8* @cleanLine(i8* %0)
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 64
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = bitcast i16* %2 to i8*
%10 = call i32 @parseCType(i8* %5, i16* %2, i8* %3, i8* %4)
%11 = load i16, i16* %2
%12 = icmp ne i16 %11, 239
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %1, %8
%15 = phi i32 [ %13, %8 ], [ 1, %1 ]
ret i32 %15
}
/* Variables and functions */
int shiftLeft(int, int, int);
int shiftRight(int data, int width, int count) {
  if (count == 0)
    return data;
  if (count < 0)
    return shiftLeft(data, width, -count);
  return data;
}


x86 assembly (clang, -O0):
<shiftRight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1136 <shiftRight+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <shiftRight+0x4e>
cmpl   $0x0,-0x10(%rbp)
jge    1158 <shiftRight+0x48>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
xor    %edx,%edx
sub    -0x10(%rbp),%edx
call   1030 <shiftLeft@plt>
mov    %eax,-0x4(%rbp)
jmp    115e <shiftRight+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftRight>:
test   %edx,%edx
js     1117 <shiftRight+0x7>
mov    %edi,%eax
ret
neg    %edx
jmp    1030 <shiftLeft@plt>

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

LLVM IR (-O2):
define i32 @shiftRight(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = sub nsw i32 0, %2
%7 = tail call i32 @shiftLeft(i32 %0, i32 %1, i32 %6)
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ %0, %3 ]
ret i32 %9
}
int imx7ulp_cpuidle_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @imx7ulp_cpuidle_init() {
ret i32 0
}
/* Variables and functions */
int marc_find_resource(char const *);
int is_marc_resource(const char *query) {
  if (marc_find_resource(query) != -1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_marc_resource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <marc_find_resource@plt>
cmp    $0xffffffff,%eax
je     113a <is_marc_resource+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <is_marc_resource+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_marc_resource>:
push   %rax
call   1030 <marc_find_resource@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_marc_resource(i8* %0) {
%2 = tail call i32 @marc_find_resource(i8* %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ lrc_c_fuzzypath_release();
int /*<<< orphan*/ lrc_c_splicepath_release();
int /*<<< orphan*/ lrc_file_release();
int /*<<< orphan*/ lrc_network_release();
int /*<<< orphan*/ lrc_process_release();
void lrc_builtin_release(void) {
  lrc_file_release();
  lrc_process_release();
  lrc_network_release();
  lrc_c_fuzzypath_release();
  lrc_c_splicepath_release();
}


x86 assembly (clang, -O0):
<lrc_builtin_release>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <lrc_file_release@plt>
mov    $0x0,%al
call   1070 <lrc_process_release@plt>
mov    $0x0,%al
call   1050 <lrc_network_release@plt>
mov    $0x0,%al
call   1030 <lrc_c_fuzzypath_release@plt>
mov    $0x0,%al
call   1060 <lrc_c_splicepath_release@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrc_builtin_release>:
push   %rax
xor    %eax,%eax
call   1040 <lrc_file_release@plt>
xor    %eax,%eax
call   1070 <lrc_process_release@plt>
xor    %eax,%eax
call   1050 <lrc_network_release@plt>
xor    %eax,%eax
call   1030 <lrc_c_fuzzypath_release@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <lrc_c_splicepath_release@plt>

LLVM IR (-O0):
define void @lrc_builtin_release() {
%1 = call i32 (...) @lrc_file_release()
%2 = call i32 (...) @lrc_process_release()
%3 = call i32 (...) @lrc_network_release()
%4 = call i32 (...) @lrc_c_fuzzypath_release()
%5 = call i32 (...) @lrc_c_splicepath_release()
ret void
}

LLVM IR (-O2):
define void @lrc_builtin_release() {
%1 = tail call i32 (...) @lrc_file_release()
%2 = tail call i32 (...) @lrc_process_release()
%3 = tail call i32 (...) @lrc_network_release()
%4 = tail call i32 (...) @lrc_c_fuzzypath_release()
%5 = tail call i32 (...) @lrc_c_splicepath_release()
ret void
}
/* Variables and functions */
char *piece_quote(char *, char *, int);
char *piece_quote_comma(char *destination, char *source, int offset) {
  return piece_quote(destination, source, offset);
}


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

x86 assembly (clang, -O2):
<piece_quote_comma>:
jmp    1030 <piece_quote@plt>

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

LLVM IR (-O2):
define i8* @piece_quote_comma(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @piece_quote(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
void gtk_list_store_append() {}


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

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

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

LLVM IR (-O2):
define void @gtk_list_store_append() {
ret void
}
/* Variables and functions */
double *malloc(int);
double *getVector(double x, double y, double z) {
  double *v = malloc(3 * sizeof(double));
  v[0] = x;
  v[1] = y;
  v[2] = z;
  return v;
}


x86 assembly (clang, -O0):
<getVector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    $0x18,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x8(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,0x10(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getVector>:
sub    $0x18,%rsp
movsd  %xmm2,0x10(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    $0x18,%edi
call   1030 <malloc@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rax)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rax)
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rax)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double* @getVector(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double*
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = call double* @malloc(i32 24)
store double* %8, double** %7
%9 = load double, double* %4
%10 = load double*, double** %7
%11 = getelementptr inbounds double, double* %10, i64 0
store double %9, double* %11
%12 = load double, double* %5
%13 = load double*, double** %7
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
%15 = load double, double* %6
%16 = load double*, double** %7
%17 = getelementptr inbounds double, double* %16, i64 2
store double %15, double* %17
%18 = load double*, double** %7
ret double* %18
}

LLVM IR (-O2):
define noalias double* @getVector(double %0, double %1, double %2) {
%4 = tail call double* @malloc(i32 24)
store double %0, double* %4
%5 = getelementptr inbounds double, double* %4, i64 1
store double %1, double* %5
%6 = getelementptr inbounds double, double* %4, i64 2
store double %2, double* %6
ret double* %4
}
void free_double_matrix(double **m) {
  free(*m);
  free(m);
  return;
}


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

x86 assembly (clang, -O2):
<free_double_matrix>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_double_matrix(double** %0) {
%2 = alloca double**
store double** %0, double*** %2
%3 = load double**, double*** %2
%4 = load double*, double** %3
%5 = bitcast double* %4 to i8*
%6 = load double**, double*** %2
%7 = bitcast double** %6 to i8*
ret void
}

LLVM IR (-O2):
define void @free_double_matrix(double** nocapture %0) {
%2 = bitcast double** %0 to i8**
%3 = load i8*, i8** %2
tail call void @free(i8* %3)
%4 = bitcast double** %0 to i8*
tail call void @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void psym(int c) { putchar(c); }


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

x86 assembly (clang, -O2):
<psym>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @psym(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret void
}
int main() {
  int a = 5;
  a = 8;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x8,-0x8(%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
store i32 5, i32* %2
store i32 8, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int __cpu_to_le16(int);
int ieee80211_is_cfendack(__le16 fc) {
  return (fc & __cpu_to_le16(0x000c | 0x00f0)) ==
         __cpu_to_le16(0x0004 | 0x00F0);
}


x86 assembly (clang, -O0):
<ieee80211_is_cfendack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0xf4,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_cfendack>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <__cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0xf4,%edi
call   1030 <__cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_cfendack(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @__cpu_to_le16(i32 244)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_cfendack(i32 %0) {
%2 = tail call i32 @__cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @__cpu_to_le16(i32 244)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int /*<<< orphan*/ h();
int main(int x) {
  f();
  for (x = 0; x != 10; x++)
    h();
  g();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <f@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     116f <main+0x3f>
mov    $0x0,%al
call   1030 <h@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x20>
mov    $0x0,%al
call   1050 <g@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 %0, i32* %3
%4 = call i32 (...) @f()
store i32 0, i32* %3
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 10
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = call i32 (...) @h()
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %5
13: ; preds = %5
%14 = call i32 (...) @g()
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0) {
%2 = tail call i32 (...) @f()
%3 = tail call i32 (...) @h()
%4 = tail call i32 (...) @h()
%5 = tail call i32 (...) @h()
%6 = tail call i32 (...) @h()
%7 = tail call i32 (...) @h()
%8 = tail call i32 (...) @h()
%9 = tail call i32 (...) @h()
%10 = tail call i32 (...) @h()
%11 = tail call i32 (...) @h()
%12 = tail call i32 (...) @h()
%13 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hash_n_n_mask_8x(unsigned char *, unsigned char *,
                                    unsigned char const *);
void gen_chain_8x(unsigned char out[8 * 32], const unsigned char seed[8 * 32],
                  const unsigned char *masks, int chainlen) {
  int i, j;
  for (i = 0; i < chainlen; i++) {
    hash_n_n_mask_8x(out, out, masks + (i * 32));
  }
}


x86 assembly (clang, -O0):
<gen_chain_8x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1164 <gen_chain_8x+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%eax
shl    $0x5,%eax
cltq
add    %rax,%rdx
call   1030 <hash_n_n_mask_8x@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112e <gen_chain_8x+0x1e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_chain_8x>:
push   %r15
push   %r14
push   %rbx
test   %ecx,%ecx
jle    1148 <gen_chain_8x+0x38>
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %ecx,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <hash_n_n_mask_8x@plt>
add    $0x20,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <gen_chain_8x+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @gen_chain_8x(i8* %0, i8* nocapture readnone %1, i8* %2, i32 %3) {
%5 = icmp sgt i32 %3, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %3 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = shl nsw i64 %9, 5
%11 = getelementptr inbounds i8, i8* %2, i64 %10
%12 = tail call i32 @hash_n_n_mask_8x(i8* %0, i8* %0, i8* %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_usage(const char *bin_name) {
  printf("Usage: %s [options] <file>\n", bin_name);
}


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

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

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

LLVM IR (-O2):
@.str = [28 x i8] c"Usage: %s [options] <file>\0A\00"
define void @print_usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void reopen_consoles(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @km_kirkwood_init() {
ret void
}
/* Variables and functions */
char const *strerror(int);
const char *mg_strerror(int errcode) { return strerror(errcode); }


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

x86 assembly (clang, -O2):
<mg_strerror>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @mg_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
double exp(double);
double transition_sigmoid(double n) {
  if (n < -45.0)
    return 0.0;
  else if (n > 45.0)
    return 1.0;
  return (double)(1.0 / (1.0 + exp(-n)));
}


x86 assembly (clang, -O0):
<transition_sigmoid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <transition_sigmoid+0x2d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a9 <transition_sigmoid+0x99>
movsd  -0x10(%rbp),%xmm0
movsd  0xebe(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1166 <transition_sigmoid+0x56>
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11a9 <transition_sigmoid+0x99>
jmp    116b <transition_sigmoid+0x5b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  0xe7c(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xe70(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<transition_sigmoid>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
movsd  0xedf(%rip),%xmm2
ucomisd %xmm1,%xmm2
ja     1160 <transition_sigmoid+0x50>
ucomisd 0xee1(%rip),%xmm1
jbe    113b <transition_sigmoid+0x2b>
movsd  0xecf(%rip),%xmm0
pop    %rax
ret
xorpd  0xedd(%rip),%xmm1
movapd %xmm1,%xmm0
call   1030 <exp@plt>
movapd %xmm0,%xmm1
movsd  0xeb0(%rip),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @transition_sigmoid(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, -4.500000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %18
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp ogt double %8, 4.500000e+01
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.000000e+00, double* %2
br label %18
11: ; preds = %7
br label %12
12: ; preds = %11
%13 = load double, double* %3
%14 = fneg double %13
%15 = call double @exp(double %14)
%16 = fadd double 1.000000e+00, %15
%17 = fdiv double 1.000000e+00, %16
store double %17, double* %2
br label %18
18: ; preds = %12, %10, %6
%19 = load double, double* %2
ret double %19
}

LLVM IR (-O2):
define double @transition_sigmoid(double %0) {
%2 = fcmp olt double %0, -4.500000e+01
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = fcmp ogt double %0, 4.500000e+01
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = fneg double %0
%7 = tail call double @exp(double %6)
%8 = fadd double %7, 1.000000e+00
%9 = fdiv double 1.000000e+00, %8
br label %10
10: ; preds = %3, %1, %5
%11 = phi double [ %9, %5 ], [ 0.000000e+00, %1 ], [ 1.000000e+00, %3 ]
ret double %11
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int sigfillset(int /*<<< orphan*/ *);
int test(void) {
  sigset_t signal_set;
  int result;
  result = sigfillset(&signal_set);
  return result;
}


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

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <sigfillset@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
ret i32 %3
}
/* Variables and functions */
int w5100_readSn_byte(unsigned int, int);
unsigned w5100_readSnCR(unsigned sock) {
  return w5100_readSn_byte(sock, 0x0001);
}


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

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

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

LLVM IR (-O2):
define i32 @w5100_readSnCR(i32 %0) {
%2 = tail call i32 @w5100_readSn_byte(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
double calculatePi(int);
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  int i;
  for (i = 2; i < 200000; i++) {
    printf("Pi calculated using %d terms = %f\n", i, calculatePi(i));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x30d40,-0x8(%rbp)
jge    116e <main+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <calculatePi@plt>
mov    -0xc(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
lea    0xed0(%rip),%r14
mov    %ebx,%edi
call   1040 <calculatePi@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x30d40,%ebx
jne    1130 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Pi calculated using %d terms = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
br label %3
3: ; preds = %11, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 200000
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call double @calculatePi(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %7, double %9)
br label %11
11: ; preds = %6
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Pi calculated using %d terms = %f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 2, %0 ], [ %5, %1 ]
%3 = tail call double @calculatePi(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %2, double %3)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 200000
br i1 %6, label %7, label %1
7: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ __wleu32(int *, int /*<<< orphan*/);
int i2c_transact(int, int, int *, int, int /*<<< orphan*/);
int i2c_write_leint32(int fd, int chip_addr, int reg, int32_t value) {
  uint8_t data[1 + sizeof(uint32_t)];
  data[0] = reg;
  __wleu32(&data[1], (uint32_t)value);
  return i2c_transact(fd, chip_addr, data, 1 + sizeof(uint32_t), 0);
}


x86 assembly (clang, -O0):
<i2c_write_leint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x4,%rdi
mov    -0x18(%rbp),%rax
mov    %eax,%esi
call   1030 <__wleu32@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x30(%rbp),%rdx
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_write_leint32>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %ecx,%esi
call   1030 <__wleu32@plt>
mov    %rsp,%rdx
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1040 <i2c_transact@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @i2c_write_leint32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca [5 x i32]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i64 %3, i64* %8
%10 = load i32, i32* %7
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
store i32 %10, i32* %11
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 1
%13 = load i64, i64* %8
%14 = trunc i64 %13 to i32
%15 = call i32 @__wleu32(i32* %12, i32 %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%19 = call i32 @i2c_transact(i32 %16, i32 %17, i32* %18, i32 5, i32 0)
ret i32 %19
}

LLVM IR (-O2):
define i32 @i2c_write_leint32(i32 %0, i32 %1, i32 %2, i64 %3) {
%5 = alloca [5 x i32]
%6 = bitcast [5 x i32]* %5 to i8*
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 0
store i32 %2, i32* %7
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %5, i64 0, i64 1
%9 = trunc i64 %3 to i32
%10 = call i32 @__wleu32(i32* %8, i32 %9)
%11 = call i32 @i2c_transact(i32 %0, i32 %1, i32* %7, i32 5, i32 0)
ret i32 %11
}
int do_671() { return 671; }


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

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

LLVM IR (-O0):
define i32 @do_671() {
ret i32 671
}

LLVM IR (-O2):
define i32 @do_671() {
ret i32 671
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int sum = 0;
  while (1) {
    int num = -1;
    scanf("%d", &num);
    if (num >= 0)
      sum += num;
    else
      break;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
lea    0xecc(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jl     1155 <main+0x45>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    115a <main+0x4a>
jmp    115f <main+0x4f>
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%r14
lea    0x4(%rsp),%rbx
movl   $0xffffffff,0x4(%rsp)
ff
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jns    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
store i32 -1, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, -1
br i1 %6, label %3, label %7
7: ; preds = %3
ret i32 0
}
int ad799x_register_ring_funcs_and_init(struct iio_dev *indio_dev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @ad799x_register_ring_funcs_and_init(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
void av_image_get_buffer_size() {}


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

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

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

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