xunge/DecIR huggingface dataset:
void ade7754_uninitialize_ring(struct iio_ring_buffer *ring) {}


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

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

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

LLVM IR (-O2):
%struct.iio_ring_buffer = type opaque
define void @ade7754_uninitialize_ring(%struct.iio_ring_buffer* nocapture %0) {
ret void
}
int do_178() { return 178; }


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

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

LLVM IR (-O0):
define i32 @do_178() {
ret i32 178
}

LLVM IR (-O2):
define i32 @do_178() {
ret i32 178
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_preferences(int p) {
  switch (p) {
  case 0:
    printf("medium");
    break;
  case 1:
    printf("high");
    break;
  case 2:
    break;
  case 3:
    printf("low");
    break;
  }
}


x86 assembly (clang, -O0):
<print_preferences>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1173 <print_preferences+0x63>
mov    -0x10(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <print_preferences+0x63>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <print_preferences+0x63>
jmp    1173 <print_preferences+0x63>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_preferences>:
test   %edi,%edi
je     112a <print_preferences+0x1a>
cmp    $0x3,%edi
je     1136 <print_preferences+0x26>
cmp    $0x1,%edi
jne    1142 <print_preferences+0x32>
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>
lea    0xecf(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [7 x i8] c"medium\00"
@.str.1 = [5 x i8] c"high\00"
@.str.2 = [4 x i8] c"low\00"
define void @print_preferences(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %11 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
i32 3, label %9
]
4: ; preds = %1
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %11
8: ; preds = %1
br label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %1, %9, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"medium\00"
@.str.1 = [5 x i8] c"high\00"
@.str.2 = [4 x i8] c"low\00"
define void @print_preferences(i32 %0) {
switch i32 %0, label %7 [
i32 0, label %4
i32 1, label %2
i32 3, label %3
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %2, %3
%5 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %2 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) %5)
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
char *get_answer();
char *get_question();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char *question;
  char *answer;
  while (1) {
    question = get_question();
    answer = get_answer();
    printf("%s\n", answer);
  }
  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    $0x0,%al
call   1030 <get_question@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <get_answer@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <get_question@plt>
xor    %eax,%eax
call   1050 <get_answer@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %2, %8
%9 = call i8* (...) @get_question()
store i8* %9, i8** %6
%10 = call i8* (...) @get_answer()
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %11)
br label %8
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i8* (...) @get_question()
%5 = tail call i8* (...) @get_answer()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %3
}
__attribute__((weak)) void fd_nrf8001_open_advertising_pipe_success(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_open_advertising_pipe_success() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char C;
  scanf("%c", &C);
  if ('A' <= C <= 'Z') {
    printf("Capital Letter");
  } else if ('a' <= C <= 'z') {
    printf("Small Letter");
  }
  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
mov    $0x41,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x5a,%eax
jg     116c <main+0x4c>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <main+0x79>
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x7a,%eax
jg     1194 <main+0x74>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
jmp    1199 <main+0x79>
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>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [15 x i8] c"Capital Letter\00"
@.str.2 = [13 x i8] c"Small Letter\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sle i32 65, %5
%7 = zext i1 %6 to i32
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %20
11: ; preds = %0
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sle i32 97, %13
%15 = zext i1 %14 to i32
%16 = icmp sle i32 %15, 122
br i1 %16, label %17, label %19
17: ; preds = %11
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %11
br label %20
20: ; preds = %19, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [15 x i8] c"Capital Letter\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void f_deferred(void) {}


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

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

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

LLVM IR (-O2):
define void @f_deferred() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ trim(char *);
int main(void) {
  char s[] = "hello, world     \t\n";
  trim(s);
  printf("%s\n", s);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <trim@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e72(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xa0920,0x10(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <trim@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [20 x i8] c"hello, world \09\0A\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
store i32 0, i32* %1
%3 = bitcast [20 x i8]* %2 to i8*
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @trim(i8* %4)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@__const.main.s = [20 x i8] c"hello, world \09\0A\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @trim(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
const char *protobuf_c_version(void) { return "1.0.1"; }


x86 assembly (clang, -O0):
<protobuf_c_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<protobuf_c_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"1.0.1\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.0.1\00"
define i8* @protobuf_c_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ int80(int, char *, int, int /*<<< orphan*/,
                         int /*<<< orphan*/, int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
void ps() {
  char *buffer = malloc(3000);
  int80(28, buffer, 3000, 0, 0, 0);
  printf(buffer);
  free(buffer);
}


x86 assembly (clang, -O0):
<ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xbb8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1c,%edi
mov    $0xbb8,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1060 <int80@plt>
mov    -0x8(%rbp),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps>:
push   %rbx
mov    $0xbb8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    $0x1c,%edi
mov    %rax,%rsi
mov    $0xbb8,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1060 <int80@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ps() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 3000)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @int80(i32 28, i8* %3, i32 3000, i32 0, i32 0, i32 0)
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* %5)
%7 = load i8*, i8** %1
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @ps() {
%1 = tail call dereferenceable_or_null(3000) i8* @malloc(i32 3000)
%2 = tail call i32 @int80(i32 28, i8* %1, i32 3000, i32 0, i32 0, i32 0)
%3 = tail call i32 @printf(i8* dereferenceable(1) %1)
%4 = tail call i32 @free(i8* %1)
ret void
}
void initialiseStatesAndConstants(double *states, double *variables) {
  variables[0] = 123.0;
  variables[1] = 789.0;
  states[0] = variables[0];
  states[1] = 0.001 * variables[1];
}


x86 assembly (clang, -O0):
<initialiseStatesAndConstants>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xef8(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xee0(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movsd  0xeb7(%rip),%xmm0
mulsd  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialiseStatesAndConstants>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rsi)
movabs $0x405ec00000000000,%rax
c0 5e 40
mov    %rax,(%rdi)
movsd  0x8(%rsi),%xmm0
mulsd  0xeec(%rip),%xmm0
movsd  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @initialiseStatesAndConstants(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = getelementptr inbounds double, double* %5, i64 0
store double 1.230000e+02, double* %6
%7 = load double*, double** %4
%8 = getelementptr inbounds double, double* %7, i64 1
store double 7.890000e+02, double* %8
%9 = load double*, double** %4
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %4
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = fmul double 1.000000e-03, %16
%18 = load double*, double** %3
%19 = getelementptr inbounds double, double* %18, i64 1
store double %17, double* %19
ret void
}

LLVM IR (-O2):
define void @initialiseStatesAndConstants(double* nocapture writeonly %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %1, i64 1
%4 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 1.230000e+02, double 7.890000e+02>, <2 x double>* %4
store double 1.230000e+02, double* %0
%5 = load double, double* %3
%6 = fmul double %5, 1.000000e-03
%7 = getelementptr inbounds double, double* %0, i64 1
store double %6, double* %7
ret void
}
void pcp_print_net_ip_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_net_ip_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_net_ip_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t HibernateRTCTrimGet(void) {
  return ((*((volatile unsigned long *)(0x400FC024))));
}


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

x86 assembly (clang, -O2):
<HibernateRTCTrimGet>:
mov    0x400fc024,%rax
40
ret

LLVM IR (-O0):
define i64 @HibernateRTCTrimGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774052 to i64*)
ret i64 %1
}

LLVM IR (-O2):
define i64 @HibernateRTCTrimGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774052 to i64*)
ret i64 %1
}
/* Type definitions */
typedef int socklen_t;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_TYPE;
scalar_t__ getsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *,
                      int *);
int is_a_socket(int fd) {
  int v;
  socklen_t l = sizeof(int);
  return getsockopt(fd, SOL_SOCKET, SO_TYPE, (char *)&v, &l) == 0;
}


x86 assembly (clang, -O0):
<is_a_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
lea    -0xc(%rbp),%r8
call   1030 <getsockopt@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_a_socket>:
push   %rax
movl   $0x4,(%rsp)
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
call   1030 <getsockopt@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_TYPE = global i32 0
define i32 @is_a_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_TYPE
%8 = bitcast i32* %3 to i8*
%9 = call i64 @getsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32* %4)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_TYPE = global i32 0
define i32 @is_a_socket(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_TYPE
%8 = call i64 @getsockopt(i32 %0, i32 %6, i32 %7, i8* %4, i32* %3)
%9 = icmp eq i64 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}
void arch_cpu_halt(void) { __asm__ __volatile__("hlt"); }


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

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

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

LLVM IR (-O2):
define void @arch_cpu_halt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_read_block(int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ const *, int);
uint8_t eeprom_read_byte(const uint8_t *addr) {
  uint8_t ret = 0;
  eeprom_read_block(&ret, addr, 1);
  return ret;
}


x86 assembly (clang, -O0):
<eeprom_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x1,%edx
call   1030 <eeprom_read_block@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_read_byte>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%edx
call   1030 <eeprom_read_block@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @eeprom_read_byte(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @eeprom_read_block(i32* %2, i32* %0, i32 1)
%5 = load i32, i32* %2
ret i32 %5
}
void RTStrCacheCreate(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @socfpga_init_l2_ecc() {
ret void
}
void *netsnmp_generic_row_get(void *table, void *row) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @netsnmp_generic_row_get(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ cams;

/* Variables and functions */
char *getContainerInfo(char *, int *, int, int);
int /*<<< orphan*/ printf(char *, char *);
void main() {
  char containers[] = "-X--XX";
  int cams[] = {1, 2};
  int len = sizeof(cams) / sizeof(cams[0]);
  int L = 3;
  printf("%s", getContainerInfo(containers, cams, len, L));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xec4(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x3,-0x18(%rbp)
lea    -0x7(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <getContainerInfo@plt>
mov    %rax,%rsi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x58582d,0xb(%rsp)
movl   $0x2d2d582d,0x8(%rsp)
2d
movabs $0x200000001,%rax
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1040 <getContainerInfo@plt>
lea    0xea4(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.containers = [7 x i8] c"-X--XX\00"
@__const.main.cams = [2 x i32] [i32 1, i32 2]
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca [2 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [7 x i8]* %1 to i8*
%6 = bitcast [2 x i32]* %2 to i8*
store i32 2, i32* %3
store i32 3, i32* %4
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i8* @getContainerInfo(i8* %7, i32* %8, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@__const.main.containers = [7 x i8] c"-X--XX\00"
@.str = [3 x i8] c"%s\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca i64
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = bitcast i64* %2 to i8*
store i64 8589934593, i64* %2
%5 = bitcast i64* %2 to i32*
%6 = call i8* @getContainerInfo(i8* %3, i32* %5, i32 2, i32 3)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ myForeignLibExit();
int /*<<< orphan*/ myForeignLibInit();
int /*<<< orphan*/ sayHi();
int main() {
  myForeignLibInit();
  sayHi();
  myForeignLibExit();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <myForeignLibInit@plt>
mov    $0x0,%al
call   1040 <sayHi@plt>
mov    $0x0,%al
call   1030 <myForeignLibExit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @myForeignLibInit()
%3 = call i32 (...) @sayHi()
%4 = call i32 (...) @myForeignLibExit()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @myForeignLibInit()
%2 = tail call i32 (...) @sayHi()
%3 = tail call i32 (...) @myForeignLibExit()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr,
          "Usage: %s --port <udp port> --intf <forward interface> "
          "--verbose\n",
          name);
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: %s --port <udp port> --intf <forward interface> --verbose\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [66 x i8] c"Usage: %s --port <udp port> --intf <forward interface> --verbose\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
double const drand48();
int getRandomBit(const double onprob) {
  int random;
  random = drand48() < onprob;
  return random;
}


x86 assembly (clang, -O0):
<getRandomBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <drand48@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomBit>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <drand48@plt>
xor    %eax,%eax
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getRandomBit(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = call double (...) @drand48()
%5 = load double, double* %2
%6 = fcmp olt double %4, %5
%7 = zext i1 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @getRandomBit(double %0) {
%2 = tail call double (...) @drand48()
%3 = fcmp olt double %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ set_gint_sts(int);
void handle_usb_reset_interrupt(void) {
  debug("usb_reset\r\n");
  set_gint_sts((1 << 12));
}


x86 assembly (clang, -O0):
<handle_usb_reset_interrupt>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <debug@plt>
mov    $0x1000,%edi
call   1040 <set_gint_sts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_usb_reset_interrupt>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <debug@plt>
mov    $0x1000,%edi
pop    %rax
jmp    1040 <set_gint_sts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"usb_reset\0D\0A\00"
define void @handle_usb_reset_interrupt() {
%1 = call i32 @debug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @set_gint_sts(i32 4096)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"usb_reset\0D\0A\00"
define void @handle_usb_reset_interrupt() {
%1 = tail call i32 @debug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @set_gint_sts(i32 4096)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help() {
  puts("CHATTY");
  puts("-h,--h \t \t \t Displays this help page");
  puts("-v,--v \t \t \t Turns on verbose mode");
  puts("");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed3(%rip),%rdi
call   1040 <puts@plt>
lea    0xeec(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"CHATTY\00"
@.str.1 = [37 x i8] c"-h,--h \09 \09 \09 Displays this help page\00"
@.str.2 = [35 x i8] c"-v,--v \09 \09 \09 Turns on verbose mode\00"
@.str.3 = [1 x i8] zeroinitializer
define void @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"CHATTY\00"
@.str.1 = [37 x i8] c"-h,--h \09 \09 \09 Displays this help page\00"
@.str.2 = [35 x i8] c"-v,--v \09 \09 \09 Turns on verbose mode\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @putchar(i32 10)
ret void
}
void null_debug_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @null_debug_cleanup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: pedant [-m <max>] [-s]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: pedant [-m <max>] [-s]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Usage: pedant [-m <max>] [-s]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct tl880_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ tl880_read_register(struct tl880_dev *, int);
int tl880_hpip_int(struct tl880_dev *tl880dev) {
  tl880_read_register(tl880dev, 0x800c);
  tl880_read_register(tl880dev, 0x8008);
  return 0;
}


x86 assembly (clang, -O0):
<tl880_hpip_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x800c,%esi
call   1030 <tl880_read_register@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8008,%esi
call   1030 <tl880_read_register@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tl880_hpip_int>:
push   %rbx
mov    %rdi,%rbx
mov    $0x800c,%esi
call   1030 <tl880_read_register@plt>
mov    %rbx,%rdi
mov    $0x8008,%esi
call   1030 <tl880_read_register@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tl880_dev = type { i32 }
define i32 @tl880_hpip_int(%struct.tl880_dev* %0) {
%2 = alloca %struct.tl880_dev*
store %struct.tl880_dev* %0, %struct.tl880_dev** %2
%3 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%4 = call i32 @tl880_read_register(%struct.tl880_dev* %3, i32 32780)
%5 = load %struct.tl880_dev*, %struct.tl880_dev** %2
%6 = call i32 @tl880_read_register(%struct.tl880_dev* %5, i32 32776)
ret i32 0
}

LLVM IR (-O2):
%struct.tl880_dev = type { i32 }
define i32 @tl880_hpip_int(%struct.tl880_dev* %0) {
%2 = tail call i32 @tl880_read_register(%struct.tl880_dev* %0, i32 32780)
%3 = tail call i32 @tl880_read_register(%struct.tl880_dev* %0, i32 32776)
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52e_set_strmtyp(uint8_t *p_a52, uint8_t i_strmtyp) {
  p_a52[2] &= ~0xc0;
  p_a52[2] |= (i_strmtyp & 0x3) << 6;
}


x86 assembly (clang, -O0):
<a52e_set_strmtyp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
and    $0xffffff3f,%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_set_strmtyp>:
mov    $0xffffff3f,%eax
and    0x8(%rdi),%eax
shl    $0x6,%esi
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,0x8(%rdi)
ret

LLVM IR (-O0):
define void @a52e_set_strmtyp(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 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = and i32 %7, -193
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 3
%11 = shl i32 %10, 6
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @a52e_set_strmtyp(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = and i32 %4, -193
%6 = shl i32 %1, 6
%7 = and i32 %6, 192
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f_cv();
void g1(void) { f_cv(); }


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

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

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

LLVM IR (-O2):
define void @g1() {
%1 = tail call i32 (...) @f_cv()
ret void
}
void sig_ignore_handler(int signal __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @sig_ignore_handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prog1();
int /*<<< orphan*/ prog2();
int main(void) {
  printf("Hello from program.c\n");
  prog1();
  prog2();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <prog1@plt>
xor    %eax,%eax
call   1050 <prog2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Hello from program.c\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @prog1()
%4 = call i32 (...) @prog2()
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Hello from program.c\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @prog1()
%3 = tail call i32 (...) @prog2()
ret i32 0
}
int dysize(year)
int year;
{ return __isleap(year) ? 366 : 365; }


x86 assembly (clang, -O0):
<dysize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <__isleap@plt>
mov    %eax,%edx
mov    $0x16d,%eax
mov    $0x16e,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dysize>:
push   %rax
xor    %eax,%eax
call   1030 <__isleap@plt>
cmp    $0x1,%eax
mov    $0x16e,%eax
sbb    $0x0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dysize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @__isleap to i32 (i32, ...)*)(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 366, i32 365
ret i32 %7
}

LLVM IR (-O2):
define i32 @dysize(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @__isleap to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 365, i32 366
ret i32 %4
}
dylen(yr) unsigned yr;
{
  if (yr % 4)
    return (365);
  return (366);
}


x86 assembly (clang, -O0):
<dylen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     1122 <dylen+0x22>
movl   $0x16d,-0x4(%rbp)
jmp    1129 <dylen+0x29>
movl   $0x16e,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dylen>:
and    $0x3,%edi
cmp    $0x1,%edi
mov    $0x16d,%eax
adc    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @dylen(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 366, i32 365
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint64_t cread_u32(const void *const ptr) {
  return (uint64_t)(*(uint32_t *)(ptr));
}


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

x86 assembly (clang, -O2):
<cread_u32>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @cread_u32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *fmsg(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
void log_msg_args1(int msg_nr, char *arg1) {
  char buf[128];
  sprintf(buf, fmsg(msg_nr), arg1);
  fprintf(stderr, buf);
  exit(-1);
}


x86 assembly (clang, -O0):
<log_msg_args1>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fmsg@plt>
mov    -0x98(%rbp),%rdi
mov    %rax,%rsi
mov    -0x10(%rbp),%rdx
call   1050 <sprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    -0x90(%rbp),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<log_msg_args1>:
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rsi,%rbx
call   1030 <fmsg@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1050 <sprintf@plt>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @log_msg_args1(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [128 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i8* @fmsg(i32 %7)
%9 = load i8*, i8** %4
%10 = call i32 @sprintf(i8* %6, i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%13 = call i32 @fprintf(i32 %11, i8* %12)
%14 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @log_msg_args1(i32 %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = tail call i8* @fmsg(i32 %0)
%6 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) %5, i8* %1)
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* %4)
%9 = call i32 @exit(i32 -1)
unreachable
}
unsigned unsigned_log_ceiling(unsigned i) {
  unsigned j, k;
  for (j = 0, k = 1; k < i; j++, k = k << 1)
    ;
  return (j);
}


x86 assembly (clang, -O0):
<unsigned_log_ceiling>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    113d <unsigned_log_ceiling+0x3d>
jmp    1126 <unsigned_log_ceiling+0x26>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <unsigned_log_ceiling+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_log_ceiling>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     1119 <unsigned_log_ceiling+0x19>
xor    %eax,%eax
mov    $0x1,%ecx
xchg   %ax,%ax
add    $0x1,%eax
add    %ecx,%ecx
cmp    %edi,%ecx
jb     1110 <unsigned_log_ceiling+0x10>
ret

LLVM IR (-O0):
define i32 @unsigned_log_ceiling(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %4
%14 = shl i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @unsigned_log_ceiling(i32 %0) {
%2 = icmp ugt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ 0, %1 ]
%6 = add i32 %5, 1
%7 = shl i32 %4, 1
%8 = icmp ult i32 %7, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_SetColor(float const *);
void UI_SetColor(const float *rgba) { trap_R_SetColor(rgba); }


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

x86 assembly (clang, -O2):
<UI_SetColor>:
jmp    1030 <trap_R_SetColor@plt>

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

LLVM IR (-O2):
define void @UI_SetColor(float* %0) {
%2 = tail call i32 @trap_R_SetColor(float* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void ft_putstr(char *str) {
  int i;
  i = 0;
  while (str[i])
    write(1, &str[i++], 1);
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115a <ft_putstr+0x4a>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
cltq
add    %rax,%rsi
mov    $0x1,%edx
mov    %edx,%edi
call   1030 <write@plt>
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113c <ft_putstr+0x2c>
mov    %rdi,%rbx
nopl   0x0(%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @write(i32 1, i8* %6, i32 1)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int av_get_flicker(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_get_flicker() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _write(int, char *, int);
void print(char *ptr) {
  char *p = ptr;
  while (*p != '\0')
    p++;
  _write(1, ptr, p - ptr);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <print+0x35>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <print+0x14>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,(%rsi,%rdx,1)
lea    0x1(%rdx),%rdx
jne    1120 <print+0x10>
add    $0xffffffff,%edx
mov    $0x1,%edi
jmp    1030 <_write@plt>

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

LLVM IR (-O2):
define void @print(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
%12 = tail call i32 @_write(i32 1, i8* %0, i32 %11)
ret void
}