xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void usage_and_exit(int rc) {
  fprintf(
      stdout,
      "usage: hdoip_usbipd [OPTION...] TYPE EVDEV GDEV\n\n"
      "TYPE is either 'keyboard' or 'mouse (not in use -> should be removed)'\n"
      "EVDEV is the input event device node (/dev/input/eventN)\n"
      "GDEV is the HID gadget device node (/dev/hidgN) (not in use -> should "
      "be removed)\n\n"
      "options:\n"
      " -d, --debug     enable debugging output\n"
      " -r, --readonly  only read input events, don't forward them\n"
      " -h, --help      show this help and exit\n"
      " -V, --version   show version and exit\n");
  exit(rc);
}


x86 assembly (clang, -O0):
<usage_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage_and_exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [451 x i8] c"usage: hdoip_usbipd [OPTION...] TYPE EVDEV GDEV\0A\0ATYPE is either 'keyboard' or 'mouse (not in use -> should be removed)'\0AEVDEV is the input event device node (/dev/input/eventN)\0AGDEV is the HID gadget device node (/dev/hidgN) (not in use -> should be removed)\0A\0Aoptions:\0A -d, --debug enable debugging output\0A -r, --readonly only read input events, don't forward them\0A -h, --help show this help and exit\0A -V, --version show version and exit\0A\00"
define void @usage_and_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([451 x i8], [451 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [451 x i8] c"usage: hdoip_usbipd [OPTION...] TYPE EVDEV GDEV\0A\0ATYPE is either 'keyboard' or 'mouse (not in use -> should be removed)'\0AEVDEV is the input event device node (/dev/input/eventN)\0AGDEV is the HID gadget device node (/dev/hidgN) (not in use -> should be removed)\0A\0Aoptions:\0A -d, --debug enable debugging output\0A -r, --readonly only read input events, don't forward them\0A -h, --help show this help and exit\0A -V, --version show version and exit\0A\00"
define void @usage_and_exit(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([451 x i8], [451 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
void __setstrlen(char *s, short l) { s[l] = '\0'; }


x86 assembly (clang, -O0):
<__setstrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movswq -0xa(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setstrlen>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @__setstrlen(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i8*, i8** %3
%6 = load i16, i16* %4
%7 = sext i16 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @__setstrlen(i8* nocapture writeonly %0, i16 signext %1) {
%3 = sext i16 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __emit_expression_range(int /*<<< orphan*/, int);
void test_bitwise_binary_operators(int lhs, int rhs) {
  __emit_expression_range(0, lhs & rhs);
  __emit_expression_range(0, lhs ^ rhs);
  __emit_expression_range(0, lhs | rhs);
}


x86 assembly (clang, -O0):
<test_bitwise_binary_operators>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
and    -0x8(%rbp),%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%esi
xor    -0x8(%rbp),%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    -0x4(%rbp),%esi
or     -0x8(%rbp),%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bitwise_binary_operators>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
and    %edi,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
mov    %ebx,%esi
xor    %ebp,%esi
xor    %edi,%edi
call   1030 <__emit_expression_range@plt>
or     %ebp,%ebx
xor    %edi,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__emit_expression_range@plt>

LLVM IR (-O0):
define void @test_bitwise_binary_operators(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 = and i32 %5, %6
%8 = call i32 @__emit_expression_range(i32 0, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = xor i32 %9, %10
%12 = call i32 @__emit_expression_range(i32 0, i32 %11)
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = or i32 %13, %14
%16 = call i32 @__emit_expression_range(i32 0, i32 %15)
ret void
}

LLVM IR (-O2):
define void @test_bitwise_binary_operators(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = tail call i32 @__emit_expression_range(i32 0, i32 %3)
%5 = xor i32 %1, %0
%6 = tail call i32 @__emit_expression_range(i32 0, i32 %5)
%7 = or i32 %1, %0
%8 = tail call i32 @__emit_expression_range(i32 0, i32 %7)
ret void
}
/* Variables and functions */
int write(int, unsigned char *, int);
int put_char(int fd, unsigned char a) {
  if (write(fd, &a, 1) != 1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
je     1147 <put_char+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <put_char+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
neg    %ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @put_char(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = call i32 @write(i32 %6, i8* %5, i32 1)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %11
10: ; preds = %2
store i32 0, i32* %3
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @put_char(i32 %0, i8 zeroext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i32 %0, i8* %3, i32 1)
%5 = icmp ne i32 %4, 1
%6 = sext i1 %5 to i32
ret i32 %6
}
unsigned int unsignedint_id(unsigned int x) { return x; }


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

x86 assembly (clang, -O2):
<unsignedint_id>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @unsignedint_id(i32 returned %0) {
ret i32 %0
}
/* Type definitions */
struct bitarray {
  int dummy;
};

/* Variables and functions */
struct bitarray *cba_alloc(int /*<<< orphan*/);
int /*<<< orphan*/ cba_clear_all(struct bitarray *);
int /*<<< orphan*/ cba_free(struct bitarray *);
int /*<<< orphan*/ printf(char *);
int test_clear_all_empty(void) {
  struct bitarray *ba = NULL;
  {
    ba = cba_alloc(0);
    cba_clear_all(ba);
  }
  printf("PASSED\n");
  if (ba)
    cba_free(ba);
  return 1;
}


x86 assembly (clang, -O0):
<test_clear_all_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
xor    %edi,%edi
call   1030 <cba_alloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <cba_clear_all@plt>
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x8(%rbp)
je     1184 <test_clear_all_empty+0x44>
mov    -0x8(%rbp),%rdi
call   1050 <cba_free@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_clear_all_empty>:
push   %rbx
xor    %edi,%edi
call   1040 <cba_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <cba_clear_all@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
test   %rbx,%rbx
je     116c <test_clear_all_empty+0x2c>
mov    %rbx,%rdi
call   1050 <cba_free@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.bitarray = type { i32 }
@.str = [8 x i8] c"PASSED\0A\00"
define i32 @test_clear_all_empty() {
%1 = alloca %struct.bitarray*
store %struct.bitarray* null, %struct.bitarray** %1
%2 = call %struct.bitarray* @cba_alloc(i32 0)
store %struct.bitarray* %2, %struct.bitarray** %1
%3 = load %struct.bitarray*, %struct.bitarray** %1
%4 = call i32 @cba_clear_all(%struct.bitarray* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.bitarray*, %struct.bitarray** %1
%7 = icmp ne %struct.bitarray* %6, null
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load %struct.bitarray*, %struct.bitarray** %1
%10 = call i32 @cba_free(%struct.bitarray* %9)
br label %11
11: ; preds = %8, %0
ret i32 1
}

LLVM IR (-O2):
%struct.bitarray = type { i32 }
@str = [7 x i8] c"PASSED\00"
define i32 @test_clear_all_empty() {
%1 = tail call %struct.bitarray* @cba_alloc(i32 0)
%2 = tail call i32 @cba_clear_all(%struct.bitarray* %1)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%4 = icmp eq %struct.bitarray* %1, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = tail call i32 @cba_free(%struct.bitarray* %1)
br label %7
7: ; preds = %5, %0
ret i32 1
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dnanmin(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  double v = stdlib_strided_dnanmin(N, x, stride);
  printf("min: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x54(%rbp)
movl   $0x2,-0x58(%rbp)
mov    -0x54(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%edx
call   1040 <stdlib_strided_dnanmin@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dnanmin@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 0x7FF8000000000000, double 0x7FF8000000000000]
@.str = [10 x i8] c"min: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [10 x double]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dnanmin(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 0x7FF8000000000000, double 0x7FF8000000000000]
@.str = [10 x i8] c"min: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = bitcast [10 x double]* %1 to i8*
%3 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dnanmin(i32 5, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
unsigned long hash(const char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = sext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ die_if_null(char *);
char *strdup(char const *);
char *xstrdup(const char *s) {
  char *t;
  if (s == NULL)
    return NULL;
  t = strdup(s);
  die_if_null(t);
  return t;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <xstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1162 <xstrdup+0x42>
mov    -0x10(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <die_if_null@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %rbx
test   %rdi,%rdi
je     1138 <xstrdup+0x18>
call   1040 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <die_if_null@plt>
jmp    113a <xstrdup+0x1a>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = call i32 @die_if_null(i8* %11)
%13 = load i8*, i8** %4
store i8* %13, i8** %2
br label %14
14: ; preds = %8, %7
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @strdup(i8* %0)
%5 = tail call i32 @die_if_null(i8* %4)
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %7
}
int ADC_leeRxRAM() {
  int dato1, dato2, datoLeido;
  *((volatile unsigned short *)(0x10000000 + 0x00B0)) = 0x10;
  *((volatile unsigned short *)(0x10000000 + 0x00B4));
  dato1 = *((volatile unsigned short *)(0x10000000 + 0x00B4));
  dato2 = *((volatile unsigned short *)(0x10000000 + 0x00B4));
  datoLeido = dato2 >> 3;
  datoLeido += dato1 << 5;
  return datoLeido;
}


x86 assembly (clang, -O0):
<ADC_leeRxRAM>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100000b0,%eax
movw   $0x10,(%rax)
mov    $0x100000b4,%eax
mov    (%rax),%ax
mov    $0x100000b4,%eax
mov    (%rax),%ax
movzwl %ax,%eax
mov    %eax,-0x4(%rbp)
mov    $0x100000b4,%eax
mov    (%rax),%ax
movzwl %ax,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_leeRxRAM>:
movw   $0x10,0x100000b0
movzwl 0x100000b4,%eax
10
movzwl 0x100000b4,%eax
10
movzwl 0x100000b4,%ecx
10
shr    $0x3,%ecx
shl    $0x5,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ADC_leeRxRAM() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store volatile i16 16, i16* inttoptr (i64 268435632 to i16*)
%4 = load volatile i16, i16* inttoptr (i64 268435636 to i16*)
%5 = load volatile i16, i16* inttoptr (i64 268435636 to i16*)
%6 = zext i16 %5 to i32
store i32 %6, i32* %1
%7 = load volatile i16, i16* inttoptr (i64 268435636 to i16*)
%8 = zext i16 %7 to i32
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 3
store i32 %10, i32* %3
%11 = load i32, i32* %1
%12 = shl i32 %11, 5
%13 = load i32, i32* %3
%14 = add nsw i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @ADC_leeRxRAM() {
store volatile i16 16, i16* inttoptr (i64 268435632 to i16*)
%1 = load volatile i16, i16* inttoptr (i64 268435636 to i16*)
%2 = load volatile i16, i16* inttoptr (i64 268435636 to i16*)
%3 = zext i16 %2 to i32
%4 = load volatile i16, i16* inttoptr (i64 268435636 to i16*)
%5 = lshr i16 %4, 3
%6 = zext i16 %5 to i32
%7 = shl nuw nsw i32 %3, 5
%8 = add nuw nsw i32 %7, %6
ret i32 %8
}
/* Type definitions */
struct circular_buffer {
  int dummy;
};

/* Variables and functions */
int _available_space(struct circular_buffer *);
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ lock(struct circular_buffer *);
int /*<<< orphan*/ unlock(struct circular_buffer *);
int cb_available_space(struct circular_buffer *buffer) {
  int available = 0;
  lock(buffer);
  available = _available_space(buffer);
  unlock(buffer);
  assert(available >= 0);
  return available;
}


x86 assembly (clang, -O0):
<cb_available_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lock@plt>
mov    -0x8(%rbp),%rdi
call   1050 <_available_space@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlock@plt>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cb_available_space>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <lock@plt>
mov    %rbx,%rdi
call   1050 <_available_space@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <unlock@plt>
mov    %ebp,%edi
not    %edi
shr    $0x1f,%edi
call   1060 <assert@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.circular_buffer = type { i32 }
define i32 @cb_available_space(%struct.circular_buffer* %0) {
%2 = alloca %struct.circular_buffer*
%3 = alloca i32
store %struct.circular_buffer* %0, %struct.circular_buffer** %2
store i32 0, i32* %3
%4 = load %struct.circular_buffer*, %struct.circular_buffer** %2
%5 = call i32 @lock(%struct.circular_buffer* %4)
%6 = load %struct.circular_buffer*, %struct.circular_buffer** %2
%7 = call i32 @_available_space(%struct.circular_buffer* %6)
store i32 %7, i32* %3
%8 = load %struct.circular_buffer*, %struct.circular_buffer** %2
%9 = call i32 @unlock(%struct.circular_buffer* %8)
%10 = load i32, i32* %3
%11 = icmp sge i32 %10, 0
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.circular_buffer = type { i32 }
define i32 @cb_available_space(%struct.circular_buffer* %0) {
%2 = tail call i32 @lock(%struct.circular_buffer* %0)
%3 = tail call i32 @_available_space(%struct.circular_buffer* %0)
%4 = tail call i32 @unlock(%struct.circular_buffer* %0)
%5 = xor i32 %3, -1
%6 = lshr i32 %5, 31
%7 = tail call i32 @assert(i32 %6)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
void strcpy(const char *dest, const char *src) {
  int srclen = strlen(src);
  memcpy((char *)dest, src, srclen + 1);
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%edx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 1
%12 = call i32 @memcpy(i8* %8, i8* %9, i32 %11)
ret void
}

LLVM IR (-O2):
define void @strcpy(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = add nsw i32 %3, 1
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}
void fa(int *y) {
  char x;
  asm(""
      : "=@cc"
        "a"(x));
  if (!x)
    *y = 0;
}


x86 assembly (clang, -O0):
<fa>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
seta   %al
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
jne    1122 <fa+0x22>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fa>:
jbe    1103 <fa+0x3>
ret
movl   $0x0,(%rdi)
ret

LLVM IR (-O0):
define void @fa(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
%4 = call i8 asm "", "={@cca},~{dirflag},~{fpsr},~{flags}"()
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = icmp ne i8 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = load i32*, i32** %2
store i32 0, i32* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @fa(i32* nocapture writeonly %0) {
%2 = tail call i8 asm "", "={@cca},~{dirflag},~{fpsr},~{flags}"()
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 0, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
double pow(double, int);
double ThirdP(double Input) {
  double Third;
  Third = pow(Input, 3);
  return Third;
}


x86 assembly (clang, -O0):
<ThirdP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThirdP>:
mov    $0x3,%edi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @ThirdP(double %0) {
%2 = tail call double @pow(double %0, i32 3)
ret double %2
}
/* Variables and functions */
scalar_t__ getTable(char const *);
int lou_checkTable(const char *tableList) {
  if (getTable(tableList))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<lou_checkTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getTable@plt>
cmp    $0x0,%rax
je     113b <lou_checkTable+0x2b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <lou_checkTable+0x32>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lou_checkTable>:
push   %rax
call   1030 <getTable@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @lou_checkTable(i8* %0) {
%2 = tail call i64 @getTable(i8* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ halt();
int main() { halt(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @halt()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @halt()
ret i32 0
}
/* Variables and functions */
int erf(double);
double sqrt(int);
double pnorm(double x) { return 0.5 * (1 + erf(x / sqrt(2))); }


x86 assembly (clang, -O0):
<pnorm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
call   1040 <erf@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xe9f(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pnorm>:
push   %rax
movsd  %xmm0,(%rsp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1040 <erf@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xeac(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @pnorm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(i32 2)
%5 = fdiv double %3, %4
%6 = call i32 @erf(double %5)
%7 = add nsw i32 1, %6
%8 = sitofp i32 %7 to double
%9 = fmul double 5.000000e-01, %8
ret double %9
}

LLVM IR (-O2):
define double @pnorm(double %0) {
%2 = tail call double @sqrt(i32 2)
%3 = fdiv double %0, %2
%4 = tail call i32 @erf(double %3)
%5 = add nsw i32 %4, 1
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 5.000000e-01
ret double %7
}
void rop3_137_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  unsigned char stk4;
  stk4 = ~S;
  stk3 = T & stk4;
  stk2 = *D | stk3;
  stk1 = S ^ stk2;
  stk1 = ~stk1;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_137_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xe(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xe(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_137_0_0>:
mov    %esi,%eax
not    %al
and    %dl,%al
or     (%rdi),%al
xor    %sil,%al
not    %al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_137_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %10
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = load i8, i8* %9
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %8
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = load i8, i8* %8
%31 = zext i8 %30 to i32
%32 = xor i32 %29, %31
%33 = trunc i32 %32 to i8
store i8 %33, i8* %7
%34 = load i8, i8* %7
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = trunc i32 %36 to i8
store i8 %37, i8* %7
%38 = load i8, i8* %7
%39 = load i8*, i8** %4
store i8 %38, i8* %39
ret void
}

LLVM IR (-O2):
define void @rop3_137_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = and i8 %4, %2
%6 = load i8, i8* %0
%7 = or i8 %6, %5
%8 = xor i8 %7, %1
%9 = xor i8 %8, -1
store i8 %9, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *link_malloc() { return (char *)malloc(1); }


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

x86 assembly (clang, -O2):
<link_malloc>:
mov    $0x1,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @link_malloc() {
%1 = call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @link_malloc() {
%1 = tail call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
void swap(int a[], int i, int j) {
  int t;
  t = a[i];
  a[i] = a[j];
  a[j] = t;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
int implver();
int /*<<< orphan*/ printf(char *, int);
void get_subarchitecture(void) { printf("ev%d", implver() + 4); }


x86 assembly (clang, -O0):
<get_subarchitecture>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <implver@plt>
mov    %eax,%esi
add    $0x4,%esi
lea    0xec9(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_subarchitecture>:
push   %rax
xor    %eax,%eax
call   1030 <implver@plt>
lea    0x4(%rax),%esi
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"ev%d\00"
define void @get_subarchitecture() {
%1 = call i32 (...) @implver()
%2 = add nsw i32 %1, 4
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"ev%d\00"
define void @get_subarchitecture() {
%1 = tail call i32 (...) @implver()
%2 = add nsw i32 %1, 4
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_thread_flag(int);
int /*<<< orphan*/ sleep(int);
void *my_func() {
  while (1) {
    set_thread_flag(0);
    sleep(1);
    set_thread_flag(1);
  }
}


x86 assembly (clang, -O0):
<my_func>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <my_func+0x9>
xor    %edi,%edi
call   1030 <set_thread_flag@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
call   1030 <set_thread_flag@plt>
jmp    1129 <my_func+0x9>

x86 assembly (clang, -O2):
<my_func>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   1030 <set_thread_flag@plt>
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    $0x1,%edi
call   1030 <set_thread_flag@plt>
jmp    1130 <my_func+0x10>

LLVM IR (-O0):
define i8* @my_func() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @set_thread_flag(i32 0)
%3 = call i32 @sleep(i32 1)
%4 = call i32 @set_thread_flag(i32 1)
br label %1
}

LLVM IR (-O2):
define noalias i8* @my_func() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @set_thread_flag(i32 0)
%3 = tail call i32 @sleep(i32 1)
%4 = tail call i32 @set_thread_flag(i32 1)
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned short, int /*<<< orphan*/ *);
void fputw(unsigned short s, FILE *fp) {
  fputc(s >> 8, fp);
  fputc(s & 0xff, fp);
}


x86 assembly (clang, -O0):
<fputw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <fputc@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    -0x10(%rbp),%rsi
movzwl %ax,%edi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputw>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
shr    $0x8,%edi
call   1030 <fputc@plt>
movzbl %bpl,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fputw(i16 zeroext %0, i32* %1) {
%3 = alloca i16
%4 = alloca i32*
store i16 %0, i16* %3
store i32* %1, i32** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i16
%9 = load i32*, i32** %4
%10 = call i32 @fputc(i16 zeroext %8, i32* %9)
%11 = load i16, i16* %3
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i16
%15 = load i32*, i32** %4
%16 = call i32 @fputc(i16 zeroext %14, i32* %15)
ret void
}

LLVM IR (-O2):
define void @fputw(i16 zeroext %0, i32* nocapture %1) {
%3 = lshr i16 %0, 8
%4 = tail call i32 @fputc(i16 zeroext %3, i32* %1)
%5 = and i16 %0, 255
%6 = tail call i32 @fputc(i16 zeroext %5, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flash_writecommand(int, int);
void flash_softwareexit() {
  flash_writecommand(0x5555, 0xAA);
  flash_writecommand(0x2AAA, 0x55);
  flash_writecommand(0x5555, 0xF0);
}


x86 assembly (clang, -O0):
<flash_softwareexit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1030 <flash_writecommand@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1030 <flash_writecommand@plt>
mov    $0x5555,%edi
mov    $0xf0,%esi
call   1030 <flash_writecommand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_softwareexit>:
push   %rax
mov    $0x5555,%edi
mov    $0xaa,%esi
call   1030 <flash_writecommand@plt>
mov    $0x2aaa,%edi
mov    $0x55,%esi
call   1030 <flash_writecommand@plt>
mov    $0x5555,%edi
mov    $0xf0,%esi
pop    %rax
jmp    1030 <flash_writecommand@plt>

LLVM IR (-O0):
define void @flash_softwareexit() {
%1 = call i32 @flash_writecommand(i32 21845, i32 170)
%2 = call i32 @flash_writecommand(i32 10922, i32 85)
%3 = call i32 @flash_writecommand(i32 21845, i32 240)
ret void
}

LLVM IR (-O2):
define void @flash_softwareexit() {
%1 = tail call i32 @flash_writecommand(i32 21845, i32 170)
%2 = tail call i32 @flash_writecommand(i32 10922, i32 85)
%3 = tail call i32 @flash_writecommand(i32 21845, i32 240)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move(int, int);
void term_move(size_t y, size_t x) { move((int)y, (int)x); }


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

x86 assembly (clang, -O2):
<term_move>:
jmp    1030 <move@plt>

LLVM IR (-O0):
define void @term_move(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = call i32 @move(i32 %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @term_move(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = tail call i32 @move(i32 %3, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_char(int /*<<< orphan*/);
int /*<<< orphan*/ update_cursor();
void print_str(char *str) {
  while (*str != '\0') {
    print_char(*(str++));
  }
  update_cursor();
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1158 <print_str+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1040 <print_char@plt>
jmp    112c <print_str+0xc>
mov    $0x0,%al
call   1030 <update_cursor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1143 <print_str+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1040 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_str+0x10>
xor    %eax,%eax
pop    %rbx
jmp    1030 <update_cursor@plt>

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

LLVM IR (-O2):
define void @print_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = tail call i32 @print_char(i32 %7)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = tail call i32 (...) @update_cursor()
ret void
}
/* Variables and functions */
double cbrt(double);
double linear_to_Lab_L(double t) {
  const double thr = 6. / 29., thr3 = thr * thr * thr;
  if (t > thr3)
    t = cbrt(t);
  else
    t = t * (841. / 108.) + 4. / 29.;
  return 1.16 * t - 0.16;
}


x86 assembly (clang, -O0):
<linear_to_Lab_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1162 <linear_to_Lab_L+0x52>
movsd  -0x8(%rbp),%xmm0
call   1030 <cbrt@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1184 <linear_to_Lab_L+0x74>
movsd  -0x8(%rbp),%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe9d(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8b(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linear_to_Lab_L>:
push   %rax
ucomisd 0xee7(%rip),%xmm0
jbe    1122 <linear_to_Lab_L+0x12>
call   1030 <cbrt@plt>
jmp    1132 <linear_to_Lab_L+0x22>
mulsd  0xede(%rip),%xmm0
addsd  0xede(%rip),%xmm0
mulsd  0xede(%rip),%xmm0
addsd  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @linear_to_Lab_L(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
store double 0x3FCA7B9611A7B961, double* %3
store double 0x3F822354D28F7CD6, double* %4
%5 = load double, double* %2
%6 = fcmp ogt double %5, 0x3F822354D28F7CD6
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load double, double* %2
%9 = call double @cbrt(double %8)
store double %9, double* %2
br label %13
10: ; preds = %1
%11 = load double, double* %2
%12 = call double @llvm.fmuladd.f64(double %11, double 0x401F25ED097B425F, double 0x3FC1A7B9611A7B96)
store double %12, double* %2
br label %13
13: ; preds = %10, %7
%14 = load double, double* %2
%15 = call double @llvm.fmuladd.f64(double 1.160000e+00, double %14, double -1.600000e-01)
ret double %15
}

LLVM IR (-O2):
define double @linear_to_Lab_L(double %0) {
%2 = fcmp ogt double %0, 0x3F822354D28F7CD6
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @cbrt(double %0)
br label %7
5: ; preds = %1
%6 = tail call double @llvm.fmuladd.f64(double %0, double 0x401F25ED097B425F, double 0x3FC1A7B9611A7B96)
br label %7
7: ; preds = %5, %3
%8 = phi double [ %4, %3 ], [ %6, %5 ]
%9 = tail call double @llvm.fmuladd.f64(double %8, double 1.160000e+00, double -1.600000e-01)
ret double %9
}
double cos_interpolate(double a, double b, double co) {
  double f = (1.0 - co) * 0.5;
  return a * (1.0 - f) + b * f;
}


x86 assembly (clang, -O0):
<cos_interpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec2(%rip),%xmm2
subsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cos_interpolate>:
movsd  0xef8(%rip),%xmm3
movapd %xmm3,%xmm4
subsd  %xmm2,%xmm4
mulsd  0xef0(%rip),%xmm4
subsd  %xmm4,%xmm3
mulsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
ret

LLVM IR (-O0):
define double @cos_interpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = fsub double 1.000000e+00, %8
%10 = fmul double %9, 5.000000e-01
store double %10, double* %7
%11 = load double, double* %4
%12 = load double, double* %7
%13 = fsub double 1.000000e+00, %12
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fmul double %14, %15
%17 = call double @llvm.fmuladd.f64(double %11, double %13, double %16)
ret double %17
}

LLVM IR (-O2):
define double @cos_interpolate(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = fmul double %4, 5.000000e-01
%6 = fsub double 1.000000e+00, %5
%7 = fmul double %5, %1
%8 = tail call double @llvm.fmuladd.f64(double %0, double %6, double %7)
ret double %8
}
/* Variables and functions */
int M_PI;
double other(double f, double x) { return 1.0 / (2 * M_PI * f * x); }


x86 assembly (clang, -O0):
<other>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xed0(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<other>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  0xee1(%rip),%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define double @other(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @M_PI
%6 = mul nsw i32 2, %5
%7 = sitofp i32 %6 to double
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = fdiv double 1.000000e+00, %11
ret double %12
}

LLVM IR (-O2):
@M_PI = global i32 0
define double @other(double %0, double %1) {
%3 = load i32, i32* @M_PI
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, %0
%7 = fmul double %6, %1
%8 = fdiv double 1.000000e+00, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
char **handle_switch_G(char *arg, char **next) {
  if (!strcmp(arg, "G") && *next)
    return next + 1;
  else
    return next;
}


x86 assembly (clang, -O0):
<handle_switch_G>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1158 <handle_switch_G+0x48>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     1158 <handle_switch_G+0x48>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <handle_switch_G+0x50>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_switch_G>:
push   %rbx
mov    %rsi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jne    1131 <handle_switch_G+0x21>
xor    %eax,%eax
cmpq   $0x0,(%rbx)
setne  %al
lea    (%rbx,%rax,8),%rbx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"G\00"
define i8** @handle_switch_G(i8* nocapture %0, i8** %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i64
%9 = getelementptr i8*, i8** %1, i64 %8
br label %10
10: ; preds = %5, %2
%11 = phi i8** [ %1, %2 ], [ %9, %5 ]
ret i8** %11
}