xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strstr(char *, char *);
int lastoccurence(char *s1, char *s2) {
  char *ptr;
  int i;
  ptr = s1;
  while (ptr = strstr(ptr, s2)) {
    i = (ptr - s1);
    ptr++;
  }
  return i;
}


x86 assembly (clang, -O0):
<lastoccurence>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1162 <lastoccurence+0x52>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <lastoccurence+0x18>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastoccurence>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1030 <strstr@plt>
test   %rax,%rax
je     1149 <lastoccurence+0x39>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rbx
lea    0x1(%rax),%rdi
mov    %r15,%rsi
call   1030 <strstr@plt>
test   %rax,%rax
jne    1130 <lastoccurence+0x20>
sub    %r14d,%ebx
jmp    1149 <lastoccurence+0x39>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @lastoccurence(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %3, %2 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i8* @strstr(i8* dereferenceable(1) %7, i8* dereferenceable(1) %1)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = ptrtoint i8* %6 to i64
%12 = ptrtoint i8* %0 to i64
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
br label %15
15: ; preds = %10, %2
%16 = phi i32 [ %14, %10 ], [ undef, %2 ]
ret i32 %16
}
/* Variables and functions */
int get_flag(int);
bool get_zero() { return get_flag(7); }


x86 assembly (clang, -O0):
<get_zero>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <get_flag@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_zero>:
mov    $0x7,%edi
jmp    1030 <get_flag@plt>

LLVM IR (-O0):
define i32 @get_zero() {
%1 = call i32 @get_flag(i32 7)
ret i32 %1
}

LLVM IR (-O2):
define i32 @get_zero() {
%1 = tail call i32 @get_flag(i32 7)
ret i32 %1
}
int inner(int z) { return 2 * z; }


x86 assembly (clang, -O0):
<inner>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inner>:
lea    (%rdi,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @inner(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char ch, opl;
  scanf("%ch", &ch);
  opl = 'z' - (ch - 'a');
  printf("%c\n", opl);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0xdb,%al
sub    0x7(%rsp),%al
movsbl %al,%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ch\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %6, 97
%8 = sub nsw i32 122, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ch\00"
@.str.1 = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
int test_imm_63int16_mem(short *val) {
  return ((*val) & (-0x63 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_63int16_mem>:
movzwl (%rdi),%eax
test   $0xff9d,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_63int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -99
%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_63int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -99
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int find_first_one(unsigned char byte) {
  int i = 0;
  if (byte == 0)
    return -1;
  while ((byte & (0x1 << i)) == 0) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<find_first_one>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    112a <find_first_one+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115e <find_first_one+0x5e>
jmp    112f <find_first_one+0x2f>
movzbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    1158 <find_first_one+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112f <find_first_one+0x2f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first_one>:
mov    $0xffffffff,%eax
test   %edi,%edi
je     1118 <find_first_one+0x18>
nopl   0x0(%rax)
add    $0x1,%eax
bt     %eax,%edi
jae    1110 <find_first_one+0x10>
ret

LLVM IR (-O0):
define i32 @find_first_one(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 0, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %22
9: ; preds = %1
br label %10
10: ; preds = %17, %9
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i32, i32* %4
%14 = shl i32 1, %13
%15 = and i32 %12, %14
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %10
20: ; preds = %10
%21 = load i32, i32* %4
store i32 %21, i32* %2
br label %22
22: ; preds = %20, %8
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @find_first_one(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp eq i8 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ 0, %1 ]
%6 = shl nuw i32 1, %5
%7 = and i32 %6, %2
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4, %1
%11 = phi i32 [ -1, %1 ], [ %5, %4 ]
ret i32 %11
}
void function_notes(char *notes) {}


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

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

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

LLVM IR (-O2):
define void @function_notes(i8* nocapture %0) {
ret void
}
int ContainsNonControl(const char *buf) {
  while (*buf) {
    if (*buf < '\000' || (*buf > '\037' && *buf != '\177')) {
      return 1;
    }
    ++buf;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ContainsNonControl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <ContainsNonControl+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jl     1145 <ContainsNonControl+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1f,%eax
jle    1151 <ContainsNonControl+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7f,%eax
je     1151 <ContainsNonControl+0x51>
movl   $0x1,-0x4(%rbp)
jmp    1169 <ContainsNonControl+0x69>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <ContainsNonControl+0x8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ContainsNonControl>:
mov    (%rdi),%cl
test   %cl,%cl
je     113a <ContainsNonControl+0x3a>
add    $0x1,%rdi
mov    $0x1,%eax
jmp    112b <ContainsNonControl+0x2b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     113a <ContainsNonControl+0x3a>
test   %cl,%cl
js     1139 <ContainsNonControl+0x39>
cmp    $0x20,%cl
jb     1120 <ContainsNonControl+0x20>
cmp    $0x7f,%cl
je     1120 <ContainsNonControl+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ContainsNonControl(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %11
%5 = load i8, i8* %15
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %15, %4 ], [ %0, %1 ]
%10 = icmp slt i8 %8, 0
br i1 %10, label %16, label %11
11: ; preds = %7
%12 = icmp ult i8 %8, 32
%13 = icmp eq i8 %8, 127
%14 = or i1 %12, %13
%15 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %14, label %4, label %16
16: ; preds = %11, %7, %4, %1
%17 = phi i32 [ 0, %1 ], [ 0, %4 ], [ 1, %7 ], [ 1, %11 ]
ret i32 %17
}
/* Type definitions */
struct yas_driver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ yas_cdrv_term();
int suspend(struct yas_driver *d) {
  ;
  (void)d;
  yas_cdrv_term();
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.yas_driver = type { i32 }
define i32 @suspend(%struct.yas_driver* nocapture readnone %0) {
%2 = tail call i32 (...) @yas_cdrv_term()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ PTHREAD_CREATE_JOINABLE;
int thread_create(void *, void *, int, int /*<<< orphan*/ *,
                  int /*<<< orphan*/);
int thread_create_joinable(void *function, void *arg, int retries,
                           pthread_t *tid) {
  return thread_create(function, arg, retries, tid, PTHREAD_CREATE_JOINABLE);
}


x86 assembly (clang, -O0):
<thread_create_joinable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    0x2eab(%rip),%rax
mov    (%rax),%r8d
call   1030 <thread_create@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_create_joinable>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%r8d
jmp    1030 <thread_create@plt>

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

LLVM IR (-O2):
@PTHREAD_CREATE_JOINABLE = global i32 0
define i32 @thread_create_joinable(i8* %0, i8* %1, i32 %2, i32* %3) {
%5 = load i32, i32* @PTHREAD_CREATE_JOINABLE
%6 = tail call i32 @thread_create(i8* %0, i8* %1, i32 %2, i32* %3, i32 %5)
ret i32 %6
}
void ARGBSetRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBSetRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printArray(double *, int);
int /*<<< orphan*/ printf(char *, double);
double roundArray(double *, int);
int /*<<< orphan*/ seedArray(double *, int, int, int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  double d[10];
  seedArray(d, 10, 1000, 1000);
  printArray(d, 10);
  printf("srednia = %f\n", roundArray(d, 10));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    -0x50(%rbp),%rdi
mov    $0xa,%esi
mov    $0x3e8,%ecx
mov    %ecx,%edx
call   1050 <seedArray@plt>
lea    -0x50(%rbp),%rdi
mov    $0xa,%esi
call   1080 <printArray@plt>
lea    -0x50(%rbp),%rdi
mov    $0xa,%esi
call   1070 <roundArray@plt>
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x3e8,%edx
mov    $0x3e8,%ecx
call   1050 <seedArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1080 <printArray@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <roundArray@plt>
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"srednia = %f\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%5 = call i32 @seedArray(double* %4, i32 10, i32 1000, i32 1000)
%6 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%7 = call i32 @printArray(double* %6, i32 10)
%8 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%9 = call double @roundArray(double* %8, i32 10)
%10 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"srednia = %f\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
%4 = bitcast [10 x double]* %1 to i8*
%5 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%6 = call i32 @seedArray(double* %5, i32 10, i32 1000, i32 1000)
%7 = call i32 @printArray(double* %5, i32 10)
%8 = call double @roundArray(double* %5, i32 10)
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}
int check_prime(int num) {
  if (num == 1) {
    return 0;
  }
  int i;
  for (i = 2; i < num; i++) {
    if (num % i != 0)
      continue;
    else
      return 0;
  }
  return num;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <check_prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <check_prime+0x65>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <check_prime+0x5f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1145 <check_prime+0x45>
jmp    1151 <check_prime+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1165 <check_prime+0x65>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <check_prime+0x24>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
xor    %ecx,%ecx
cmp    $0x1,%edi
jne    110a <check_prime+0xa>
mov    %ecx,%eax
ret
cmp    $0x3,%edi
jl     1130 <check_prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <check_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <check_prime+0x20>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 2
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %5, %7, %3, %1
%13 = phi i32 [ 0, %1 ], [ %0, %3 ], [ %0, %5 ], [ 0, %7 ]
ret i32 %13
}
/* Type definitions */
struct mread_pool {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mread_close(struct mread_pool *);
struct mread_pool *mread_create(int, int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ test(struct mread_pool *);
int main() {
  struct mread_pool *m = mread_create(2525, 10, 0);
  if (m == NULL) {
    perror("error:");
    return 1;
  }
  for (;;) {
    test(m);
    sleep(1);
  }
  mread_close(m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9dd,%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <mread_create@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1186 <main+0x46>
lea    0xe8a(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret
jmp    118b <main+0x4b>
mov    -0x10(%rbp),%rdi
call   1060 <test@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    118b <main+0x4b>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x9dd,%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <mread_create@plt>
test   %rax,%rax
je     1174 <main+0x34>
mov    %rax,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <test@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
jmp    1160 <main+0x20>
lea    0xe85(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mread_pool = type { i32 }
@.str = [7 x i8] c"error:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.mread_pool*
store i32 0, i32* %1
%3 = call %struct.mread_pool* @mread_create(i32 2525, i32 10, i32 0)
store %struct.mread_pool* %3, %struct.mread_pool** %2
%4 = load %struct.mread_pool*, %struct.mread_pool** %2
%5 = icmp eq %struct.mread_pool* %4, null
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 1
8: ; preds = %0
br label %9
9: ; preds = %9, %8
%10 = load %struct.mread_pool*, %struct.mread_pool** %2
%11 = call i32 @test(%struct.mread_pool* %10)
%12 = call i32 @sleep(i32 1)
br label %9
}

LLVM IR (-O2):
%struct.mread_pool = type { i32 }
@.str = [7 x i8] c"error:\00"
define i32 @main() {
%1 = tail call %struct.mread_pool* @mread_create(i32 2525, i32 10, i32 0)
%2 = icmp eq %struct.mread_pool* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 1
5: ; preds = %0, %5
%6 = tail call i32 @test(%struct.mread_pool* %1)
%7 = tail call i32 @sleep(i32 1)
br label %5
}
void g_param_spec_set_qdata_full() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_set_qdata_full() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ A;

/* Variables and functions */
int largest_sum(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int A[] = {-2, -3, 4, -1, -2, 1, 5, -3};
  int n = sizeof(A) / sizeof(A[0]);
  printf("The largest sum is: %d\n", largest_sum(A, n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <largest_sum@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <largest_sum@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.A = [8 x i32] [i32 -2, i32 -3, i32 4, i32 -1, i32 -2, i32 1, i32 5, i32 -3]
@.str = [24 x i8] c"The largest sum is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @largest_sum(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.A = [8 x i32] [i32 -2, i32 -3, i32 4, i32 -1, i32 -2, i32 1, i32 5, i32 -3]
@.str = [24 x i8] c"The largest sum is: %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @largest_sum(i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int test_client(int, char **);
int main(int argc, char *argv[]) { return test_client(argc, argv); }


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 <test_client@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <test_client@plt>

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 @test_client(i32 %6, i8** %7)
ret i32 %8
}

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


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

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

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

LLVM IR (-O2):
define void @gtk_combo_box_entry_new_with_model() {
ret void
}
int sesc_is_safe(int pid) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @sesc_is_safe(i32 %0) {
ret i32 1
}
__attribute__((always_)) void
trace_mm_page_alloc_zone_locked(struct page *page, unsigned int order,
                                int migratetype) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @trace_mm_page_alloc_zone_locked(%struct.page* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(void (*)());
int /*<<< orphan*/ IntEnable(int /*<<< orphan*/);
int /*<<< orphan*/ IntRegister(int /*<<< orphan*/, void (*)());
void uDMAIntRegister(uint32_t ui32IntChannel, void (*pfnHandler)(void)) {
  ASSERT(pfnHandler);
  IntRegister(ui32IntChannel, pfnHandler);
  IntEnable(ui32IntChannel);
}


x86 assembly (clang, -O0):
<uDMAIntRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ASSERT@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <IntRegister@plt>
mov    -0x4(%rbp),%edi
call   1030 <IntEnable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAIntRegister>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1050 <ASSERT@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <IntRegister@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IntEnable@plt>

LLVM IR (-O0):
define void @uDMAIntRegister(i32 %0, void ()* %1) {
%3 = alloca i32
%4 = alloca void ()*
store i32 %0, i32* %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %4
%6 = bitcast void ()* %5 to void (...)*
%7 = call i32 @ASSERT(void (...)* %6)
%8 = load i32, i32* %3
%9 = load void ()*, void ()** %4
%10 = bitcast void ()* %9 to void (...)*
%11 = call i32 @IntRegister(i32 %8, void (...)* %10)
%12 = load i32, i32* %3
%13 = call i32 @IntEnable(i32 %12)
ret void
}

LLVM IR (-O2):
define void @uDMAIntRegister(i32 %0, void ()* %1) {
%3 = bitcast void ()* %1 to void (...)*
%4 = tail call i32 @ASSERT(void (...)* %3)
%5 = tail call i32 @IntRegister(i32 %0, void (...)* %3)
%6 = tail call i32 @IntEnable(i32 %0)
ret void
}
/* Variables and functions */
int f111(int *);
int f112(int *p) { return f111(p); }


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

x86 assembly (clang, -O2):
<f112>:
jmp    1030 <f111@plt>

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

LLVM IR (-O2):
define i32 @f112(i32* %0) {
%2 = tail call i32 @f111(i32* %0)
ret i32 %2
}
/* Variables and functions */
int struppercmp(char const *const, char const *const);
int compareTagsFolded(const void *const one, const void *const two) {
  const char *const line1 = *(const char *const *)one;
  const char *const line2 = *(const char *const *)two;
  return struppercmp(line1, line2);
}


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

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

LLVM IR (-O0):
define i32 @compareTagsFolded(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
%9 = load i8*, i8** %8
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i8**
%12 = load i8*, i8** %11
store i8* %12, i8** %6
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = call i32 @struppercmp(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compareTagsFolded(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @struppercmp(i8* %4, i8* %6)
ret i32 %7
}
/* Variables and functions */
double pow(int, int);
int /*<<< orphan*/ printf(char *, double);
void print_pow(void) { printf("%.0f\n", pow(2, 10)); }


x86 assembly (clang, -O0):
<print_pow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
mov    $0xa,%esi
call   1040 <pow@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_pow>:
push   %rax
mov    $0x2,%edi
mov    $0xa,%esi
call   1040 <pow@plt>
lea    0xec9(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.0f\0A\00"
define void @print_pow() {
%1 = call double @pow(i32 2, i32 10)
%2 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.0f\0A\00"
define void @print_pow() {
%1 = tail call double @pow(i32 2, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  { printf("Hello"); }
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AttitudeStateHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void AttitudeStateLogging() { UAVObjLogging(AttitudeStateHandle()); }


x86 assembly (clang, -O0):
<AttitudeStateLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <AttitudeStateHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AttitudeStateLogging>:
push   %rax
xor    %eax,%eax
call   1040 <AttitudeStateHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @AttitudeStateLogging() {
%1 = call i32 (...) @AttitudeStateHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @AttitudeStateLogging() {
%1 = tail call i32 (...) @AttitudeStateHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv, char **envp) {
  char **p = envp;
  do {
    printf("%s\n", *p);
  } while (*(++p));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,0x8(%rax)
jne    1132 <main+0x22>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    (%rdx),%rsi
add    $0x8,%rbx
lea    0xedb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
br label %5
5: ; preds = %5, %3
%6 = phi i8* [ %4, %3 ], [ %10, %5 ]
%7 = phi i8** [ %2, %3 ], [ %9, %5 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = getelementptr inbounds i8*, i8** %7, i64 1
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %5
12: ; preds = %5
ret i32 0
}
int rl_forward_search_history(sign, key)
int sign, key;
{ return (rl_search_history(sign, key)); }


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

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

LLVM IR (-O0):
define i32 @rl_forward_search_history(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_search_history to i32 (i32, i32, ...)*)(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @rl_forward_search_history(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_search_history to i32 (i32, i32, ...)*)(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glRotatef(double, double, double, double);
int /*<<< orphan*/ glTranslatef(double, double, double);
void bend_right(void) {
  glRotatef(0.1 * (900), 0.0, 0.0, 1.0);
  glTranslatef(0.0, 1.000000, 0.0);
  glRotatef(0.1 * (900), 1.0, 0.0, 0.0);
  glTranslatef(0.0, -1.000000, 0.0);
}


x86 assembly (clang, -O0):
<bend_right>:
push   %rbp
mov    %rsp,%rbp
movsd  0xedc(%rip),%xmm0
xorps  %xmm2,%xmm2
movsd  0xed9(%rip),%xmm3
movaps %xmm2,%xmm1
call   1040 <glRotatef@plt>
xorps  %xmm2,%xmm2
movsd  0xec6(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <glTranslatef@plt>
movsd  0xeae(%rip),%xmm0
movsd  0xeae(%rip),%xmm1
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm2
call   1040 <glRotatef@plt>
xorps  %xmm2,%xmm2
movsd  0xe88(%rip),%xmm1
movaps %xmm2,%xmm0
call   1030 <glTranslatef@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bend_right>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm3
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1040 <glRotatef@plt>
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
movsd  0xebe(%rip),%xmm1
call   1030 <glTranslatef@plt>
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
movsd  0xea3(%rip),%xmm0
movsd  0xea3(%rip),%xmm1
call   1040 <glRotatef@plt>
movsd  0xe9e(%rip),%xmm1
xorps  %xmm0,%xmm0
xorps  %xmm2,%xmm2
pop    %rax
jmp    1030 <glTranslatef@plt>

LLVM IR (-O0):
define void @bend_right() {
%1 = call i32 @glRotatef(double 9.000000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%2 = call i32 @glTranslatef(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%4 = call i32 @glTranslatef(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
define void @bend_right() {
%1 = tail call i32 @glRotatef(double 9.000000e+01, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%2 = tail call i32 @glTranslatef(double 0.000000e+00, double 1.000000e+00, double 0.000000e+00)
%3 = tail call i32 @glRotatef(double 9.000000e+01, double 1.000000e+00, double 0.000000e+00, double 0.000000e+00)
%4 = tail call i32 @glTranslatef(double 0.000000e+00, double -1.000000e+00, double 0.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_help() {
  puts("Usage: tail [OPTIONS] [FILE]\n"
       "Print the last 10 lines of FILE to standard output. "
       "If no FILE is given, read standard input.\n"
       "-h\tshow usage information\n"
       "-X\toutput the last X lines\n"
       "+X\toutput all the lines starting from the Xth line "
       "(`tail +1` will print everything)");
}


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

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

LLVM IR (-O0):
@.str = [261 x i8] c"Usage: tail [OPTIONS] [FILE]\0APrint the last 10 lines of FILE to standard output. If no FILE is given, read standard input.\0A-h\09show usage information\0A-X\09output the last X lines\0A+X\09output all the lines starting from the Xth line (`tail +1` will print everything)\00"
define void @print_help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([261 x i8], [261 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [261 x i8] c"Usage: tail [OPTIONS] [FILE]\0APrint the last 10 lines of FILE to standard output. If no FILE is given, read standard input.\0A-h\09show usage information\0A-X\09output the last X lines\0A+X\09output all the lines starting from the Xth line (`tail +1` will print everything)\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([261 x i8], [261 x i8]* @.str, i64 0, i64 0))
ret void
}
void yy_1_ValueDqStar(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ValueDqStar(i8* nocapture %0, i32 %1) {
ret void
}
void zeroupper256() {}


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

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

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

LLVM IR (-O2):
define void @zeroupper256() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void starp(int l) {
  if (l == 0) {
    return;
  }
  starp(l - 1);
  int i;
  for (i = 0; i < l; i++) {
    printf("*");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<starp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <starp+0x1a>
jmp    117e <starp+0x5e>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <starp@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1172 <starp+0x52>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <starp+0x2c>
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<starp>:
test   %edi,%edi
je     115a <starp+0x3a>
push   %rbx
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
call   1040 <starp@plt>
test   %ebx,%ebx
jle    114f <starp+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1140 <starp+0x20>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>
ret

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

LLVM IR (-O2):
define void @starp(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
tail call void @starp(i32 %4)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %11
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = tail call i32 @putchar(i32 42)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %6
11: ; preds = %6, %3
%12 = tail call i32 @putchar(i32 10)
br label %13
13: ; preds = %1, %11
ret void
}
int tolower(int chr) { return (chr >= 'A' && chr <= 'Z') ? (chr + 32) : (chr); }


x86 assembly (clang, -O0):
<tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1129 <tolower+0x29>
cmpl   $0x5a,-0x4(%rbp)
jg     1129 <tolower+0x29>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <tolower+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
br label %13
11: ; preds = %5, %1
%12 = load i32, i32* %2
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
int ftruncate(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int testftruncate(int fd, off_t length) {
  int ret = ftruncate(fd, length);
  if (ret)
    perror("ftruncate");
  return ret;
}


x86 assembly (clang, -O0):
<testftruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ftruncate@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1152 <testftruncate+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testftruncate>:
push   %rbx
call   1030 <ftruncate@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1130 <testftruncate+0x10>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1040 <perror@plt>
jmp    112c <testftruncate+0xc>

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

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