xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int ch;
  printf("Enter a ascii value:");
  scanf("%d", &ch);
  printf("The character is %c\n", ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Enter a ascii value:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"The character is %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Enter a ascii value:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"The character is %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ReadInTestCase4(int);
int /*<<< orphan*/ SendInTestCase4(int);
void Sender(int *key) {
  int count;
  int key1 = key[0];
  int key2 = key[1];
  for (count = 0; count < 2; count++) {
    SendInTestCase4(key1);
    ReadInTestCase4(key2);
  }
}


x86 assembly (clang, -O0):
<Sender>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    116e <Sender+0x4e>
mov    -0x10(%rbp),%edi
call   1030 <SendInTestCase4@plt>
mov    -0x14(%rbp),%edi
call   1040 <ReadInTestCase4@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <Sender+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sender>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%ebx
mov    0x4(%rdi),%ebp
mov    %ebx,%edi
call   1030 <SendInTestCase4@plt>
mov    %ebp,%edi
call   1040 <ReadInTestCase4@plt>
mov    %ebx,%edi
call   1030 <SendInTestCase4@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ReadInTestCase4@plt>

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

LLVM IR (-O2):
define void @Sender(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @SendInTestCase4(i32 %2)
%6 = tail call i32 @ReadInTestCase4(i32 %4)
%7 = tail call i32 @SendInTestCase4(i32 %2)
%8 = tail call i32 @ReadInTestCase4(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ toupper(int);
void uninivar_toupper(void) {
  int c;
  (void)toupper(c);
}


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

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

LLVM IR (-O0):
define void @uninivar_toupper() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @toupper(i32 %2)
ret void
}

LLVM IR (-O2):
define void @uninivar_toupper() {
ret void
}
int dprec() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dprec() {
ret i32 0
}
/* Type definitions */
struct feature_pair {
  int dummy;
};
struct CovariateAnalysis {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _emitJSONUniStatValueR(const struct feature_pair *pair,
                            const struct CovariateAnalysis *covan, FILE *fp) {}


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

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

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

LLVM IR (-O2):
%struct.feature_pair = type { i32 }
%struct.CovariateAnalysis = type { i32 }
define void @_emitJSONUniStatValueR(%struct.feature_pair* nocapture %0, %struct.CovariateAnalysis* nocapture %1, i32* nocapture %2) {
ret void
}
/* Variables and functions */
int bob_test_liba_test();
int main() { return bob_test_liba_test() == 42; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bob_test_liba_test@plt>
cmp    $0x2a,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bob_test_liba_test@plt>
xor    %ecx,%ecx
cmp    $0x2a,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @bob_test_liba_test()
%3 = icmp eq i32 %2, 42
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bob_test_liba_test()
%2 = icmp eq i32 %1, 42
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
size_t ft_nbrlen(int n) {
  size_t len;
  len = (n < 0) ? 2 : 1;
  n = (n < 0) ? -n : n;
  while (n > 9) {
    len++;
    n /= 10;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_nbrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmovl  %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1137 <ft_nbrlen+0x37>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    113d <ft_nbrlen+0x3d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jle    116c <ft_nbrlen+0x6c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1143 <ft_nbrlen+0x43>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_nbrlen>:
mov    %edi,%eax
shr    $0x1f,%eax
add    $0x1,%rax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
cmp    $0xa,%ecx
jb     1135 <ft_nbrlen+0x35>
mov    $0xcccccccd,%edx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <ft_nbrlen+0x20>
ret

LLVM IR (-O0):
define i64 @ft_nbrlen(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 2, i32 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* %2
%13 = sub nsw i32 0, %12
br label %16
14: ; preds = %1
%15 = load i32, i32* %2
br label %16
16: ; preds = %14, %11
%17 = phi i32 [ %13, %11 ], [ %15, %14 ]
store i32 %17, i32* %2
br label %18
18: ; preds = %21, %16
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 9
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i64, i64* %3
%23 = add i64 %22, 1
store i64 %23, i64* %3
%24 = load i32, i32* %2
%25 = sdiv i32 %24, 10
store i32 %25, i32* %2
br label %18
26: ; preds = %18
%27 = load i64, i64* %3
ret i64 %27
}

LLVM IR (-O2):
define i64 @ft_nbrlen(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = select i1 %2, i64 2, i64 1
%4 = sub nsw i32 0, %0
%5 = select i1 %2, i32 %4, i32 %0
%6 = icmp ugt i32 %5, 9
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i64 [ %10, %7 ], [ %3, %1 ]
%9 = phi i32 [ %11, %7 ], [ %5, %1 ]
%10 = add i64 %8, 1
%11 = udiv i32 %9, 10
%12 = icmp ugt i32 %9, 99
br i1 %12, label %7, label %13
13: ; preds = %7, %1
%14 = phi i64 [ %3, %1 ], [ %10, %7 ]
ret i64 %14
}
int strcmp(const char *s1 __attribute__((unused)),
           const char *s2 __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
int sum(int x1, int x2, int x3) { return x1 + x2 + x3; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ bf10(int);
int /*<<< orphan*/ bf50(int);
int /*<<< orphan*/ printf(char *);
void bf100(int c) {
  int i, d, r, m;
  r = c % 2;
  printf(">");
  bf50(c / 2);
  printf("[<++>-]<");
  bf10(r);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1050 <bf50@plt>
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%edi
call   1030 <bf10@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
mov    $0x3e,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
shr    $0x1f,%edi
add    %ebx,%edi
mov    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
sar    %edi
call   1060 <bf50@plt>
lea    0xe97(%rip),%rdi
call   1050 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <bf10@plt>

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"[<++>-]<\00"
define void @bf100(i32 %0) {
%2 = srem i32 %0, 2
%3 = tail call i32 @putchar(i32 62)
%4 = sdiv i32 %0, 2
%5 = tail call i32 @bf50(i32 %4)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @bf10(i32 %2)
ret void
}
int chroot(char *dir) {}


x86 assembly (clang, -O0):
<chroot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @chroot(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x50() {
  Assert_real((iscntrl(80) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              405, ("iscntrl should be 0 for P"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0x50>:
push   %rbp
mov    %rsp,%rbp
mov    $0x50,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x195,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0x50>:
push   %rax
mov    $0x50,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x195,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for P\00"
define void @t_iscntrl_0x50() {
%1 = call i64 @iscntrl(i32 80)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for P\00"
define void @t_iscntrl_0x50() {
%1 = tail call i64 @iscntrl(i32 80)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 405, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ pr_space_line(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  char buf[128] = "";
  fgets(buf, sizeof(buf), stdin);
  pr_space_line(atoi(buf));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
lea    -0x90(%rbp),%rdi
mov    0x2e75(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1040 <fgets@plt>
lea    -0x90(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1050 <pr_space_line@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    0x2e7f(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1030 <fgets@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
call   1040 <pr_space_line@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i8]
store i32 0, i32* %1
%3 = bitcast [128 x i8]* %2 to i8*
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @stdin
%6 = call i32 @fgets(i8* %4, i32 128, i32 %5)
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%8 = call i32 @atoi(i8* %7)
%9 = call i32 @pr_space_line(i32 %8)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 128, i32 %3)
%5 = call i32 @atoi(i8* %2)
%6 = call i32 @pr_space_line(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() { fprintf(stderr, "thank you for testing the client interface\n"); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"thank you for testing the client interface\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"thank you for testing the client interface\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double Double_from_MINUS_float(float x) { return (double)x; }


x86 assembly (clang, -O0):
<Double_from_MINUS_float>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Double_from_MINUS_float>:
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @Double_from_MINUS_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
ret double %4
}

LLVM IR (-O2):
define double @Double_from_MINUS_float(float %0) {
%2 = fpext float %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
int /*<<< orphan*/ ngen(char *, char *, int);
void cgscaleby(int v) {
  ngen("%s\t$%d,%%rcx", "movq", v);
  gen("mulq\t%rcx,%rax");
}


x86 assembly (clang, -O0):
<cgscaleby>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <ngen@plt>
lea    0xeca(%rip),%rdi
call   1040 <gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cgscaleby>:
push   %rax
mov    %edi,%edx
lea    0xed6(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1030 <ngen@plt>
lea    0xed5(%rip),%rdi
pop    %rax
jmp    1040 <gen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09$%d,%%rcx\00"
@.str.1 = [5 x i8] c"movq\00"
@.str.2 = [15 x i8] c"mulq\09%rcx,%rax\00"
define void @cgscaleby(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09$%d,%%rcx\00"
@.str.1 = [5 x i8] c"movq\00"
@.str.2 = [15 x i8] c"mulq\09%rcx,%rax\00"
define void @cgscaleby(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%3 = tail call i32 @gen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void test_builtin_cimag(_Complex double d) {
  if (__builtin_cimag(d) != __builtin_cimag(d))
    link_failure_builtin_cimag();
}


x86 assembly (clang, -O0):
<test_builtin_cimag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x8(%rbp),%xmm0
jne    113d <test_builtin_cimag+0x2d>
jp     113d <test_builtin_cimag+0x2d>
jmp    1144 <test_builtin_cimag+0x34>
mov    $0x0,%al
call   1030 <link_failure_builtin_cimag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_cimag>:
ucomisd %xmm1,%xmm1
jp     1117 <test_builtin_cimag+0x7>
ret
xor    %eax,%eax
jmp    1030 <link_failure_builtin_cimag@plt>

LLVM IR (-O0):
define void @test_builtin_cimag(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%13 = load double, double* %12
%14 = fcmp une double %9, %13
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 (...) @link_failure_builtin_cimag()
br label %17
17: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
define void @test_builtin_cimag(double %0, double %1) {
%3 = fcmp uno double %1, 0.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @link_failure_builtin_cimag()
br label %6
6: ; preds = %4, %2
ret void
}
void test() {
  int a, b;
#pragma omp sections
  {
#pragma omp section
    a = 1;
#pragma omp section
    b = 2;
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setcon(int, int /*<<< orphan*/);
void setz(int r) { setcon(r, 0); }


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

x86 assembly (clang, -O2):
<setz>:
xor    %esi,%esi
jmp    1030 <setcon@plt>

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

LLVM IR (-O2):
define void @setz(i32 %0) {
%2 = tail call i32 @setcon(i32 %0, i32 0)
ret void
}
long double __attribute__((no)) fcmovne(long flags) {
  long double out;
  asm("\n"
      "	push	%1"
      "\n"
      "	popf"
      "\n"
      "	fldpi"
      "\n"
      "	fld1"
      "\n"
      "	"
      "fcmovne"
      " %%st(1), %%st"
      "\n"
      "	ffree	%%st(1)"
      "\n"
      : "=t"(out)
      : "r"(flags));
  return out;
}


x86 assembly (clang, -O0):
<fcmovne>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
push   %rax
popf
fldpi
fld1
fcmovne %st(1),%st
ffree  %st(1)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcmovne>:
push   %rdi
popf
fldpi
fld1
fcmovne %st(1),%st
ffree  %st(1)
ret

LLVM IR (-O0):
define x86_fp80 @fcmovne(i64 %0) {
%2 = alloca i64
%3 = alloca x86_fp80
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovne %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store x86_fp80 %5, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %6
}

LLVM IR (-O2):
define x86_fp80 @fcmovne(i64 %0) {
%2 = tail call x86_fp80 asm "\0A\09push\09$1\0A\09popf\0A\09fldpi\0A\09fld1\0A\09fcmovne %st(1), %st\0A\09ffree\09%st(1)\0A", "={st},r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret x86_fp80 %2
}
/* Variables and functions */
char *om_sysfs_path(char const *);
char const *om_sysfs_readfile(char const *);
const char *om_sysfs_get(const char *name) {
  const char *path = om_sysfs_path(name);
  if (path == NULL)
    return NULL;
  return om_sysfs_readfile(path);
}


x86 assembly (clang, -O0):
<om_sysfs_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <om_sysfs_path@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <om_sysfs_get+0x31>
movq   $0x0,-0x8(%rbp)
jmp    115e <om_sysfs_get+0x3e>
mov    -0x18(%rbp),%rdi
call   1030 <om_sysfs_readfile@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<om_sysfs_get>:
push   %rax
call   1040 <om_sysfs_path@plt>
test   %rax,%rax
je     1134 <om_sysfs_get+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <om_sysfs_readfile@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @om_sysfs_get(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @om_sysfs_path(i8* %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = call i8* @om_sysfs_readfile(i8* %11)
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define i8* @om_sysfs_get(i8* %0) {
%2 = tail call i8* @om_sysfs_path(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @om_sysfs_readfile(i8* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
float convertir(char tipo, float temperatura) {
  float ntemperatura;
  if (tipo == 'c') {
    ntemperatura = (temperatura - 32) * (5.0 / 9);
  } else {
    if (tipo == 'f') {
      ntemperatura = (temperatura + 32) / (5.0 * 9);
    }
  }
  return ntemperatura;
}


x86 assembly (clang, -O0):
<convertir>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movss  %xmm0,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x63,%eax
jne    114b <convertir+0x4b>
movss  -0x8(%rbp),%xmm0
movss  0xee7(%rip),%xmm1
subss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecf(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1183 <convertir+0x83>
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
jne    117e <convertir+0x7e>
movss  0xeb0(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe8f(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1183 <convertir+0x83>
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertir>:
cmp    $0x66,%dil
je     1125 <convertir+0x25>
cmp    $0x63,%dil
jne    1135 <convertir+0x35>
addss  0xef4(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xef0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret
addss  0xed3(%rip),%xmm0
divss  0xecf(%rip),%xmm0
ret

LLVM IR (-O0):
define float @convertir(i8 signext %0, float %1) {
%3 = alloca i8
%4 = alloca float
%5 = alloca float
store i8 %0, i8* %3
store float %1, float* %4
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 99
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load float, float* %4
%11 = fsub float %10, 3.200000e+01
%12 = fpext float %11 to double
%13 = fmul double %12, 0x3FE1C71C71C71C72
%14 = fptrunc double %13 to float
store float %14, float* %5
br label %26
15: ; preds = %2
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 102
br i1 %18, label %19, label %25
19: ; preds = %15
%20 = load float, float* %4
%21 = fadd float %20, 3.200000e+01
%22 = fpext float %21 to double
%23 = fdiv double %22, 4.500000e+01
%24 = fptrunc double %23 to float
store float %24, float* %5
br label %25
25: ; preds = %19, %15
br label %26
26: ; preds = %25, %9
%27 = load float, float* %5
ret float %27
}

LLVM IR (-O2):
define float @convertir(i8 signext %0, float %1) {
switch i8 %0, label %11 [
i8 99, label %3
i8 102, label %8
]
3: ; preds = %2
%4 = fadd float %1, -3.200000e+01
%5 = fpext float %4 to double
%6 = fmul double %5, 0x3FE1C71C71C71C72
%7 = fptrunc double %6 to float
br label %11
8: ; preds = %2
%9 = fadd float %1, 3.200000e+01
%10 = fdiv float %9, 4.500000e+01
br label %11
11: ; preds = %2, %8, %3
%12 = phi float [ %7, %3 ], [ %10, %8 ], [ undef, %2 ]
ret float %12
}
char *strcpy(char *dest, const char *src) {
  int i;
  for (i = 0; src[i] != '\0'; i++) {
    dest[i] = src[i];
  }
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strcpy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
float saturate(float value) {
  if (value < 0.0)
    return 0.0;
  if (value > 1.0)
    return 1.0;
  return value;
}


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

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

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

LLVM IR (-O2):
define float @saturate(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = select i1 %3, float 1.000000e+00, float %0
%5 = select i1 %2, float 0.000000e+00, float %4
ret float %5
}
/* Variables and functions */
int write_header_string(int, long, int, char const *, char const *, int *,
                        int *);
edf_write_header_string(int stream, long int DataNumber, int DataChain,
                        const char *keyword, const char *Value,
                        int *pErrorValue, int *pstatus) {
  return (write_header_string(stream, DataNumber, DataChain, keyword, Value,
                              pErrorValue, pstatus));
}


x86 assembly (clang, -O0):
<edf_write_header_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <write_header_string@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<edf_write_header_string>:
jmp    1030 <write_header_string@plt>

LLVM IR (-O0):
define i32 @edf_write_header_string(i32 %0, i64 %1, i32 %2, i8* %3, i8* %4, i32* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i64
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32*
%14 = alloca i32*
store i32 %0, i32* %8
store i64 %1, i64* %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32, i32* %8
%16 = load i64, i64* %9
%17 = load i32, i32* %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = load i32*, i32** %13
%21 = load i32*, i32** %14
%22 = call i32 @write_header_string(i32 %15, i64 %16, i32 %17, i8* %18, i8* %19, i32* %20, i32* %21)
ret i32 %22
}

LLVM IR (-O2):
define i32 @edf_write_header_string(i32 %0, i64 %1, i32 %2, i8* %3, i8* %4, i32* %5, i32* %6) {
%8 = tail call i32 @write_header_string(i32 %0, i64 %1, i32 %2, i8* %3, i8* %4, i32* %5, i32* %6)
ret i32 %8
}
/* Type definitions */
struct iphdr {
  int protocol;
};
struct ethhdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_tcp_packet(unsigned char *, int);
void ProcessPacket(unsigned char *buffer, int size) {
  struct iphdr *iph = (struct iphdr *)(buffer + sizeof(struct ethhdr));
  if (iph->protocol == 6) {
    print_tcp_packet(buffer, size);
  }
}


x86 assembly (clang, -O0):
<ProcessPacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x6,(%rax)
jne    1144 <ProcessPacket+0x34>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <print_tcp_packet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProcessPacket>:
cmpl   $0x6,0x4(%rdi)
jne    111b <ProcessPacket+0xb>
jmp    1030 <print_tcp_packet@plt>
ret

LLVM IR (-O0):
%struct.iphdr = type { i32 }
define void @ProcessPacket(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.iphdr*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 4
%8 = bitcast i8* %7 to %struct.iphdr*
store %struct.iphdr* %8, %struct.iphdr** %5
%9 = load %struct.iphdr*, %struct.iphdr** %5
%10 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 6
br i1 %12, label %13, label %17
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = call i32 @print_tcp_packet(i8* %14, i32 %15)
br label %17
17: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
define void @ProcessPacket(i8* %0, i32 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @print_tcp_packet(i8* %0, i32 %1)
br label %9
9: ; preds = %7, %2
ret void
}
void SCE_Quit_FastList(void) {}


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

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

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

LLVM IR (-O2):
define void @SCE_Quit_FastList() {
ret void
}
void test_pr5544() {
  (void)(((1) > 63 && (1) < 128 ? (((unsigned long long)1) << ((1) - 64))
                                : (unsigned long long)0));
}


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

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

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

LLVM IR (-O2):
define void @test_pr5544() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_bulge(int, int, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  gen_bulge(-1, 1, NULL, 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
mov    $0x1,%ecx
xor    %eax,%eax
mov    %eax,%edx
mov    %ecx,%esi
call   1030 <gen_bulge@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <gen_bulge@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @gen_bulge(i32 -1, i32 1, i32* null, i32 1)
ret i32 0
}
void DSP_Uninit() {}


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

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

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

LLVM IR (-O2):
define void @DSP_Uninit() {
ret void
}
int main() {
  int i = 0;
  char **a;
  a = (char **)malloc(sizeof(char *) * 1000);
  for (; i < 2; i++) {
    a[i] = (char *)malloc(sizeof(*a));
  }
  a[0] = "123";
  a[1] = "234";
  printf(a);
  free(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1f40,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1185 <main+0x55>
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x24>
mov    -0x10(%rbp),%rax
lea    0xe70(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
lea    0xe66(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1f40,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xebb(%rip),%rax
mov    %rax,(%rbx)
lea    0xeb5(%rip),%rax
mov    %rax,0x8(%rbx)
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
@.str.1 = [4 x i8] c"234\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8**
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i8* @malloc(i64 8000)
%5 = bitcast i8* %4 to i8**
store i8** %5, i8*** %3
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = call i8* @malloc(i64 8)
%11 = load i8**, i8*** %3
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
store i8* %10, i8** %14
br label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = load i8**, i8*** %3
%20 = getelementptr inbounds i8*, i8** %19, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %20
%21 = load i8**, i8*** %3
%22 = getelementptr inbounds i8*, i8** %21, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %22
%23 = load i8**, i8*** %3
%24 = bitcast i8** %23 to i8*
%25 = call i32 (i8*, ...) @printf(i8* %24)
%26 = load i8**, i8*** %3
%27 = bitcast i8** %26 to i8*
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
@.str.1 = [4 x i8] c"234\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(8000) i8* @malloc(i64 8000)
%2 = bitcast i8* %1 to i8**
%3 = getelementptr inbounds i8*, i8** %2, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %1)
tail call void @free(i8* %1)
ret i32 0
}
/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, long);
int main() {
  printf("hello world from process ID %ld\n", (long)getpid());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"hello world from process ID %ld\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"hello world from process ID %ld\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
/* Variables and functions */
char *energymon_strencpy(char *, char *, size_t);
char *energymon_get_source_dummy(char *buffer, size_t n) {
  return energymon_strencpy(buffer, "Dummy Source", n);
}


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

x86 assembly (clang, -O2):
<energymon_get_source_dummy>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <energymon_strencpy@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Dummy Source\00"
define i8* @energymon_get_source_dummy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @energymon_strencpy(i8* %5, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"Dummy Source\00"
define i8* @energymon_get_source_dummy(i8* %0, i64 %1) {
%3 = tail call i8* @energymon_strencpy(i8* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i8* %3
}
int test_imm_C6uint8_mem(unsigned char *val) {
  return ((*val) & (0xC6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C6uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -58
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ jtag_set_mem(int /*<<< orphan*/, int);
void force_slow_clock() { jtag_set_mem(0, 0xfffffc30); }


x86 assembly (clang, -O0):
<force_slow_clock>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0xfffffc30,%esi
call   1030 <jtag_set_mem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<force_slow_clock>:
xor    %edi,%edi
mov    $0xfffffc30,%esi
jmp    1030 <jtag_set_mem@plt>

LLVM IR (-O0):
define void @force_slow_clock() {
%1 = call i32 @jtag_set_mem(i32 0, i32 -976)
ret void
}

LLVM IR (-O2):
define void @force_slow_clock() {
%1 = tail call i32 @jtag_set_mem(i32 0, i32 -976)
ret void
}