xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void after_close(void *ctxt) {
  printf("\nclose\n");
  exit(0);
}


x86 assembly (clang, -O0):
<after_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<after_close>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"\0Aclose\0A\00"
define void @after_close(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"\0Aclose\00"
define void @after_close(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double sin(double);
double sin_deg(double value) { return (sin(value * 3.14159265 / 180.0)); }


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

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

LLVM IR (-O0):
define double @sin_deg(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB53C8D4F1
%5 = fdiv double %4, 1.800000e+02
%6 = call double @sin(double %5)
ret double %6
}

LLVM IR (-O2):
define double @sin_deg(double %0) {
%2 = fmul double %0, 0x400921FB53C8D4F1
%3 = fdiv double %2, 1.800000e+02
%4 = tail call double @sin(double %3)
ret double %4
}
/* Variables and functions */
scalar_t__ uart0_putc(char);
int serial_write(char *buf, int len) {
  int i = 0;
  while (i < len) {
    if (uart0_putc(*buf) < 0)
      break;
    i++;
    buf++;
  }
  return i;
}


x86 assembly (clang, -O0):
<serial_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <serial_write+0x57>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <uart0_putc@plt>
cmp    $0x0,%rax
jge    114d <serial_write+0x3d>
jmp    1167 <serial_write+0x57>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1126 <serial_write+0x16>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_write>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <serial_write+0x3a>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <uart0_putc@plt>
test   %rax,%rax
js     114f <serial_write+0x3f>
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1130 <serial_write+0x20>
jmp    1152 <serial_write+0x42>
xor    %r14d,%r14d
jmp    1152 <serial_write+0x42>
mov    %ebx,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @serial_write(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %10
%5 = phi i32 [ %11, %10 ], [ 0, %2 ]
%6 = phi i8* [ %12, %10 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i64 @uart0_putc(i8 signext %7)
%9 = icmp slt i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = add nuw nsw i32 %5, 1
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = icmp eq i32 %11, %1
br i1 %13, label %14, label %4
14: ; preds = %10, %4, %2
%15 = phi i32 [ 0, %2 ], [ %5, %4 ], [ %1, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void task1_func(void) { printf("Hello from task - 1 !\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"Hello from task - 1 !\00"
define void @task1_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *encode(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, char *, ...);
int main() {
  char str[] = "1111111111111111111geeksforgeeks";
  printf("InPut: %s\n", str);
  char *res = encode(str);
  printf("%s => %s\n", str, res);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x21,%edx
call   1060 <memcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <encode@plt>
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x20(%rsp)
lea    0xec9(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <encode@plt>
lea    0xeb8(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [33 x i8] c"1111111111111111111geeksforgeeks\00"
@.str = [11 x i8] c"InPut: %s\0A\00"
@.str.1 = [10 x i8] c"%s => %s\0A\00"
define i32 @main() {
%1 = alloca [33 x i8]
%2 = alloca i8*
%3 = bitcast [33 x i8]* %1 to i8*
%4 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%7 = call i8* @encode(i8* %6)
store i8* %7, i8** %2
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9)
%11 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [33 x i8] c"1111111111111111111geeksforgeeks\00"
@.str = [11 x i8] c"InPut: %s\0A\00"
@.str.1 = [10 x i8] c"%s => %s\0A\00"
define i32 @main() {
%1 = alloca [33 x i8]
%2 = getelementptr inbounds [33 x i8], [33 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i8* @encode(i8* %2)
%5 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %4)
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dabs(double);
double dmax(int /*<<< orphan*/, int /*<<< orphan*/);
double norm2(double x, double y) { return dmax(dabs(x), dabs(y)); }


x86 assembly (clang, -O0):
<norm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <dabs@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <dabs@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <dmax@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm2>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
call   1040 <dabs@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <dabs@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <dmax@plt>

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

LLVM IR (-O2):
define double @norm2(double %0, double %1) {
%3 = tail call i32 @dabs(double %0)
%4 = tail call i32 @dabs(double %1)
%5 = tail call double @dmax(i32 %3, i32 %4)
ret double %5
}
/* Type definitions */
struct jReadElement {
  int dummy;
};

/* Variables and functions */
char *jReadParam(char *, char *, struct jReadElement *, int /*<<< orphan*/ *);
char *jRead(char *pJson, char *pQuery, struct jReadElement *pResult) {
  return jReadParam(pJson, pQuery, pResult, NULL);
}


x86 assembly (clang, -O0):
<jRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <jReadParam@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jRead>:
xor    %ecx,%ecx
jmp    1030 <jReadParam@plt>

LLVM IR (-O0):
%struct.jReadElement = type { i32 }
define i8* @jRead(i8* %0, i8* %1, %struct.jReadElement* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct.jReadElement*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct.jReadElement* %2, %struct.jReadElement** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load %struct.jReadElement*, %struct.jReadElement** %6
%10 = call i8* @jReadParam(i8* %7, i8* %8, %struct.jReadElement* %9, i32* null)
ret i8* %10
}

LLVM IR (-O2):
%struct.jReadElement = type { i32 }
define i8* @jRead(i8* %0, i8* %1, %struct.jReadElement* %2) {
%4 = tail call i8* @jReadParam(i8* %0, i8* %1, %struct.jReadElement* %2, i32* null)
ret i8* %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void bitops_setw(uint16_t *a, uint16_t sh, uint16_t l, uint16_t v) {
  *a &= ~(((1 << (l)) - 1) << sh);
  *a |= (v << sh);
}


x86 assembly (clang, -O0):
<bitops_setw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitops_setw>:
mov    %ecx,%eax
mov    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
mov    %esi,%ecx
shl    %cl,%edx
not    %edx
shl    %cl,%eax
and    (%rdi),%edx
or     %edx,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @bitops_setw(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = shl i32 1, %9
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %6
%13 = shl i32 %11, %12
%14 = xor i32 %13, -1
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = and i32 %16, %14
store i32 %17, i32* %15
%18 = load i32, i32* %8
%19 = load i32, i32* %6
%20 = shl i32 %18, %19
%21 = load i32*, i32** %5
%22 = load i32, i32* %21
%23 = or i32 %22, %20
store i32 %23, i32* %21
ret void
}

LLVM IR (-O2):
define void @bitops_setw(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = shl i32 %6, %1
%8 = xor i32 %7, -1
%9 = load i32, i32* %0
%10 = and i32 %9, %8
%11 = shl i32 %3, %1
%12 = or i32 %10, %11
store i32 %12, i32* %0
ret void
}
int testfunc1(const void *caller, int rlev) {
  int rval, rnd;
  rnd = random() % 1024;
  if (rlev > 0) {
    rval = testfunc1(testfunc1, rlev - 1);
  } else {
    rval = testfunc(testfunc1, rnd);
  }
  return (rval & 0x000000ff);
}


x86 assembly (clang, -O0):
<testfunc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <random@plt>
mov    $0x400,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1165 <testfunc1+0x45>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    0x2e88(%rip),%rdi
call   1050 <testfunc1@plt>
mov    %eax,-0x10(%rbp)
jmp    1179 <testfunc1+0x59>
mov    -0x14(%rbp),%esi
mov    0x2e71(%rip),%rdi
mov    $0x0,%al
call   1030 <testfunc@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testfunc1>:
push   %rbx
mov    %esi,%ebx
xor    %eax,%eax
call   1040 <random@plt>
test   %ebx,%ebx
jle    113a <testfunc1+0x1a>
add    $0xffffffff,%ebx
mov    %ebx,%esi
call   1050 <testfunc1@plt>
jmp    115d <testfunc1+0x3d>
lea    0x3ff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffc00,%ecx
sub    %ecx,%eax
mov    0x2e8c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <testfunc@plt>
movzbl %al,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @testfunc1(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = call i32 (...) @random()
%8 = srem i32 %7, 1024
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* %4
%13 = sub nsw i32 %12, 1
%14 = call i32 @testfunc1(i8* bitcast (i32 (i8*, i32)* @testfunc1 to i8*), i32 %13)
store i32 %14, i32* %5
br label %18
15: ; preds = %2
%16 = load i32, i32* %6
%17 = call i32 (i32 (i8*, i32)*, i32, ...) bitcast (i32 (...)* @testfunc to i32 (i32 (i8*, i32)*, i32, ...)*)(i32 (i8*, i32)* @testfunc1, i32 %16)
store i32 %17, i32* %5
br label %18
18: ; preds = %15, %11
%19 = load i32, i32* %5
%20 = and i32 %19, 255
ret i32 %20
}

LLVM IR (-O2):
define i32 @testfunc1(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @random()
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = add nsw i32 %1, -1
%7 = tail call i32 @testfunc1(i8* undef, i32 %6)
br label %11
8: ; preds = %2
%9 = srem i32 %3, 1024
%10 = tail call i32 (i32 (i8*, i32)*, i32, ...) bitcast (i32 (...)* @testfunc to i32 (i32 (i8*, i32)*, i32, ...)*)(i32 (i8*, i32)* @testfunc1, i32 %9)
br label %11
11: ; preds = %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ]
%13 = and i32 %12, 255
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ InicializarAnn(char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printNeuralNet();
int main() {
  InicializarAnn("ronaldo_weights.nrl");
  printNeuralNet();
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <InicializarAnn@plt>
mov    $0x0,%al
call   1040 <printNeuralNet@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [20 x i8] c"ronaldo_weights.nrl\00"
define i32 @main() {
%1 = call i32 @InicializarAnn(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @printNeuralNet()
%3 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"ronaldo_weights.nrl\00"
define i32 @main() {
%1 = tail call i32 @InicializarAnn(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @printNeuralNet()
%3 = tail call i32 (...) @getchar()
ret i32 0
}
int test_imm_40int16_reg(short val) {
  return ((val) & (0x40 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_40int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x40,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_40int16_reg>:
test   $0x40,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_40int16_reg(i16 signext %0) {
%2 = and i16 %0, 64
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ geteuid();
int /*<<< orphan*/ pr_inf_skip(char *, char const *);
int stress_exec_supported(const char *name) {
  if (geteuid() == 0) {
    pr_inf_skip("%s stressor must not run as root, skipping the stressor\n",
                name);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stress_exec_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
cmp    $0x0,%rax
jne    1159 <stress_exec_supported+0x39>
mov    -0x10(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <pr_inf_skip@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1160 <stress_exec_supported+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_exec_supported>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %rax,%rax
jne    1148 <stress_exec_supported+0x28>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <pr_inf_skip@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [57 x i8] c"%s stressor must not run as root, skipping the stressor\0A\00"
define i32 @stress_exec_supported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @geteuid()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @pr_inf_skip(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [57 x i8] c"%s stressor must not run as root, skipping the stressor\0A\00"
define i32 @stress_exec_supported(i8* %0) {
%2 = tail call i64 (...) @geteuid()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pr_inf_skip(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
char *strrchr(char *s, int c) {
  char *res = 0;
  c = (char)c;
  while (*s) {
    if (*s == c)
      res = s;
    s++;
  }
  if (!c)
    res = s;
  return res;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1152 <strrchr+0x52>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1141 <strrchr+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strrchr+0x1c>
cmpl   $0x0,-0xc(%rbp)
jne    1164 <strrchr+0x64>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    %rdi,%rax
mov    %esi,%edi
shl    $0x18,%edi
mov    (%rax),%cl
test   %cl,%cl
je     1137 <strrchr+0x37>
movsbl %sil,%esi
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %cl,%ecx
cmp    %ecx,%esi
cmove  %rax,%rdx
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1120 <strrchr+0x20>
jmp    1139 <strrchr+0x39>
xor    %edx,%edx
test   %edi,%edi
cmovne %rdx,%rax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %7
%8 = phi i8 [ %15, %7 ], [ %5, %2 ]
%9 = phi i8* [ %13, %7 ], [ null, %2 ]
%10 = phi i8* [ %14, %7 ], [ %0, %2 ]
%11 = sext i8 %8 to i32
%12 = icmp eq i32 %4, %11
%13 = select i1 %12, i8* %10, i8* %9
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %2
%18 = phi i8* [ %0, %2 ], [ %14, %7 ]
%19 = phi i8* [ null, %2 ], [ %13, %7 ]
%20 = icmp eq i32 %3, 0
%21 = select i1 %20, i8* %18, i8* %19
ret i8* %21
}
int _kill_r(struct _reent *r, int pid, int sig) { return -1; }


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

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

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

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_kill_r(%struct._reent* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ gpio_export(int);
int gpio_init_port(void) {
  if (!gpio_export(27) && !gpio_export(17))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<gpio_init_port>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1b,%edi
call   1030 <gpio_export@plt>
cmp    $0x0,%eax
jne    114a <gpio_init_port+0x3a>
mov    $0x11,%edi
call   1030 <gpio_export@plt>
cmp    $0x0,%eax
jne    114a <gpio_init_port+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1151 <gpio_init_port+0x41>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_init_port>:
push   %rax
mov    $0x1b,%edi
call   1030 <gpio_export@plt>
test   %eax,%eax
jne    112d <gpio_init_port+0x1d>
mov    $0x11,%edi
call   1030 <gpio_export@plt>
test   %eax,%eax
je     1134 <gpio_init_port+0x24>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gpio_init_port() {
%1 = tail call i32 @gpio_export(i32 27)
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @gpio_export(i32 17)
%5 = icmp eq i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %3, %0
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %8
}
unsigned unpack_sample_rate(unsigned packed_field) {
  switch (packed_field) {
  case 0:
    return 48000;
  case 1:
    return 96000;
  case 2:
    return 192000;
  case 8:
    return 44100;
  case 9:
    return 88200;
  case 10:
    return 176400;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<unpack_sample_rate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0xa,%rax
ja     1174 <unpack_sample_rate+0x74>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xbb80,-0x4(%rbp)
jmp    117b <unpack_sample_rate+0x7b>
movl   $0x17700,-0x4(%rbp)
jmp    117b <unpack_sample_rate+0x7b>
movl   $0x2ee00,-0x4(%rbp)
jmp    117b <unpack_sample_rate+0x7b>
movl   $0xac44,-0x4(%rbp)
jmp    117b <unpack_sample_rate+0x7b>
movl   $0x15888,-0x4(%rbp)
jmp    117b <unpack_sample_rate+0x7b>
movl   $0x2b110,-0x4(%rbp)
jmp    117b <unpack_sample_rate+0x7b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unpack_sample_rate>:
xor    %eax,%eax
cmp    $0xa,%edi
ja     1114 <unpack_sample_rate+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @unpack_sample_rate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 8, label %8
i32 9, label %9
i32 10, label %10
]
5: ; preds = %1
store i32 48000, i32* %2
br label %12
6: ; preds = %1
store i32 96000, i32* %2
br label %12
7: ; preds = %1
store i32 192000, i32* %2
br label %12
8: ; preds = %1
store i32 44100, i32* %2
br label %12
9: ; preds = %1
store i32 88200, i32* %2
br label %12
10: ; preds = %1
store i32 176400, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.unpack_sample_rate = [11 x i32] [i32 48000, i32 96000, i32 192000, i32 0, i32 0, i32 0, i32 0, i32 0, i32 44100, i32 88200, i32 176400]
define i32 @unpack_sample_rate(i32 %0) {
%2 = icmp ult i32 %0, 11
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.unpack_sample_rate, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void error() {
  fprintf(stderr, "%s\n", strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rdx
lea    0xea1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb1(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@errno = global i32 0
define void @error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = call i8* @strerror(i32 %2)
%4 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@errno = global i32 0
define void @error() {
%1 = load i32, i32* @stderr
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char r, k, f;
  scanf("%c", &r);
  k = r - 'a';
  f = 'z' - k;
  printf("%c\n", f);
  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),%eax
sub    $0x61,%eax
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%ecx
mov    $0x7a,%eax
sub    %ecx,%eax
mov    %al,-0x7(%rbp)
lea    0xea5(%rip),%rdi
movsbl -0x7(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [4 x i8] c"%c\0A\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 = load i8, i8* %1
%4 = sub i8 -37, %3
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8 signext %4)
ret i32 0
}
void exit(int status) {
  asm("movl $1, %%eax\n\t"
      "movl %0, %%ebx\n\t"
      "int $0x80\n\t" ::"m"(status));
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
mov    -0x4(%rbp),%ebx
int    $0x80

x86 assembly (clang, -O2):
<exit>:
mov    %edi,-0x4(%rsp)
mov    $0x1,%eax
mov    -0x4(%rsp),%ebx
int    $0x80

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
unreachable
}
/* Variables and functions */
short USBSTK5515_I2C_write(int, unsigned char *, int);
short AIC3204_rset(unsigned short regnum, unsigned short regval) {
  unsigned char cmd[2];
  cmd[0] = regnum & 0x007F;
  cmd[1] = regval;
  return USBSTK5515_I2C_write(0x18, cmd, 2);
}


x86 assembly (clang, -O0):
<AIC3204_rset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
and    $0x7f,%eax
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%ax
mov    %al,-0x5(%rbp)
lea    -0x6(%rbp),%rsi
mov    $0x18,%edi
mov    $0x2,%edx
call   1030 <USBSTK5515_I2C_write@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AIC3204_rset>:
push   %rax
and    $0x7f,%dil
mov    %dil,0x6(%rsp)
mov    %sil,0x7(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x18,%edi
mov    $0x2,%edx
call   1030 <USBSTK5515_I2C_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @AIC3204_rset(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca [2 x i8]
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = and i32 %7, 127
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i16, i16* %4
%12 = trunc i16 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = call signext i16 @USBSTK5515_I2C_write(i32 24, i8* %14, i32 2)
ret i16 %15
}

LLVM IR (-O2):
define signext i16 @AIC3204_rset(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i16 %0 to i8
%6 = and i8 %5, 127
store i8 %6, i8* %4
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call signext i16 @USBSTK5515_I2C_write(i32 24, i8* %4, i32 2)
ret i16 %9
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ output_with_tab(char *);
gen_jump_case() {
  output_with_tab("jmp \tcccase");
  newline();
}


x86 assembly (clang, -O0):
<gen_jump_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <output_with_tab@plt>
mov    $0x0,%al
call   1030 <newline@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_jump_case>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <output_with_tab@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <newline@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"jmp \09cccase\00"
define i32 @gen_jump_case() {
%1 = alloca i32
%2 = call i32 @output_with_tab(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @newline()
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"jmp \09cccase\00"
define i32 @gen_jump_case() {
%1 = tail call i32 @output_with_tab(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @newline()
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_METHOD;
typedef void SSL_CTX;

/* Variables and functions */
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ OpenSSL_add_all_ciphers();
void *SSL_CTX_new(int /*<<< orphan*/ const *);
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
int /*<<< orphan*/ *SSLv23_client_method();
void *ssl_init(void) {
  const SSL_METHOD *method;
  SSL_CTX *ctx;
  SSL_library_init();
  SSL_load_error_strings();
  OpenSSL_add_all_algorithms();
  OpenSSL_add_all_ciphers();
  method = SSLv23_client_method();
  ctx = SSL_CTX_new(method);
  return ctx;
}


x86 assembly (clang, -O0):
<ssl_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <SSL_library_init@plt>
mov    $0x0,%al
call   1080 <SSL_load_error_strings@plt>
mov    $0x0,%al
call   1050 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1070 <OpenSSL_add_all_ciphers@plt>
mov    $0x0,%al
call   1030 <SSLv23_client_method@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <SSL_CTX_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_init>:
push   %rax
xor    %eax,%eax
call   1040 <SSL_library_init@plt>
xor    %eax,%eax
call   1080 <SSL_load_error_strings@plt>
xor    %eax,%eax
call   1050 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
call   1070 <OpenSSL_add_all_ciphers@plt>
xor    %eax,%eax
call   1030 <SSLv23_client_method@plt>
mov    %rax,%rdi
pop    %rax
jmp    1060 <SSL_CTX_new@plt>

LLVM IR (-O0):
define i8* @ssl_init() {
%1 = alloca i32*
%2 = alloca i8*
%3 = call i32 (...) @SSL_library_init()
%4 = call i32 (...) @SSL_load_error_strings()
%5 = call i32 (...) @OpenSSL_add_all_algorithms()
%6 = call i32 (...) @OpenSSL_add_all_ciphers()
%7 = call i32* (...) @SSLv23_client_method()
store i32* %7, i32** %1
%8 = load i32*, i32** %1
%9 = call i8* @SSL_CTX_new(i32* %8)
store i8* %9, i8** %2
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
define i8* @ssl_init() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @SSL_load_error_strings()
%3 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%4 = tail call i32 (...) @OpenSSL_add_all_ciphers()
%5 = tail call i32* (...) @SSLv23_client_method()
%6 = tail call i8* @SSL_CTX_new(i32* %5)
ret i8* %6
}
int power_supply_register_charger(struct power_supply *psy) { return 0; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @avcodec_decode_video2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void init_stack(void *stack, size_t *count, size_t size, size_t max_count) {
  if (stack == NULL || count == NULL)
    return;
  if (*count == 0)
    return;
  memset(stack, 0, max_count * size);
  *count = 0;
}


x86 assembly (clang, -O0):
<init_stack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <init_stack+0x2e>
cmpq   $0x0,-0x10(%rbp)
jne    1143 <init_stack+0x33>
jmp    1175 <init_stack+0x65>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1156 <init_stack+0x46>
jmp    1175 <init_stack+0x65>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_stack>:
push   %rbx
test   %rdi,%rdi
je     1139 <init_stack+0x29>
mov    %rsi,%rbx
test   %rsi,%rsi
je     1139 <init_stack+0x29>
cmpq   $0x0,(%rbx)
je     1139 <init_stack+0x29>
imul   %rdx,%rcx
xor    %esi,%esi
mov    %rcx,%rdx
call   1030 <memset@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @init_stack(i8* %0, i64* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64* %1, i64** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = load i64*, i64** %6
%13 = icmp eq i64* %12, null
br i1 %13, label %14, label %15
14: ; preds = %11, %4
br label %27
15: ; preds = %11
%16 = load i64*, i64** %6
%17 = load i64, i64* %16
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
br label %27
20: ; preds = %15
%21 = load i8*, i8** %5
%22 = load i64, i64* %8
%23 = load i64, i64* %7
%24 = mul i64 %22, %23
%25 = call i32 @memset(i8* %21, i32 0, i64 %24)
%26 = load i64*, i64** %6
store i64 0, i64* %26
br label %27
27: ; preds = %20, %19, %14
ret void
}

LLVM IR (-O2):
define void @init_stack(i8* %0, i64* %1, i64 %2, i64 %3) {
%5 = icmp eq i8* %0, null
%6 = icmp eq i64* %1, null
%7 = or i1 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %4
%9 = load i64, i64* %1
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %8
%12 = mul i64 %3, %2
%13 = tail call i32 @memset(i8* %0, i32 0, i64 %12)
store i64 0, i64* %1
br label %14
14: ; preds = %8, %4, %11
ret void
}
int is_key_value_str(const char *str) {
  if (*str == '=') {
    return 0;
  }
  while (*str != '\0' && *str != '=') {
    str++;
  }
  if (*str != '=') {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_key_value_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
jne    1124 <is_key_value_str+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1192 <is_key_value_str+0x92>
jmp    1129 <is_key_value_str+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     114e <is_key_value_str+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115e <is_key_value_str+0x5e>
jmp    116f <is_key_value_str+0x6f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1129 <is_key_value_str+0x29>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3d,%eax
je     118b <is_key_value_str+0x8b>
movl   $0x0,-0x4(%rbp)
jmp    1192 <is_key_value_str+0x92>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_key_value_str>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    $0x3d,%cl
je     112a <is_key_value_str+0x2a>
nopl   0x0(%rax)
add    $0x1,%rdi
test   %cl,%cl
je     1122 <is_key_value_str+0x22>
cmp    $0x3d,%cl
je     1122 <is_key_value_str+0x22>
movzbl (%rdi),%ecx
jmp    1110 <is_key_value_str+0x10>
xor    %eax,%eax
cmp    $0x3d,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @is_key_value_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 61
br i1 %3, label %13, label %4
4: ; preds = %1, %7
%5 = phi i8 [ %9, %7 ], [ %2, %1 ]
%6 = phi i8* [ %8, %7 ], [ %0, %1 ]
switch i8 %5, label %7 [
i8 0, label %10
i8 61, label %10
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
br label %4
10: ; preds = %4, %4
%11 = icmp eq i8 %5, 61
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %10, %1
%14 = phi i32 [ 0, %1 ], [ %12, %10 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ _DIAGASSERT(int /*<<< orphan*/);
scalar_t__ strtol(char const *, int /*<<< orphan*/ *, int);
int atoi(const char *str) {
  _DIAGASSERT(str != NULL);
  return ((int)strtol(str, NULL, 10));
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <_DIAGASSERT@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <_DIAGASSERT@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
pop    %rbx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @_DIAGASSERT(i32 %5)
%7 = load i8*, i8** %2
%8 = call i64 @strtol(i8* %7, i32* null, i32 10)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @atoi(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @_DIAGASSERT(i32 %3)
%5 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%6 = trunc i64 %5 to i32
ret i32 %6
}
double __max_double(double x, double y) { return ((x) > (y) ? (x) : (y)); }


x86 assembly (clang, -O0):
<__max_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <__max_double+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <__max_double+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__max_double>:
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @__max_double(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ glFlush();
int /*<<< orphan*/ stderr;
void Flush(void) {
  fprintf(stderr, "::flush\n");
  fflush(stderr);
  glFlush();
}


x86 assembly (clang, -O0):
<Flush>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <glFlush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Flush>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <glFlush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [9 x i8] c"::flush\0A\00"
define void @Flush() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fflush(i32 %3)
%5 = call i32 (...) @glFlush()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [9 x i8] c"::flush\0A\00"
define void @Flush() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 (...) @glFlush()
ret void
}