xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ puts(char *);
int tty_fix();
void int_handler() {
  if (tty_fix() == -1) {
    perror("ERROR on restoring tty");
    exit(EXIT_FAILURE);
  }
  puts("Interuption caught");
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<int_handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <tty_fix@plt>
cmp    $0xffffffff,%eax
jne    116e <int_handler+0x2e>
lea    0xea5(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<int_handler>:
push   %rax
xor    %eax,%eax
call   1040 <tty_fix@plt>
cmp    $0xffffffff,%eax
jne    1167 <int_handler+0x27>
lea    0xeac(%rip),%rdi
call   1050 <perror@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"ERROR on restoring tty\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [19 x i8] c"Interuption caught\00"
@EXIT_SUCCESS = global i32 0
define void @int_handler() {
%1 = call i32 (...) @tty_fix()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [23 x i8] c"ERROR on restoring tty\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [19 x i8] c"Interuption caught\00"
@EXIT_SUCCESS = global i32 0
define void @int_handler() {
%1 = tail call i32 (...) @tty_fix()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %0
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 <= 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @main() {
ret void
}
int produceReturnValueThree(a, b)
int a;
int b;
{ return a + b; }


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

x86 assembly (clang, -O2):
<produceReturnValueThree>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @produceReturnValueThree(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
struct state {
  int dummy;
};

/* Variables and functions */
scalar_t__ read_bit(struct state *);
unsigned read_number(struct state *state, unsigned bits) {
  unsigned i;
  unsigned ret = 0;
  for (i = 0; i < bits; ++i)
    ret = (ret << 1) | (read_bit(state) ? 1 : 0);
  return ret;
}


x86 assembly (clang, -O0):
<read_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1172 <read_number+0x62>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_bit@plt>
mov    %rax,%rsi
mov    -0x18(%rbp),%eax
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%rsi
cmovne %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <read_number+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_number>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     113a <read_number+0x2a>
mov    %esi,%ebp
mov    %rdi,%r14
xor    %ebx,%ebx
nop
mov    %r14,%rdi
call   1030 <read_bit@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rbx,2),%ebx
add    $0xffffffff,%ebp
jne    1120 <read_number+0x10>
jmp    113c <read_number+0x2c>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.state = type { i32 }
define i32 @read_number(%struct.state* %0, i32 %1) {
%3 = alloca %struct.state*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.state* %0, %struct.state** %3
store i32 %1, i32* %4
store i32 0, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32, i32* %6
%13 = shl i32 %12, 1
%14 = load %struct.state*, %struct.state** %3
%15 = call i64 @read_bit(%struct.state* %14)
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
%19 = or i32 %13, %18
store i32 %19, i32* %6
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
%24 = load i32, i32* %6
ret i32 %24
}

LLVM IR (-O2):
%struct.state = type { i32 }
define i32 @read_number(%struct.state* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %12, %4 ], [ 0, %2 ]
%7 = shl i32 %5, 1
%8 = tail call i64 @read_bit(%struct.state* %0)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = or i32 %7, %10
%12 = add nuw i32 %6, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("ed2ksum - compute and print ed2k links for files\n\n"
         "options:\n"
         "  -h         print this message\n"
         "  -V         print version information\n"
         "  -r         print only hash value\n");
}


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

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

LLVM IR (-O0):
@.str = [166 x i8] c"ed2ksum - compute and print ed2k links for files\0A\0Aoptions:\0A -h print this message\0A -V print version information\0A -r print only hash value\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [165 x i8] c"ed2ksum - compute and print ed2k links for files\0A\0Aoptions:\0A -h print this message\0A -V print version information\0A -r print only hash value\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([165 x i8], [165 x i8]* @str, i64 0, i64 0))
ret void
}
unsigned int ht_calc_hash(char *key) {
  unsigned int h = 5381;
  while (*(key++))
    h = ((h << 5) + h) + (*key);
  return h;
}


x86 assembly (clang, -O0):
<ht_calc_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1141 <ht_calc_hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ht_calc_hash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_calc_hash>:
cmpb   $0x0,(%rdi)
je     1125 <ht_calc_hash+0x25>
add    $0x1,%rdi
mov    $0x1505,%ecx
mov    %ecx,%eax
shl    $0x5,%eax
add    %ecx,%eax
movsbl (%rdi),%edx
add    %edx,%eax
add    $0x1,%rdi
mov    %eax,%ecx
test   %edx,%edx
jne    1110 <ht_calc_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @ht_calc_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = mul i32 %6, 33
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = add i32 %8, %10
%12 = icmp eq i8 %9, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %14
}
int test_imm_26int32_mem(int *val) {
  return ((*val) & (0x26 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_26int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 38
%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_26int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 38
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C "
         "and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or "
         "MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
         "MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C "
         "and/or MBEDTLS_PEM_PARSE_C not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [256 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_PEM_PARSE_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [255 x i8] c"MBEDTLS_BIGNUM_C and/or MBEDTLS_CERTS_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_SRV_C and/or MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_PEM_PARSE_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([255 x i8], [255 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned short GetDS(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i16 @GetDS() {
ret i16 0
}

LLVM IR (-O2):
define zeroext i16 @GetDS() {
ret i16 0
}
void fn_att_1_default(void) {}


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

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

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

LLVM IR (-O2):
define void @fn_att_1_default() {
ret void
}
void serial_close() {}


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

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

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

LLVM IR (-O2):
define void @serial_close() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int rotl32(int, int);
uint32_t hash32_mix_tail(uint32_t x, uint32_t y) {
  x = rotl32(x * 0xcc9e2d51, 15) * 0x1b873593;
  return y ^ x;
}


x86 assembly (clang, -O0):
<hash32_mix_tail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0xcc9e2d51,-0x4(%rbp),%edi
mov    $0xf,%esi
call   1030 <rotl32@plt>
imul   $0x1b873593,%eax,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash32_mix_tail>:
push   %rbx
mov    %esi,%ebx
imul   $0xcc9e2d51,%edi,%edi
mov    $0xf,%esi
call   1030 <rotl32@plt>
imul   $0x1b873593,%eax,%eax
xor    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hash32_mix_tail(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 = mul i32 %5, -862048943
%7 = call i32 @rotl32(i32 %6, i32 15)
%8 = mul nsw i32 %7, 461845907
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @hash32_mix_tail(i32 %0, i32 %1) {
%3 = mul i32 %0, -862048943
%4 = tail call i32 @rotl32(i32 %3, i32 15)
%5 = mul nsw i32 %4, 461845907
%6 = xor i32 %5, %1
ret i32 %6
}
/* Variables and functions */
int fdatasync(int);
int full_fsync(int fd, int fullSync, int dataOnly) {
  int rc;
  (void)(fullSync);
  (void)(dataOnly);
  rc = fdatasync(fd);
  return rc;
}


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

x86 assembly (clang, -O2):
<full_fsync>:
jmp    1030 <fdatasync@plt>

LLVM IR (-O0):
define i32 @full_fsync(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* %5
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = call i32 @fdatasync(i32 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
define i32 @full_fsync(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @fdatasync(i32 %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ test_1();
int main(int argc, char *argv[]) {
  assert(test_1());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <test_1@plt>
mov    %eax,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_1()
%7 = call i32 @assert(i32 %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_1()
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int stueckzahl_eingabe() {
  int userInput;
  printf("Please insert count of product:\n");
  scanf("%i", &userInput);
  return userInput;
}


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

x86 assembly (clang, -O2):
<stueckzahl_eingabe>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Please insert count of product:\0A\00"
@.str.1 = [3 x i8] c"%i\00"
define i32 @stueckzahl_eingabe() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%i\00"
@str = [32 x i8] c"Please insert count of product:\00"
define i32 @stueckzahl_eingabe() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
void foo_1_1_1_2_2_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_2_1_1_2_2() {
ret void
}
void free_explode(char **table) {
  if (!table)
    return;
  free(*table);
  free(table);
}


x86 assembly (clang, -O0):
<free_explode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <free_explode+0x1c>
jmp    1141 <free_explode+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_explode>:
test   %rdi,%rdi
je     112a <free_explode+0x1a>
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @free_explode(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = icmp ne i8** %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %2
%10 = bitcast i8** %9 to i8*
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @free_explode(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
tail call void @free(i8* %4)
%5 = bitcast i8** %0 to i8*
tail call void @free(i8* %5)
br label %6
6: ; preds = %1, %3
ret void
}
char *strcpy(char *dest, const char *src) {
  {};
  {};
  char c;
  while ((c = *src) != '\0') {
    *dest = c;
    ++dest;
    ++src;
  }
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <strcpy+0x47>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcpy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcpy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %9, %5 ]
ret i8* %14
}
/* Variables and functions */
scalar_t__ ilogb(double);
double scalb(double, double);
double significand(double x) { return scalb(x, (double)-ilogb(x)); }


x86 assembly (clang, -O0):
<significand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <ilogb@plt>
movsd  -0x10(%rbp),%xmm0
mov    %rax,%rcx
xor    %eax,%eax
sub    %rcx,%rax
cvtsi2sd %rax,%xmm1
call   1030 <scalb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<significand>:
push   %rax
movsd  %xmm0,(%rsp)
call   1040 <ilogb@plt>
neg    %rax
cvtsi2sd %rax,%xmm1
movsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <scalb@plt>

LLVM IR (-O0):
define double @significand(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call i64 @ilogb(double %4)
%6 = sub nsw i64 0, %5
%7 = sitofp i64 %6 to double
%8 = call double @scalb(double %3, double %7)
ret double %8
}

LLVM IR (-O2):
define double @significand(double %0) {
%2 = tail call i64 @ilogb(double %0)
%3 = sub nsw i64 0, %2
%4 = sitofp i64 %3 to double
%5 = tail call double @scalb(double %0, double %4)
ret double %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int write_byte(FILE *f, int value) {
  unsigned char buff[1];
  buff[0] = (unsigned char)value;
  return fwrite(buff, 1, 1, f);
}


x86 assembly (clang, -O0):
<write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_byte>:
push   %rax
mov    %rdi,%rcx
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <fwrite@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @write_byte(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [1 x i8]
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %3
%11 = call i32 @fwrite(i8* %9, i32 1, i32 1, i32* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @write_byte(i32* nocapture %0, i32 %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = call i32 @fwrite(i8* %4, i32 1, i32 1, i32* %0)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
char *null_array_SINT8(int8_t *arr) {
  if (arr == NULL) {
    return "null";
  } else {
    return "non_null";
  }
}


x86 assembly (clang, -O0):
<null_array_SINT8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <null_array_SINT8+0x23>
lea    0xeea(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112e <null_array_SINT8+0x2e>
lea    0xed6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<null_array_SINT8>:
test   %rdi,%rdi
lea    0xefa(%rip),%rcx
lea    0xeef(%rip),%rax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_SINT8(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"null\00"
@.str.1 = [9 x i8] c"non_null\00"
define i8* @null_array_SINT8(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
ret i8* %3
}
int topi(int i, int j, int n) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @topi(i32 returned %0, i32 %1, i32 %2) {
ret i32 %0
}
int main(void) {
  int a;
  int b;
  int *c;
  for (a = 11; a < 50; a++) {
    for (b = 8; b < 50; b += 5) {
      c[a + 5] = 5;
      c[b] = 6;
      a += 2;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jge    117a <main+0x7a>
movl   $0x8,-0xc(%rbp)
cmpl   $0x32,-0xc(%rbp)
jge    1167 <main+0x67>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    $0x5,%ecx
movslq %ecx,%rcx
movl   $0x5,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x6,(%rax,%rcx,4)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
jmp    116c <main+0x6c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 0, i32* %1
store i32 11, i32* %2
br label %5
5: ; preds = %28, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 50
br i1 %7, label %8, label %31
8: ; preds = %5
store i32 8, i32* %3
br label %9
9: ; preds = %24, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
store i32 5, i32* %17
%18 = load i32*, i32** %4
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 6, i32* %21
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 2
store i32 %23, i32* %2
br label %24
24: ; preds = %12
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 5
store i32 %26, i32* %3
br label %9
27: ; preds = %9
br label %28
28: ; preds = %27
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
br label %5
31: ; preds = %5
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ absexpres();
int /*<<< orphan*/ getsym();
void symabsexpres(void) {
  getsym();
  absexpres();
}


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

x86 assembly (clang, -O2):
<symabsexpres>:
push   %rax
xor    %eax,%eax
call   1040 <getsym@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <absexpres@plt>

LLVM IR (-O0):
define void @symabsexpres() {
%1 = call i32 (...) @getsym()
%2 = call i32 (...) @absexpres()
ret void
}

LLVM IR (-O2):
define void @symabsexpres() {
%1 = tail call i32 (...) @getsym()
%2 = tail call i32 (...) @absexpres()
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void main() {
  int32_t a;
  a = 1 + 2 * 4 - 4 / 2 + 3 % 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x8,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 8, i32* %1
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void buggy_copy_int(int val, void *buf, int maxbytes) {
  if (maxbytes - sizeof(val) >= 0)
    memcpy(buf, (void *)&val, sizeof(val));
}


x86 assembly (clang, -O0):
<buggy_copy_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
sub    $0x4,%rax
cmp    $0x0,%rax
jb     1146 <buggy_copy_int+0x36>
mov    -0x10(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buggy_copy_int>:
push   %rax
mov    %rsi,%rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @buggy_copy_int(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = sub i64 %8, 4
%10 = icmp uge i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = bitcast i32* %4 to i8*
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 4)
br label %15
15: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @buggy_copy_int(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = bitcast i32* %4 to i8*
%6 = call i32 @memcpy(i8* %1, i8* %5, i32 4)
ret void
}
long long internal_sign_l(long long value) {
  return (value >= 0 ? (value == 0 ? 0 : 1) : -1);
}


x86 assembly (clang, -O0):
<internal_sign_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jl     112d <internal_sign_l+0x2d>
mov    -0x8(%rbp),%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <internal_sign_l+0x3a>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <internal_sign_l+0x3a>
mov    -0xc(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_sign_l>:
xor    %ecx,%ecx
test   %rdi,%rdi
setne  %cl
mov    $0xffffffffffffffff,%rax
cmovns %rcx,%rax
ret

LLVM IR (-O0):
define i64 @internal_sign_l(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sge i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi i32 [ %9, %5 ], [ -1, %10 ]
%13 = sext i32 %12 to i64
ret i64 %13
}

LLVM IR (-O2):
define i64 @internal_sign_l(i64 %0) {
%2 = icmp sgt i64 %0, -1
%3 = icmp ne i64 %0, 0
%4 = zext i1 %3 to i64
%5 = select i1 %2, i64 %4, i64 -1
ret i64 %5
}
void PIOA_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<PIOA_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <PIOA_IRQHandler+0x9>
jmp    1109 <PIOA_IRQHandler+0x9>

x86 assembly (clang, -O2):
<PIOA_IRQHandler>:
jmp    1100 <PIOA_IRQHandler>

LLVM IR (-O0):
define void @PIOA_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @PIOA_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ RTC_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void RTC_IRQHandler(void) {
  RTC_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @RTC_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @RTC_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @RTC_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @RTC_DriverIRQHandler()
ret void
}
void swap(int *l, int *r) {
  *l ^= *r;
  *r ^= *l;
  *l ^= *r;
}


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

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

LLVM IR (-O0):
define void @swap(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = xor i32 %8, %6
store i32 %9, i32* %7
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = xor i32 %13, %11
store i32 %14, i32* %12
%15 = load i32*, i32** %4
%16 = load i32, i32* %15
%17 = load i32*, i32** %3
%18 = load i32, i32* %17
%19 = xor i32 %18, %16
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = xor i32 %4, %3
store i32 %5, i32* %0
%6 = load i32, i32* %1
%7 = xor i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %0
%9 = xor i32 %8, %7
store i32 %9, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int cv_socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int socket_create_stream() { return cv_socket(AF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<socket_create_stream>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <cv_socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_create_stream>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <cv_socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_create_stream() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @cv_socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define i32 @socket_create_stream() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @cv_socket(i32 %1, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void header() {
  fprintf(stdout, "\n\n------------------------------ INIT "
                  "------------------------------\n\nInitialising benchmark, "
                  "this may take a few "
                  "minutes...\n\n----------------------------------------------"
                  "--------------------\n\n");
  if (0 == 1)
    fprintf(stdout, "Notice: Parallelism is activated "
                    "[!]\n\n---------------------------------------------------"
                    "---------------\n\n");
}


x86 assembly (clang, -O0):
<header>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<header>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [195 x i8] c"\0A\0A------------------------------ INIT ------------------------------\0A\0AInitialising benchmark, this may take a few minutes...\0A\0A------------------------------------------------------------------\0A\0A\00"
define void @header() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [195 x i8] c"\0A\0A------------------------------ INIT ------------------------------\0A\0AInitialising benchmark, this may take a few minutes...\0A\0A------------------------------------------------------------------\0A\0A\00"
define void @header() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ h(unsigned int, int);
unsigned int m(unsigned int);
f(unsigned i) {
  unsigned j = m(i);
  h(j, i != j);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <m@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
call   1030 <h@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
call   1040 <m@plt>
xor    %esi,%esi
cmp    %ebx,%eax
setne  %sil
mov    %eax,%edi
pop    %rbx
jmp    1030 <h@plt>

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @m(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp ne i32 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @h(i32 %7, i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = tail call i32 @m(i32 %0)
%3 = icmp ne i32 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @h(i32 %2, i32 %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_smoother_translate() {
  printf("NOT IMPLEMENTED:"
         "pa_smoother_translate"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_smoother_translate\00"
define i32 @pa_smoother_translate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ pixel_avg_wxh(unsigned char *, int, unsigned char *, int,
                                 int, int);
void pixel_avg_4x8(unsigned char *pix1, int i_stride_pix1, unsigned char *pix2,
                   int i_stride_pix2) {
  pixel_avg_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 4, 8);
}


x86 assembly (clang, -O0):
<pixel_avg_4x8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x4,%r8d
mov    $0x8,%r9d
call   1030 <pixel_avg_wxh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel_avg_4x8>:
mov    $0x4,%r8d
mov    $0x8,%r9d
jmp    1030 <pixel_avg_wxh@plt>

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

LLVM IR (-O2):
define void @pixel_avg_4x8(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pixel_avg_wxh(i8* %0, i32 %1, i8* %2, i32 %3, i32 4, i32 8)
ret void
}
main() {
  { int i; }
  int a;
  { int a; }
  5;
  int x;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ atoi(char *const);
int numcmp(const void *s1, const void *s2) {
  if (((atoi((char *const)s1)) - (atoi((char *const)s2))) > 0)
    return 1;
  else if (((atoi((char *const)s1)) - (atoi((char *const)s2))) < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atoi@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
sub    %rcx,%rax
cmp    $0x0,%rax
jle    1156 <numcmp+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1198 <numcmp+0x88>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atoi@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
sub    %rcx,%rax
cmp    $0x0,%rax
jge    118c <numcmp+0x7c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1198 <numcmp+0x88>
jmp    1191 <numcmp+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1030 <atoi@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <atoi@plt>
sub    %rax,%rbx
mov    %rbx,%rcx
sar    $0x3f,%rcx
test   %rbx,%rbx
mov    $0x1,%eax
cmovle %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @atoi(i8* %0)
%4 = tail call i64 @atoi(i8* %1)
%5 = sub nsw i64 %3, %4
%6 = icmp sgt i64 %5, 0
%7 = ashr i64 %5, 63
%8 = trunc i64 %7 to i32
%9 = select i1 %6, i32 1, i32 %8
ret i32 %9
}
void unicode_placeholder(void) {}


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

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

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

LLVM IR (-O2):
define void @unicode_placeholder() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glad_glEndConditionalRender();
void glEndConditionalRender() { glad_glEndConditionalRender(); }


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

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

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

LLVM IR (-O2):
define void @glEndConditionalRender() {
%1 = tail call i32 (...) @glad_glEndConditionalRender()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
FILE *efopen(char *name, char *mode) {
  FILE *fp;
  if ((fp = fopen(name, mode)) == NULL) {
    fprintf(stderr, "efopen: can't open \"%s\" for \"%s\"\n", name, mode);
    exit(1);
  }
  return fp;
}


x86 assembly (clang, -O0):
<efopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1182 <efopen+0x52>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<efopen>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     114c <efopen+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"efopen: can't open \22%s\22 for \22%s\22\0A\00"
define i32* @efopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"efopen: can't open \22%s\22 for \22%s\22\0A\00"
define noalias i32* @efopen(i8* %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}