xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *);
int gethostname(char *name, size_t len) {
  snprintf(name, len, "nacl-host");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"nacl-host\00"
define i32 @gethostname(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 @snprintf(i8* %5, i64 %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"nacl-host\00"
define i32 @gethostname(i8* nocapture writeonly %0, i64 %1) {
%3 = tail call i32 @snprintf(i8* %0, i64 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int f12(int x, int y) {
  if (y != -1)
    return x % -y;
  return 34;
}


x86 assembly (clang, -O0):
<f12>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
je     1127 <f12+0x27>
mov    -0x8(%rbp),%eax
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
jmp    112e <f12+0x2e>
movl   $0x22,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f12>:
cmp    $0xffffffff,%esi
je     110f <f12+0xf>
neg    %esi
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret
mov    $0x22,%eax
ret

LLVM IR (-O0):
define i32 @f12(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* %5
%7 = icmp ne i32 %6, -1
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 @f12(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, -1
br i1 %3, label %7, label %4
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
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ pthread_join(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
void *tf(void *arg) {
  pthread_t th = (pthread_t)arg;
  if (pthread_join(th, NULL) == 0) {
    puts("thread in parent joined!?");
    exit(1);
  }
  puts("join in thread in parent returned!?");
  exit(1);
}


x86 assembly (clang, -O0):
<tf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <pthread_join@plt>
cmp    $0x0,%rax
jne    116f <tf+0x3f>
lea    0xea0(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<tf>:
push   %rax
xor    %esi,%esi
call   1050 <pthread_join@plt>
test   %rax,%rax
jne    1146 <tf+0x16>
lea    0xebc(%rip),%rdi
jmp    114d <tf+0x1d>
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"thread in parent joined!?\00"
@.str.1 = [36 x i8] c"join in thread in parent returned!?\00"
define i8* @tf(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i64 @pthread_join(i32 %6, i32* null)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [26 x i8] c"thread in parent joined!?\00"
@.str.1 = [36 x i8] c"join in thread in parent returned!?\00"
define noalias i8* @tf(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i64 @pthread_join(i32 %3, i32* null)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %1
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ XPropertyEvent;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_XPropertyEvent(void *_p) {
  if (_p == NULL)
    abort();
  free((XPropertyEvent *)_p);
}


x86 assembly (clang, -O0):
<free_XPropertyEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <free_XPropertyEvent+0x1e>
mov    $0x0,%al
call   1040 <abort@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_XPropertyEvent>:
test   %rdi,%rdi
je     112a <free_XPropertyEvent+0xa>
jmp    1030 <free@plt>
push   %rax
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @free_XPropertyEvent(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = bitcast i8* %8 to i32*
%10 = call i32 @free(i32* %9)
ret void
}

LLVM IR (-O2):
define void @free_XPropertyEvent(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = bitcast i8* %0 to i32*
%7 = tail call i32 @free(i32* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  for (int i = 1; i < argc; ++i) {
    printf("%s\n", argv[i]);
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
mov    $0x1,%ebx
lea    0xed1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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 i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ leds_write(int);
void LedHardware_BlankAllLeds() { leds_write(0x0); }


x86 assembly (clang, -O0):
<LedHardware_BlankAllLeds>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <leds_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedHardware_BlankAllLeds>:
xor    %edi,%edi
jmp    1030 <leds_write@plt>

LLVM IR (-O0):
define void @LedHardware_BlankAllLeds() {
%1 = call i32 @leds_write(i32 0)
ret void
}

LLVM IR (-O2):
define void @LedHardware_BlankAllLeds() {
%1 = tail call i32 @leds_write(i32 0)
ret void
}
/* Variables and functions */
int fabs(double);
int /*<<< orphan*/ setbitu(unsigned char *, int, int, int);
void setbitg(unsigned char *buff, int pos, int len, double value) {
  setbitu(buff, pos, 1, value < 0 ? 1 : 0);
  setbitu(buff, pos + 1, len - 1, fabs(value));
}


x86 assembly (clang, -O0):
<setbitg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm1
xorps  %xmm0,%xmm0
xor    %ecx,%ecx
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
cmova  %eax,%ecx
mov    $0x1,%edx
call   1040 <setbitu@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <fabs@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1040 <setbitu@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbitg>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
mov    $0x1,%edx
call   1040 <setbitu@plt>
add    $0x1,%ebp
add    $0xffffffff,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <fabs@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <setbitu@plt>

LLVM IR (-O0):
define void @setbitg(i8* %0, i32 %1, i32 %2, double %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load double, double* %8
%12 = fcmp olt double %11, 0.000000e+00
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 1, i32 0
%15 = call i32 @setbitu(i8* %9, i32 %10, i32 1, i32 %14)
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = load double, double* %8
%22 = call i32 @fabs(double %21)
%23 = call i32 @setbitu(i8* %16, i32 %18, i32 %20, i32 %22)
ret void
}

LLVM IR (-O2):
define void @setbitg(i8* %0, i32 %1, i32 %2, double %3) {
%5 = fcmp olt double %3, 0.000000e+00
%6 = zext i1 %5 to i32
%7 = tail call i32 @setbitu(i8* %0, i32 %1, i32 1, i32 %6)
%8 = add nsw i32 %1, 1
%9 = add nsw i32 %2, -1
%10 = tail call i32 @fabs(double %3)
%11 = tail call i32 @setbitu(i8* %0, i32 %8, i32 %9, i32 %10)
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ ca;

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ epicfail(char *);
int accept_connection(int fd) {
  struct sockaddr_in ca;
  socklen_t sz = sizeof(ca);
  int client;
  if ((client = accept(fd, (struct sockaddr *)&ca, &sz)) == -1)
    epicfail("accept");
  return client;
}


x86 assembly (clang, -O0):
<accept_connection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0xc(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
jne    115a <accept_connection+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <epicfail@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<accept_connection>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0x4(%rsp)
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <accept@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    114f <accept_connection+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <epicfail@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @accept_connection(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %4
%6 = load i32, i32* %2
%7 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%8 = call i32 @accept(i32 %6, %struct.sockaddr* %7, i32* %4)
store i32 %8, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = call i32 @epicfail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %1
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [7 x i8] c"accept\00"
define i32 @accept_connection(i32 %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = bitcast %struct.sockaddr_in* %2 to i8*
%5 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%6 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%7 = call i32 @accept(i32 %0, %struct.sockaddr* %6, i32* %3)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @epicfail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret i32 %7
}
/* Variables and functions */
double READ_SHORT();
float READ_COORD(void) { return (float)(READ_SHORT() * (1.0 / 8)); }


x86 assembly (clang, -O0):
<READ_COORD>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <READ_SHORT@plt>
movsd  0xedd(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<READ_COORD>:
push   %rax
xor    %eax,%eax
call   1030 <READ_SHORT@plt>
mulsd  0xee0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @READ_COORD() {
%1 = call double (...) @READ_SHORT()
%2 = fmul double %1, 1.250000e-01
%3 = fptrunc double %2 to float
ret float %3
}

LLVM IR (-O2):
define float @READ_COORD() {
%1 = tail call double (...) @READ_SHORT()
%2 = fmul double %1, 1.250000e-01
%3 = fptrunc double %2 to float
ret float %3
}
int main(void) {
  volatile int a = 0;
  volatile long long int b = 0;
  volatile unsigned int c = 1;
  a / b;
  0 / 0;
  a / 0;
  0 / b;
  2 / --c;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x10(%rsp)
movq   $0x0,-0x8(%rsp)
movl   $0x1,-0xc(%rsp)
mov    -0x10(%rsp),%eax
mov    -0x8(%rsp),%rax
mov    -0x10(%rsp),%eax
mov    -0x8(%rsp),%rax
addl   $0xffffffff,-0xc(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
store volatile i32 0, i32* %2
store volatile i64 0, i64* %3
store volatile i32 1, i32* %4
%5 = load volatile i32, i32* %2
%6 = sext i32 %5 to i64
%7 = load volatile i64, i64* %3
%8 = sdiv i64 %6, %7
%9 = load volatile i32, i32* %2
%10 = sdiv i32 %9, 0
%11 = load volatile i64, i64* %3
%12 = sdiv i64 0, %11
%13 = load volatile i32, i32* %4
%14 = add i32 %13, -1
store volatile i32 %14, i32* %4
%15 = udiv i32 2, %14
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%5 = bitcast i64* %2 to i8*
store volatile i64 0, i64* %2
%6 = bitcast i32* %3 to i8*
store volatile i32 1, i32* %3
%7 = load volatile i32, i32* %1
%8 = load volatile i64, i64* %2
%9 = load volatile i32, i32* %1
%10 = load volatile i64, i64* %2
%11 = load volatile i32, i32* %3
%12 = add i32 %11, -1
store volatile i32 %12, i32* %3
ret i32 0
}
double min_dble(double x, double y) {
  if (x < y) {
    return x;
  } else {
    return y;
  }
}


x86 assembly (clang, -O0):
<min_dble>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min_dble+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <min_dble+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min_dble>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min_dble(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp olt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @min_dble(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
double fabs(double);
double pow(int, double);
double rnormal01();
double rlognormal(double m, double sd) {
  double psd;
  psd = fabs(sd);
  return m * pow(10, rnormal01() * psd);
}


x86 assembly (clang, -O0):
<rlognormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xec2(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    $0x0,%al
call   1030 <rnormal01@plt>
mulsd  -0x18(%rbp),%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlognormal>:
sub    $0x28,%rsp
movsd  %xmm0,0x8(%rsp)
andps  0xecf(%rip),%xmm1
movaps %xmm1,0x10(%rsp)
xor    %eax,%eax
call   1030 <rnormal01@plt>
mulsd  0x10(%rsp),%xmm0
mov    $0xa,%edi
call   1040 <pow@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @rlognormal(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = call double @llvm.fabs.f64(double %6)
store double %7, double* %5
%8 = load double, double* %3
%9 = call double (...) @rnormal01()
%10 = load double, double* %5
%11 = fmul double %9, %10
%12 = call double @pow(i32 10, double %11)
%13 = fmul double %8, %12
ret double %13
}

LLVM IR (-O2):
define double @rlognormal(double %0, double %1) {
%3 = tail call double @llvm.fabs.f64(double %1)
%4 = tail call double (...) @rnormal01()
%5 = fmul double %3, %4
%6 = tail call double @pow(i32 10, double %5)
%7 = fmul double %6, %0
ret double %7
}
int ascending(double *a1, double *a2) {
  double loc = *a1;
  double loc2 = *a2;
  if (loc < loc2) {
    return -1;
  } else if (loc == loc2) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ascending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <ascending+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1174 <ascending+0x74>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    1168 <ascending+0x68>
jp     1168 <ascending+0x68>
movl   $0x0,-0x4(%rbp)
jmp    1174 <ascending+0x74>
jmp    116d <ascending+0x6d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascending>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movapd %xmm0,%xmm2
cmpneqsd %xmm1,%xmm2
movq   %xmm2,%rcx
and    $0x1,%ecx
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ascending(double* %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca double*
%6 = alloca double
%7 = alloca double
store double* %0, double** %4
store double* %1, double** %5
%8 = load double*, double** %4
%9 = load double, double* %8
store double %9, double* %6
%10 = load double*, double** %5
%11 = load double, double* %10
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %23
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp oeq double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 0, i32* %3
br label %23
21: ; preds = %16
br label %22
22: ; preds = %21
store i32 1, i32* %3
br label %23
23: ; preds = %22, %20, %15
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @ascending(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = fcmp une double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ parseline(char *);
int /*<<< orphan*/ prompt();
int /*<<< orphan*/ stdin;
void shell(void) {
  char input[1024];
  while (1) {
    prompt();
    if (feof(stdin))
      break;
    fgets(input, 1024, stdin);
    parseline(input);
  }
}


x86 assembly (clang, -O0):
<shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    $0x0,%al
call   1030 <prompt@plt>
mov    0x2e8f(%rip),%rax
mov    (%rax),%edi
call   1060 <feof@plt>
cmp    $0x0,%rax
je     116f <shell+0x2f>
jmp    119a <shell+0x5a>
lea    -0x400(%rbp),%rdi
mov    0x2e6b(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
lea    -0x400(%rbp),%rdi
call   1040 <parseline@plt>
jmp    114b <shell+0xb>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shell>:
push   %r14
push   %rbx
sub    $0x408,%rsp
xor    %eax,%eax
call   1030 <prompt@plt>
mov    0x2e90(%rip),%r14
mov    (%r14),%edi
call   1060 <feof@plt>
test   %rax,%rax
jne    119c <shell+0x5c>
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1040 <parseline@plt>
xor    %eax,%eax
call   1030 <prompt@plt>
mov    (%r14),%edi
call   1060 <feof@plt>
test   %rax,%rax
je     1170 <shell+0x30>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @shell() {
%1 = alloca [1024 x i8]
br label %2
2: ; preds = %0, %8
%3 = call i32 (...) @prompt()
%4 = load i32, i32* @stdin
%5 = call i64 @feof(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %2
br label %14
8: ; preds = %2
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 1024, i32 %10)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%13 = call i32 @parseline(i8* %12)
br label %2
14: ; preds = %7
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @shell() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = call i32 (...) @prompt()
%4 = load i32, i32* @stdin
%5 = call i64 @feof(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %0, %7
%8 = load i32, i32* @stdin
%9 = call i32 @fgets(i8* %2, i32 1024, i32 %8)
%10 = call i32 @parseline(i8* %2)
%11 = call i32 (...) @prompt()
%12 = load i32, i32* @stdin
%13 = call i64 @feof(i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %7, label %15
15: ; preds = %7, %0
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels64_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels64_12_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblock_new() {
  printf("NOT IMPLEMENTED:"
         "pa_memblock_new"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"NOT IMPLEMENTED:pa_memblock_new\0A\00"
define i32 @pa_memblock_new() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_memblock_new\00"
define i32 @pa_memblock_new() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int pow(double, int);
double gnr(double x) { return (pow(x, 3) + 4 * pow(x, 2) - 10); }


x86 assembly (clang, -O0):
<gnr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x2,%ecx
add    %ecx,%eax
sub    $0xa,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnr>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x3,%edi
call   1030 <pow@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
lea    (%rbx,%rax,4),%eax
add    $0xfffffff6,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @gnr(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @pow(double %3, i32 3)
%5 = load double, double* %2
%6 = call i32 @pow(double %5, i32 2)
%7 = mul nsw i32 4, %6
%8 = add nsw i32 %4, %7
%9 = sub nsw i32 %8, 10
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @gnr(double %0) {
%2 = tail call i32 @pow(double %0, i32 3)
%3 = tail call i32 @pow(double %0, i32 2)
%4 = shl nsw i32 %3, 2
%5 = add i32 %2, -10
%6 = add i32 %5, %4
%7 = sitofp i32 %6 to double
ret double %7
}
void ip_selector_match_debug_log_fields(const struct IPSelectorFields *fields) {
  ;
}


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

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

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

LLVM IR (-O2):
%struct.IPSelectorFields = type opaque
define void @ip_selector_match_debug_log_fields(%struct.IPSelectorFields* nocapture %0) {
ret void
}
int test_imm_AEuint8_mem(unsigned char *val) {
  return ((*val) & (0xAE << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_AEuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -82
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ poke32(int, int);
int /*<<< orphan*/ uart_rxfifo_drain();
int /*<<< orphan*/ uart_txfifo_fill();
void rpi_uart_irq_f(void) {
  uart_rxfifo_drain();
  uart_txfifo_fill();
  poke32((0x20201000 + 0x44), (0x7F1));
}


x86 assembly (clang, -O0):
<rpi_uart_irq_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <uart_rxfifo_drain@plt>
mov    $0x0,%al
call   1030 <uart_txfifo_fill@plt>
mov    $0x20201044,%edi
mov    $0x7f1,%esi
call   1040 <poke32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpi_uart_irq_f>:
push   %rax
xor    %eax,%eax
call   1050 <uart_rxfifo_drain@plt>
xor    %eax,%eax
call   1030 <uart_txfifo_fill@plt>
mov    $0x20201044,%edi
mov    $0x7f1,%esi
pop    %rax
jmp    1040 <poke32@plt>

LLVM IR (-O0):
define void @rpi_uart_irq_f() {
%1 = call i32 (...) @uart_rxfifo_drain()
%2 = call i32 (...) @uart_txfifo_fill()
%3 = call i32 @poke32(i32 538972228, i32 2033)
ret void
}

LLVM IR (-O2):
define void @rpi_uart_irq_f() {
%1 = tail call i32 (...) @uart_rxfifo_drain()
%2 = tail call i32 (...) @uart_txfifo_fill()
%3 = tail call i32 @poke32(i32 538972228, i32 2033)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void fun2() {
  printf("are \n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"are \00"
define void @fun2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LOG_CRIT;
scalar_t__ chdir(char *);
int config_init();
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *);
int ledtriggerd_init(void) {
  int ret = 0;
  if (chdir("/sys/class/leds/")) {
    syslog(LOG_CRIT, "sysfs path not accessible!\n");
    ret = 1;
    goto abort;
  }
  ret = config_init();
  if (ret)
    goto abort;
abort:
  return ret;
}


x86 assembly (clang, -O0):
<ledtriggerd_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <chdir@plt>
cmp    $0x0,%rax
je     1176 <ledtriggerd_init+0x46>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
call   1050 <syslog@plt>
movl   $0x1,-0x4(%rbp)
jmp    1194 <ledtriggerd_init+0x64>
mov    $0x0,%al
call   1030 <config_init@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     118f <ledtriggerd_init+0x5f>
jmp    1194 <ledtriggerd_init+0x64>
jmp    1194 <ledtriggerd_init+0x64>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ledtriggerd_init>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <chdir@plt>
test   %rax,%rax
je     115e <ledtriggerd_init+0x2e>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1050 <syslog@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
jmp    1030 <config_init@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"/sys/class/leds/\00"
@LOG_CRIT = global i32 0
@.str.1 = [28 x i8] c"sysfs path not accessible!\0A\00"
define i32 @ledtriggerd_init() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @chdir(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @LOG_CRIT
%6 = call i32 @syslog(i32 %5, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %13
7: ; preds = %0
%8 = call i32 (...) @config_init()
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %13
12: ; preds = %7
br label %13
13: ; preds = %12, %11, %4
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [17 x i8] c"/sys/class/leds/\00"
@LOG_CRIT = global i32 0
@.str.1 = [28 x i8] c"sysfs path not accessible!\0A\00"
define i32 @ledtriggerd_init() {
%1 = tail call i64 @chdir(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @LOG_CRIT
%5 = tail call i32 @syslog(i32 %4, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = tail call i32 (...) @config_init()
br label %8
8: ; preds = %6, %3
%9 = phi i32 [ 1, %3 ], [ %7, %6 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void __attribute__((regparm(3))) memcpy_27(void *dest, void *src) {
  memcpy(dest, src, 27);
}


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

x86 assembly (clang, -O2):
<memcpy_27>:
mov    $0x1b,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @memcpy_27(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 27)
ret void
}
void a_or(volatile int *p, int v) { (void)__sync_fetch_and_or(p, v); }


x86 assembly (clang, -O0):
<a_or>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
lock or %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_or>:
lock or %esi,(%rdi)
ret

LLVM IR (-O0):
define void @a_or(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 = atomicrmw or i32* %5, i32 %6 seq_cst
ret void
}

LLVM IR (-O2):
define void @a_or(i32* nocapture %0, i32 %1) {
%3 = atomicrmw or i32* %0, i32 %1 seq_cst
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _assert_string_equal(char const *, char const *, char *,
                                        int);
scalar_t__ disemvowel(char *);
void test_no_vowels(void) {
  _assert_string_equal(
      (const char *)"pqrst", (const char *)disemvowel("pqrst"),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/"
      "master/disemvowel/disemvowel_test.c",
      13);
}


x86 assembly (clang, -O0):
<test_no_vowels>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <disemvowel@plt>
mov    %rax,%rsi
lea    0xec6(%rip),%rdi
lea    0xec5(%rip),%rdx
mov    $0xd,%ecx
call   1040 <_assert_string_equal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_no_vowels>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <disemvowel@plt>
lea    0xecf(%rip),%rdx
mov    %rbx,%rdi
mov    %rax,%rsi
mov    $0xd,%ecx
pop    %rbx
jmp    1040 <_assert_string_equal@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"pqrst\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/disemvowel/disemvowel_test.c\00"
define void @test_no_vowels() {
%1 = call i64 @disemvowel(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = call i32 @_assert_string_equal(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"pqrst\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/UMM-CSci-3401-F13/Lab_3_starter/refs/heads/master/disemvowel/disemvowel_test.c\00"
define void @test_no_vowels() {
%1 = tail call i64 @disemvowel(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = inttoptr i64 %1 to i8*
%3 = tail call i32 @_assert_string_equal(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret void
}
/* Variables and functions */
int add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("Sum = %d", add(3, 4));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x4,%esi
call   1030 <add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @add(i32 3, i32 4)
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Sum = %d\00"
define i32 @main() {
%1 = tail call i32 @add(i32 3, i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int gpio_export_unexport(char *, int);
scalar_t__ gpio_is_exported(int);
int gpio_export(int gpio) {
  if (gpio & (0x80000000))
    return 0;
  if (gpio_is_exported(gpio))
    return 0;
  return gpio_export_unexport("/sys/class/gpio"
                              "/export",
                              gpio);
}


x86 assembly (clang, -O0):
<gpio_export>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1148 <gpio_export+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1178 <gpio_export+0x58>
mov    -0x8(%rbp),%edi
call   1030 <gpio_is_exported@plt>
cmp    $0x0,%rax
je     1166 <gpio_export+0x46>
movl   $0x0,-0x4(%rbp)
jmp    1178 <gpio_export+0x58>
mov    -0x8(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1040 <gpio_export_unexport@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_export>:
push   %rbx
test   %edi,%edi
js     1131 <gpio_export+0x11>
mov    %edi,%ebx
call   1030 <gpio_is_exported@plt>
test   %rax,%rax
je     1135 <gpio_export+0x15>
xor    %eax,%eax
pop    %rbx
ret
lea    0xec4(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <gpio_export_unexport@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
define i32 @gpio_export(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -2147483648
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %16
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i64 @gpio_is_exported(i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %16
13: ; preds = %8
%14 = load i32, i32* %3
%15 = call i32 @gpio_export_unexport(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %14)
store i32 %15, i32* %2
br label %16
16: ; preds = %13, %12, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [23 x i8] c"/sys/class/gpio/export\00"
define i32 @gpio_export(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = tail call i64 @gpio_is_exported(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @gpio_export_unexport(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %3, %1, %6
%9 = phi i32 [ %7, %6 ], [ 0, %1 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ capture_event(void *, int, int, int /*<<< orphan*/);
void capture_write_slave_pic(uint16_t port, uint8_t val, void *p) {
  capture_event(p, (6 << 8), 1, port);
}


x86 assembly (clang, -O0):
<capture_write_slave_pic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x600,%esi
mov    $0x1,%edx
call   1030 <capture_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<capture_write_slave_pic>:
mov    %edi,%ecx
mov    %rdx,%rdi
mov    $0x600,%esi
mov    $0x1,%edx
jmp    1030 <capture_event@plt>

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

LLVM IR (-O2):
define void @capture_write_slave_pic(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @capture_event(i8* %2, i32 1536, i32 1, i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ sqrt(float);
float L2measure(float x0, float y0, float x1, float y1) {
  float dx, dy;
  dx = x1 - x0;
  dy = y1 - y0;
  return ((float)sqrt(dx * dx + dy * dy));
}


x86 assembly (clang, -O0):
<L2measure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm1
mulss  -0x18(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<L2measure>:
push   %rax
subss  %xmm0,%xmm2
subss  %xmm1,%xmm3
mulss  %xmm3,%xmm3
mulss  %xmm2,%xmm2
addss  %xmm3,%xmm2
movaps %xmm2,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @L2measure(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%11 = load float, float* %7
%12 = load float, float* %5
%13 = fsub float %11, %12
store float %13, float* %9
%14 = load float, float* %8
%15 = load float, float* %6
%16 = fsub float %14, %15
store float %16, float* %10
%17 = load float, float* %9
%18 = load float, float* %9
%19 = load float, float* %10
%20 = load float, float* %10
%21 = fmul float %19, %20
%22 = call float @llvm.fmuladd.f32(float %17, float %18, float %21)
%23 = call i64 @sqrt(float %22)
%24 = sitofp i64 %23 to float
ret float %24
}

LLVM IR (-O2):
define float @L2measure(float %0, float %1, float %2, float %3) {
%5 = fsub float %2, %0
%6 = fsub float %3, %1
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call i64 @sqrt(float %8)
%10 = sitofp i64 %9 to float
ret float %10
}
void reset_tty() {}


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

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

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

LLVM IR (-O2):
define void @reset_tty() {
ret void
}
int ade7758_initialize_ring(struct iio_ring_buffer *ring) { return 0; }


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t txc_libc_read(int fd, void *buf, size_t nbyte) {
  return read(fd, buf, nbyte);
}


x86 assembly (clang, -O0):
<txc_libc_read>:
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
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<txc_libc_read>:
jmp    1030 <read@plt>

LLVM IR (-O0):
define i32 @txc_libc_read(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 @read(i32 %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @txc_libc_read(i32 %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hello,world");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"hello,world\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}