xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void clr_vars(int fd) {
  if (ioctl(fd, _IO('q', 2)) == -1) {
    perror("query_apps ioctl clr");
  }
}


x86 assembly (clang, -O0):
<clr_vars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x71,%edi
mov    $0x2,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    116f <clr_vars+0x3f>
lea    0xe96(%rip),%rdi
call   1050 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_vars>:
push   %rbx
mov    %edi,%ebx
mov    $0x71,%edi
mov    $0x2,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
cmp    $0xffffffff,%eax
je     1152 <clr_vars+0x22>
pop    %rbx
ret
lea    0xea7(%rip),%rdi
pop    %rbx
jmp    1050 <perror@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"query_apps ioctl clr\00"
define void @clr_vars(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 signext 113, i32 2)
%5 = call i32 @ioctl(i32 %3, i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"query_apps ioctl clr\00"
define void @clr_vars(i32 %0) {
%2 = tail call i32 @_IO(i8 signext 113, i32 2)
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ usleep(int);
void f(void) {
  int i = 0;
  while (1) {
    printf("in f (%d)\n", i++);
    usleep(10000);
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x4(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2710,%edi
call   1040 <usleep@plt>
jmp    112f <f+0xf>

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
xor    %esi,%esi
lea    0xed4(%rip),%rbx
nopl   0x0(%rax)
lea    0x1(%rsi),%ebp
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    $0x2710,%edi
call   1040 <usleep@plt>
mov    %ebp,%esi
jmp    1130 <f+0x10>

LLVM IR (-O0):
@.str = [11 x i8] c"in f (%d)\0A\00"
define void @f() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%6 = call i32 @usleep(i32 10000)
br label %2
}

LLVM IR (-O2):
@.str = [11 x i8] c"in f (%d)\0A\00"
define void @f() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
%3 = add nuw nsw i32 %2, 1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%5 = tail call i32 @usleep(i32 10000)
br label %1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_standard_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(16, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_standard_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x10,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_standard_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x10,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solve_by_standard_homotopy_continuation(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 16, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_by_standard_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 16, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
char test_02(int x) {
  if (x < 58 && x > 47)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test_02>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3a,-0x8(%rbp)
jge    1124 <test_02+0x24>
cmpl   $0x2f,-0x8(%rbp)
jle    1124 <test_02+0x24>
movb   $0x1,-0x1(%rbp)
jmp    1128 <test_02+0x28>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_02>:
add    $0xffffffd0,%edi
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define signext i8 @test_02(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 58
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 47
br i1 %8, label %9, label %10
9: ; preds = %6
store i8 1, i8* %2
br label %11
10: ; preds = %6, %1
store i8 0, i8* %2
br label %11
11: ; preds = %10, %9
%12 = load i8, i8* %2
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @test_02(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int maxArea(int *, int);
int main(int argc, char **argv) {
  int nums[] = {1, 8, 6, 2, 5, 4, 8, 3, 7};
  assert(maxArea(nums, 9) == 49);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x9,%esi
call   1050 <maxArea@plt>
cmp    $0x31,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x9,%esi
call   1040 <maxArea@plt>
xor    %edi,%edi
cmp    $0x31,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [9 x i32] [i32 1, i32 8, i32 6, i32 2, i32 5, i32 4, i32 8, i32 3, i32 7]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [9 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [9 x i32]* %6 to i8*
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i64 0, i64 0
%9 = call i32 @maxArea(i32* %8, i32 9)
%10 = icmp eq i32 %9, 49
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [9 x i32] [i32 1, i32 8, i32 6, i32 2, i32 5, i32 4, i32 8, i32 3, i32 7]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [9 x i32]
%4 = bitcast [9 x i32]* %3 to i8*
%5 = getelementptr inbounds [9 x i32], [9 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxArea(i32* %5, i32 9)
%7 = icmp eq i32 %6, 49
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int ep_close(int epfd) { close(epfd); }


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

x86 assembly (clang, -O2):
<ep_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @ep_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 undef
}
/* Variables and functions */
double sin(double);
double calc_E_wave(double time) {
  return sin(time * 3.141592653589793238462643 * 5.0e08);
}


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

x86 assembly (clang, -O2):
<calc_E_wave>:
mulsd  0xee8(%rip),%xmm0
mulsd  0xee8(%rip),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @calc_E_wave(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = fmul double %4, 5.000000e+08
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @calc_E_wave(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = fmul double %2, 5.000000e+08
%4 = tail call double @sin(double %3)
ret double %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void test_function(uint8_t func) {
  if (func == 1)
    return;
  else
    perror("An error has occured");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<test_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    113b <test_function+0x1b>
add    $0x10,%rsp
pop    %rbp
ret
lea    0xebe(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<test_function>:
cmp    $0x1,%edi
jne    1126 <test_function+0x6>
ret
push   %rax
lea    0xed2(%rip),%rdi
call   1030 <perror@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"An error has occured\00"
@EXIT_FAILURE = global i32 0
define void @test_function(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
ret void
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [21 x i8] c"An error has occured\00"
@EXIT_FAILURE = global i32 0
define void @test_function(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %1
ret void
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
}
/* Variables and functions */
unsigned char count_bits(unsigned int);
void compute_bitcount(unsigned char *bitcount) {
  unsigned i;
  for (i = 0; i < 65536; i++) {
    bitcount[i] = count_bits(i);
  }
}


x86 assembly (clang, -O0):
<compute_bitcount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10000,-0xc(%rbp)
jae    1152 <compute_bitcount+0x42>
mov    -0xc(%rbp),%edi
call   1030 <count_bits@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <compute_bitcount+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_bitcount>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <count_bits@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    $0x10000,%rbx
jne    1120 <compute_bitcount+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @compute_bitcount(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 65536
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load i32, i32* %3
%9 = call zeroext i8 @count_bits(i32 %8)
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
store i8 %9, i8* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %3
%16 = add i32 %15, 1
store i32 %16, i32* %3
br label %4
17: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @compute_bitcount(i8* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = trunc i64 %3 to i32
%5 = tail call zeroext i8 @count_bits(i32 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 %5, i8* %6
%7 = add nuw nsw i64 %3, 1
%8 = icmp eq i64 %7, 65536
br i1 %8, label %9, label %2
9: ; preds = %2
ret void
}
int f11(int x, int y) {
  if (x < -0x7fffffff + 2)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f11>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x80000003,-0x8(%rbp)
jge    112a <f11+0x2a>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    1131 <f11+0x31>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f11>:
mov    $0x22,%eax
cmp    $0x80000002,%edi
jg     1116 <f11+0x16>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f11(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, -2147483645
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = sub nsw i32 0, %10
%12 = srem i32 %9, %11
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 34, i32* %3
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @f11(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, -2147483645
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = sub nsw i32 0, %1
%6 = srem i32 %0, %5
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 34, %2 ]
ret i32 %8
}
void platform_group_set(const struct platform_state_group *state) {}


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

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

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

LLVM IR (-O2):
%struct.platform_state_group = type opaque
define void @platform_group_set(%struct.platform_state_group* nocapture %0) {
ret void
}
void Lcd_PowerEnable(int invpwren, int pwren) {
  (*(volatile unsigned *)0x56000068) =
      (*(volatile unsigned *)0x56000068) | (1 << 4);
  (*(volatile unsigned *)0x56000060) =
      (*(volatile unsigned *)0x56000060) | (3 << 8);
  (*(volatile unsigned *)0x4d000010) =
      (*(volatile unsigned *)0x4d000010) & (~(1 << 3)) | (pwren << 3);
  (*(volatile unsigned *)0x4d000010) =
      (*(volatile unsigned *)0x4d000010) & (~(1 << 5)) | (invpwren << 5);
}


x86 assembly (clang, -O0):
<Lcd_PowerEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x56000068,%eax
mov    (%rax),%ecx
or     $0x10,%ecx
mov    $0x56000068,%eax
mov    %ecx,(%rax)
mov    $0x56000060,%eax
mov    (%rax),%ecx
or     $0x300,%ecx
mov    $0x56000060,%eax
mov    %ecx,(%rax)
mov    $0x4d000010,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
or     %eax,%ecx
mov    $0x4d000010,%eax
mov    %ecx,(%rax)
mov    $0x4d000010,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
or     %eax,%ecx
mov    $0x4d000010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd_PowerEnable>:
orl    $0x10,0x56000068
10
orl    $0x300,0x56000060
mov    0x4d000010,%eax
and    $0xfffffff7,%eax
shl    $0x3,%esi
or     %eax,%esi
mov    %esi,0x4d000010
mov    0x4d000010,%eax
and    $0xffffffdf,%eax
shl    $0x5,%edi
or     %eax,%edi
mov    %edi,0x4d000010
ret

LLVM IR (-O0):
define void @Lcd_PowerEnable(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load volatile i32, i32* inttoptr (i64 1442840680 to i32*)
%6 = or i32 %5, 16
store volatile i32 %6, i32* inttoptr (i64 1442840680 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1442840672 to i32*)
%8 = or i32 %7, 768
store volatile i32 %8, i32* inttoptr (i64 1442840672 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1291845648 to i32*)
%10 = and i32 %9, -9
%11 = load i32, i32* %4
%12 = shl i32 %11, 3
%13 = or i32 %10, %12
store volatile i32 %13, i32* inttoptr (i64 1291845648 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1291845648 to i32*)
%15 = and i32 %14, -33
%16 = load i32, i32* %3
%17 = shl i32 %16, 5
%18 = or i32 %15, %17
store volatile i32 %18, i32* inttoptr (i64 1291845648 to i32*)
ret void
}

LLVM IR (-O2):
define void @Lcd_PowerEnable(i32 %0, i32 %1) {
%3 = load volatile i32, i32* inttoptr (i64 1442840680 to i32*)
%4 = or i32 %3, 16
store volatile i32 %4, i32* inttoptr (i64 1442840680 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1442840672 to i32*)
%6 = or i32 %5, 768
store volatile i32 %6, i32* inttoptr (i64 1442840672 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1291845648 to i32*)
%8 = and i32 %7, -9
%9 = shl i32 %1, 3
%10 = or i32 %8, %9
store volatile i32 %10, i32* inttoptr (i64 1291845648 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1291845648 to i32*)
%12 = and i32 %11, -33
%13 = shl i32 %0, 5
%14 = or i32 %12, %13
store volatile i32 %14, i32* inttoptr (i64 1291845648 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ x002_fun_b();
void x002_fun_a() { x002_fun_b(); }


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

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

LLVM IR (-O0):
define void @x002_fun_a() {
%1 = call i32 (...) @x002_fun_b()
ret void
}

LLVM IR (-O2):
define void @x002_fun_a() {
%1 = tail call i32 (...) @x002_fun_b()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M366_f(char *s) {
  debug("M366_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M366_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M366_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M366_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M366_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M366_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M366_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ memfrob(char *, size_t);
char *decode(char *s, size_t len) {
  memfrob(s, len);
  return s;
}


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

x86 assembly (clang, -O2):
<decode>:
push   %rbx
mov    %rdi,%rbx
call   1030 <memfrob@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @decode(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 i32 @memfrob(i8* %5, i64 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
define i8* @decode(i8* returned %0, i64 %1) {
%3 = tail call i32 @memfrob(i8* %0, i64 %1)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int _mm_ucomilt_ss(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_ucomilt_ss(__m128 A, __m128 B) { return _mm_ucomilt_ss(A, B); }


x86 assembly (clang, -O0):
<test_mm_ucomilt_ss>:
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 <_mm_ucomilt_ss@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mm_ucomilt_ss>:
jmp    1030 <_mm_ucomilt_ss@plt>

LLVM IR (-O0):
define i32 @test_mm_ucomilt_ss(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 @_mm_ucomilt_ss(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_ucomilt_ss(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_ucomilt_ss(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *, char *);
void branch(char *label) { emitln("jmp\t%s", label); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"jmp\09%s\00"
define void @branch(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @emitln(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"jmp\09%s\00"
define void @branch(i8* %0) {
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int FILE;

/* Variables and functions */
int *fopen(char const *, char const *);
*abreFichero(const char *nombre, const char *modo) {
  FILE *fichero = fopen(nombre, modo);
  return fichero;
}


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

x86 assembly (clang, -O2):
<abreFichero>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @abreFichero(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
int test_imm_FEint8_reg(signed char val) {
  return ((val) & (-0xFE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FEint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff02,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FEint8_reg>:
test   $0xffffff02,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FEint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -254
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int htonl(int /*<<< orphan*/);
int /*<<< orphan*/ write_bytes(int, ...);
int write_MTrk(int fd) {
  int length = htonl(0);
  write_bytes(fd, "MTrk", 4);
  write_bytes(fd, &length, 4);
  return 0;
}


x86 assembly (clang, -O0):
<write_MTrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    0xec1(%rip),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <write_bytes@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <write_bytes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_MTrk>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
xor    %edi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
lea    0xec7(%rip),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <write_bytes@plt>
lea    0xc(%rsp),%rsi
mov    %ebx,%edi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <write_bytes@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"MTrk\00"
define i32 @write_MTrk(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @htonl(i32 0)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 (i32, ...) @write_bytes(i32 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%7 = load i32, i32* %2
%8 = call i32 (i32, ...) @write_bytes(i32 %7, i32* %3, i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"MTrk\00"
define i32 @write_MTrk(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @htonl(i32 0)
store i32 %4, i32* %2
%5 = tail call i32 (i32, ...) @write_bytes(i32 %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%6 = call i32 (i32, ...) @write_bytes(i32 %0, i32* %2, i32 4)
ret i32 0
}
int operation_mod(int a, int b) { return a % b; }


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

x86 assembly (clang, -O2):
<operation_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @operation_mod(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 = srem i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @operation_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
unsigned int rotateLeft(unsigned int);
unsigned int swap(unsigned int);
int main() {
  unsigned int swapMe = 0x12345678;
  swapMe = swap(swapMe);
  unsigned int rotateMe = 0x88888888;
  rotateMe = rotateLeft(rotateMe);
  printf("swapped: %x\nrotated: %x\n", swapMe, rotateMe);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x12345678,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <swap@plt>
mov    %eax,-0x8(%rbp)
movl   $0x88888888,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <rotateLeft@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x12345678,%edi
call   1050 <swap@plt>
mov    %eax,%ebx
mov    $0x88888888,%edi
call   1040 <rotateLeft@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"swapped: %x\0Arotated: %x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 305419896, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @swap(i32 %4)
store i32 %5, i32* %2
store i32 -2004318072, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @rotateLeft(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"swapped: %x\0Arotated: %x\0A\00"
define i32 @main() {
%1 = tail call i32 @swap(i32 305419896)
%2 = tail call i32 @rotateLeft(i32 -2004318072)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emit_adc(int, int);
int /*<<< orphan*/ emit_sarimm(int, int, int);
int /*<<< orphan*/ emit_shrimm(int, int, int);
void emit_sarsr(int t, int sr) {
  emit_shrimm(sr, 1, sr);
  emit_sarimm(t, 1, t);
  emit_adc(sr, sr);
}


x86 assembly (clang, -O0):
<emit_sarsr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    $0x1,%esi
call   1040 <emit_shrimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_sarimm@plt>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <emit_adc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_sarsr>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1040 <emit_shrimm@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
call   1030 <emit_sarimm@plt>
mov    %ebx,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <emit_adc@plt>

LLVM IR (-O0):
define void @emit_sarsr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @emit_shrimm(i32 %5, i32 1, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @emit_sarimm(i32 %8, i32 1, i32 %9)
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @emit_adc(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @emit_sarsr(i32 %0, i32 %1) {
%3 = tail call i32 @emit_shrimm(i32 %1, i32 1, i32 %1)
%4 = tail call i32 @emit_sarimm(i32 %0, i32 1, i32 %0)
%5 = tail call i32 @emit_adc(i32 %1, i32 %1)
ret void
}
unsigned char f87(unsigned char x, unsigned int y) {
  return (x << (8 - y)) + (x >> y);
}


x86 assembly (clang, -O0):
<f87>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f87>:
mov    $0x8,%cl
sub    %sil,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f87(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = sub i32 8, %7
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = ashr i32 %11, %12
%14 = add nsw i32 %9, %13
%15 = trunc i32 %14 to i8
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @f87(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = sub i32 8, %1
%5 = shl i32 %3, %4
%6 = lshr i32 %3, %1
%7 = add nsw i32 %5, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *);
void doPause() {
  printf("%s", "\n\nPress any key to continue...");
  getchar();
}


x86 assembly (clang, -O0):
<doPause>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doPause>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"\0A\0APress any key to continue...\00"
define void @doPause() {
%1 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"\0A\0APress any key to continue...\00"
define void @doPause() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @getchar()
ret void
}
char *fcvt(val, nfrac, pdecpt, psign)
double val;
int nfrac, *pdecpt, *psign;
{ return _cvt(1, val, nfrac, pdecpt, psign); }


x86 assembly (clang, -O0):
<fcvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <_cvt@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcvt>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
mov    $0x1,%al
call   1030 <_cvt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @fcvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 (i32, double, i32, i32*, i32*, ...) bitcast (i32 (...)* @_cvt to i32 (i32, double, i32, i32*, i32*, ...)*)(i32 1, double %9, i32 %10, i32* %11, i32* %12)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @fcvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 (i32, double, i32, i32*, i32*, ...) bitcast (i32 (...)* @_cvt to i32 (i32, double, i32, i32*, i32*, ...)*)(i32 1, double %0, i32 %1, i32* %2, i32* %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ echoback(int);
void backspace(void) {
  echoback(0x08);
  echoback(' ');
  echoback(0x08);
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <echoback@plt>
mov    $0x20,%edi
call   1030 <echoback@plt>
mov    $0x8,%edi
call   1030 <echoback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rax
mov    $0x8,%edi
call   1030 <echoback@plt>
mov    $0x20,%edi
call   1030 <echoback@plt>
mov    $0x8,%edi
pop    %rax
jmp    1030 <echoback@plt>

LLVM IR (-O0):
define void @backspace() {
%1 = call i32 @echoback(i32 8)
%2 = call i32 @echoback(i32 32)
%3 = call i32 @echoback(i32 8)
ret void
}

LLVM IR (-O2):
define void @backspace() {
%1 = tail call i32 @echoback(i32 8)
%2 = tail call i32 @echoback(i32 32)
%3 = tail call i32 @echoback(i32 8)
ret void
}
/* Type definitions */
struct sched_param {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                       struct sched_param *);
int main(void) {
  struct sched_param param = {0};
  return sched_setscheduler(0, 0, &param);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
xor    %esi,%esi
lea    -0x8(%rbp),%rdx
mov    %esi,%edi
call   1030 <sched_setscheduler@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,(%rsp)
mov    %rsp,%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1030 <sched_setscheduler@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sched_param
store i32 0, i32* %1
%3 = bitcast %struct.sched_param* %2 to i8*
%4 = call i32 @sched_setscheduler(i32 0, i32 0, %struct.sched_param* %2)
ret i32 %4
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
define i32 @main() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i32 0, i32* %3
%4 = call i32 @sched_setscheduler(i32 0, i32 0, %struct.sched_param* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ io_util(int, void *, size_t, int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ read;
void read_util(int fd, void *data, size_t size) {
  io_util(fd, data, size, &read, "Failed to read data");
}


x86 assembly (clang, -O0):
<read_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    0x2eb3(%rip),%rcx
lea    0xec4(%rip),%r8
call   1030 <io_util@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_util>:
mov    0x2ed1(%rip),%rcx
lea    0xee2(%rip),%r8
jmp    1030 <io_util@plt>

LLVM IR (-O0):
@read = global i32 0
@.str = [20 x i8] c"Failed to read data\00"
define void @read_util(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @io_util(i32 %7, i8* %8, i64 %9, i32* @read, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@read = global i32 0
@.str = [20 x i8] c"Failed to read data\00"
define void @read_util(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @io_util(i32 %0, i8* %1, i64 %2, i32* @read, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f(int);
main() {
  f(-1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <f@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 -1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 -1)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned int *);
scalar_t__ malloc(int);
int /*<<< orphan*/ packet_handler(unsigned char *, unsigned int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_data_wrapper(unsigned int *, unsigned int);
int main() {
  unsigned *inbuf;
  inbuf = (unsigned *)malloc(512 * sizeof(unsigned));
  printf("starting...\n\r");
  while (1) {
    unsigned inlen = 0;
    read_data_wrapper(inbuf, inlen);
    packet_handler((unsigned char *)inbuf, inlen);
  }
  free(inbuf);
  printf("Done!\n\r");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x800,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <read_data_wrapper@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <packet_handler@plt>
jmp    1169 <main+0x29>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x800,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <read_data_wrapper@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <packet_handler@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [14 x i8] c"starting...\0A\0D\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @malloc(i32 2048)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %2
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
store i32 0, i32* %3
%8 = load i32*, i32** %2
%9 = load i32, i32* %3
%10 = call i32 @read_data_wrapper(i32* %8, i32 %9)
%11 = load i32*, i32** %2
%12 = bitcast i32* %11 to i8*
%13 = load i32, i32* %3
%14 = call i32 @packet_handler(i8* %12, i32 %13)
br label %7
}

LLVM IR (-O2):
@.str = [14 x i8] c"starting...\0A\0D\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 2048)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = inttoptr i64 %1 to i8*
br label %5
5: ; preds = %5, %0
%6 = tail call i32 @read_data_wrapper(i32* %2, i32 0)
%7 = tail call i32 @packet_handler(i8* %4, i32 0)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
unsigned long *f(unsigned long *);
main() {
  unsigned long x = 0x80000000UL;
  if (f(&x) != &x + 0x81)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x80000000,%eax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <f@plt>
lea    -0x10(%rbp),%rcx
add    $0x408,%rcx
cmp    %rcx,%rax
je     116c <main+0x3c>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x80000000,%eax
mov    %rax,(%rsp)
mov    %rsp,%rdi
call   1040 <f@plt>
lea    0x408(%rsp),%rcx
cmp    %rcx,%rax
jne    1156 <main+0x26>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
store i64 2147483648, i64* %2
%3 = call i64* @f(i64* %2)
%4 = getelementptr inbounds i64, i64* %2, i64 129
%5 = icmp ne i64* %3, %4
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 2147483648, i64* %1
%3 = call i64* @f(i64* %1)
%4 = getelementptr inbounds i64, i64* %1, i64 129
%5 = icmp eq i64* %3, %4
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %0
%9 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, char *, int, int, int, int, int,
                          int, int, int, int, int);
void Colleen() {
  char *str = "#include <stdio.h>%cvoid Colleen(){char *str=%c%s%c;printf(str, "
              "10, 34, str, 34, 10, 10, 10, 10, 10, 10, 10, 10, 10);}%c/*%c   "
              "Comment out of functions%c*/%cint main(){%c/*%c   Comment in "
              "function%c*/%cColleen();return 0;}%c";
  printf(str, 10, 34, str, 34, 10, 10, 10, 10, 10, 10, 10, 10, 10);
}


x86 assembly (clang, -O0):
<Colleen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0xa,%r9d
mov    $0x22,%r8d
mov    %r9d,%esi
mov    %r8d,%edx
movl   $0xa,(%rsp)
movl   $0xa,0x8(%rsp)
movl   $0xa,0x10(%rsp)
movl   $0xa,0x18(%rsp)
movl   $0xa,0x20(%rsp)
movl   $0xa,0x28(%rsp)
movl   $0xa,0x30(%rsp)
movl   $0xa,0x38(%rsp)
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Colleen>:
push   %rax
lea    0xee8(%rip),%rcx
mov    %rcx,%rdi
mov    $0xa,%esi
mov    $0x22,%edx
mov    $0x22,%r8d
mov    $0xa,%r9d
push   $0xa
push   $0xa
push   $0xa
push   $0xa
push   $0xa
push   $0xa
push   $0xa
push   $0xa
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [225 x i8] c"#include <stdio.h>%cvoid Colleen(){char *str=%c%s%c;printf(str, 10, 34, str, 34, 10, 10, 10, 10, 10, 10, 10, 10, 10);}%c/*%c Comment out of functions%c*/%cint main(){%c/*%c Comment in function%c*/%cColleen();return 0;}%c\00"
define void @Colleen() {
%1 = alloca i8*
store i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* %2, i32 10, i32 34, i8* %3, i32 34, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10)
ret void
}

LLVM IR (-O2):
@.str = [225 x i8] c"#include <stdio.h>%cvoid Colleen(){char *str=%c%s%c;printf(str, 10, 34, str, 34, 10, 10, 10, 10, 10, 10, 10, 10, 10);}%c/*%c Comment out of functions%c*/%cint main(){%c/*%c Comment in function%c*/%cColleen();return 0;}%c\00"
define void @Colleen() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0), i32 10, i32 34, i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0), i32 34, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10, i32 10)
ret void
}
void foo276(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo276(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(int);
int print_last_digit(int r) {
  r = r % 10;
  if (r < 0)
    r *= -1;
  _putchar(r + '0');
  return (r);
}


x86 assembly (clang, -O0):
<print_last_digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    113a <print_last_digit+0x2a>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x30,%edi
call   1030 <_putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_last_digit>:
push   %rbx
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
mov    %eax,%ebx
neg    %ebx
cmovs  %eax,%ebx
lea    0x30(%rbx),%edi
call   1030 <_putchar@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @print_last_digit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, -1
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 48
%13 = call i32 @_putchar(i32 %12)
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @print_last_digit(i32 %0) {
%2 = srem i32 %0, 10
%3 = tail call i32 @llvm.abs.i32(i32 %2, i1 true)
%4 = add nuw nsw i32 %3, 48
%5 = tail call i32 @_putchar(i32 %4)
ret i32 %3
}