xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t rgb32ToRgb24(uint32_t col) {
  uint32_t c24_o = 0;
  uint8_t *c32 = (uint8_t *)&col;
  uint8_t *c24 = (uint8_t *)&c24_o;
  c24[0] = c32[2];
  c24[1] = c32[1];
  c24[2] = c32[0];
  return c24_o;
}


x86 assembly (clang, -O0):
<rgb32ToRgb24>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rgb32ToRgb24(i32 %0) {
ret i32 poison
}
void lerrif(msg, arg) char msg[];
int arg;
{
  char errmsg[2048];
  (void)sprintf(errmsg, msg, arg);
  flexerror(errmsg);
}


x86 assembly (clang, -O0):
<lerrif>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x810(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    -0x810(%rbp),%rdi
mov    $0x0,%al
call   1030 <flexerror@plt>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lerrif>:
push   %rbx
sub    $0x800,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <flexerror@plt>
add    $0x800,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lerrif(i8* nocapture %0, i32 %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, i8*, ...) @sprintf(i8* %4, i8* dereferenceable(1) %0, i32 %1)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @flexerror to i32 (i8*, ...)*)(i8* %4)
ret void
}
void sentinelHandleConfiguration(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               121, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<sentinelHandleConfiguration>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x79,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sentinelHandleConfiguration>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x79,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.sentinelHandleConfiguration = [28 x i8] c"sentinelHandleConfiguration\00"
define void @sentinelHandleConfiguration() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 121, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.sentinelHandleConfiguration, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.sentinelHandleConfiguration = [28 x i8] c"sentinelHandleConfiguration\00"
define void @sentinelHandleConfiguration() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 121, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__func__.sentinelHandleConfiguration, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int i = 1, soma = 0;
  for (i; i <= 100; i++) {
    soma = soma + i;
  }
  printf("A soma dos numeros de 1 a 100 eh: %d", soma);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     114e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [37 x i8] c"A soma dos numeros de 1 a 100 eh: %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
store i32 %11, i32* %3
br label %12
12: ; preds = %8
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %5
15: ; preds = %5
%16 = load i32, i32* %3
%17 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [37 x i8] c"A soma dos numeros de 1 a 100 eh: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 5050)
ret i32 0
}
/* Type definitions */
typedef int const int32_t;

/* Variables and functions */
int const asr_s32(int const, int);
int32_t gemmlowp_scalar_rdivbypo2_s32(int32_t x, int exponent) {
  const int32_t mask = ((1 << exponent) - 1);
  const int32_t remainder = x & mask;
  const int32_t threshold = (mask >> 1) + (int32_t)(x < 0);
  return asr_s32(x, exponent) + (int32_t)(remainder > threshold);
}


x86 assembly (clang, -O0):
<gemmlowp_scalar_rdivbypo2_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <asr_s32@plt>
mov    -0x10(%rbp),%ecx
cmp    -0x14(%rbp),%ecx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gemmlowp_scalar_rdivbypo2_s32>:
push   %rbp
push   %rbx
push   %rax
mov    $0xffffffff,%eax
mov    %esi,%ecx
shl    %cl,%eax
not    %eax
mov    %eax,%ebx
and    %edi,%ebx
sar    %eax
mov    %edi,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
call   1030 <asr_s32@plt>
xor    %ecx,%ecx
cmp    %ebp,%ebx
setg   %cl
add    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gemmlowp_scalar_rdivbypo2_s32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = shl i32 1, %8
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = and i32 %11, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = ashr i32 %14, 1
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 0
%18 = zext i1 %17 to i32
%19 = add nsw i32 %15, %18
store i32 %19, i32* %7
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i32 @asr_s32(i32 %20, i32 %21)
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = icmp sgt i32 %23, %24
%26 = zext i1 %25 to i32
%27 = add nsw i32 %22, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @gemmlowp_scalar_rdivbypo2_s32(i32 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
%6 = ashr i32 %4, 1
%7 = lshr i32 %0, 31
%8 = add nsw i32 %6, %7
%9 = tail call i32 @asr_s32(i32 %0, i32 %1)
%10 = icmp sgt i32 %5, %8
%11 = zext i1 %10 to i32
%12 = add nsw i32 %9, %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ gen_op_ld32(int, int);
void gen_op_ldf32(int dest, int addr) { gen_op_ld32(dest, addr); }


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

x86 assembly (clang, -O2):
<gen_op_ldf32>:
jmp    1030 <gen_op_ld32@plt>

LLVM IR (-O0):
define void @gen_op_ldf32(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 = call i32 @gen_op_ld32(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @gen_op_ldf32(i32 %0, i32 %1) {
%3 = tail call i32 @gen_op_ld32(i32 %0, i32 %1)
ret void
}
void pinMode(int pin, int value) {}


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

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

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

LLVM IR (-O2):
define void @pinMode(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int a = 3;
  switch (a) {
  case 1:
    printf("1\n");
    break;
  case 20:
    printf("2\n");
    break;
  case 300:
    printf("3\n");
    break;
  default:
    printf("default\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     115e <main+0x4e>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x14,%eax
je     116f <main+0x5f>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x12c,%eax
je     1180 <main+0x70>
jmp    1191 <main+0x81>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <main+0x8d>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <main+0x8d>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <main+0x8d>
lea    0xe71(%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 = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
@.str.2 = [3 x i8] c"3\0A\00"
@.str.3 = [9 x i8] c"default\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %10 [
i32 1, label %4
i32 20, label %6
i32 300, label %8
]
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %12
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %12
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8, %6, %4
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"default\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeSharedPages(void *base) { free(base); }


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

x86 assembly (clang, -O2):
<freeSharedPages>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeSharedPages(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, char *, char *, int, char, int, char *);
int main(void) {
  foo("ssdcds", "Hello", "world.", 50, 'a', 2000, "END");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xed9(%rip),%rdx
mov    $0x32,%ecx
mov    $0x61,%r8d
mov    $0x7d0,%r9d
lea    0xec8(%rip),%rax
mov    %rax,(%rsp)
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefc(%rip),%rax
mov    %rax,(%rsp)
lea    0xedd(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xedc(%rip),%rdx
mov    $0x32,%ecx
mov    $0x61,%r8d
mov    $0x7d0,%r9d
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ssdcds\00"
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [7 x i8] c"world.\00"
@.str.3 = [4 x i8] c"END\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 50, i8 signext 97, i32 2000, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"ssdcds\00"
@.str.1 = [6 x i8] c"Hello\00"
@.str.2 = [7 x i8] c"world.\00"
@.str.3 = [4 x i8] c"END\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 50, i8 signext 97, i32 2000, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void glmOr3s(bool out[3], const bool x[3], bool y) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] || y;
}


x86 assembly (clang, -O0):
<glmOr3s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    1167 <glmOr3s+0x67>
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    $0x1,%al
cmpl   $0x0,(%rcx,%rdx,4)
mov    %al,-0x21(%rbp)
jne    1143 <glmOr3s+0x43>
cmpl   $0x0,-0x14(%rbp)
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1117 <glmOr3s+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmOr3s>:
xor    %eax,%eax
mov    (%rsi),%ecx
or     %edx,%ecx
setne  %al
mov    %eax,(%rdi)
xor    %eax,%eax
mov    0x4(%rsi),%ecx
or     %edx,%ecx
setne  %al
mov    %eax,0x4(%rdi)
xor    %eax,%eax
or     0x8(%rsi),%edx
setne  %al
mov    %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmOr3s(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i64 0, i64* %7
br label %8
8: ; preds = %26, %3
%9 = load i64, i64* %7
%10 = icmp ult i64 %9, 3
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32*, i32** %5
%13 = load i64, i64* %7
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = load i32, i32* %6
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %17, %11
%21 = phi i1 [ true, %11 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
%23 = load i32*, i32** %4
%24 = load i64, i64* %7
%25 = getelementptr inbounds i32, i32* %23, i64 %24
store i32 %22, i32* %25
br label %26
26: ; preds = %20
%27 = load i64, i64* %7
%28 = add i64 %27, 1
store i64 %28, i64* %7
br label %8
29: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @glmOr3s(i32* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = or i32 %4, %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
store i32 %7, i32* %0
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = or i32 %9, %2
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
%13 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %12, i32* %13
%14 = getelementptr inbounds i32, i32* %1, i64 2
%15 = load i32, i32* %14
%16 = or i32 %15, %2
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i32
%19 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %18, i32* %19
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_write;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void const *, size_t);
__attribute__((always_)) ssize_t _syscall_write(int fildes, const void *buf,
                                                size_t nbyte) {
  return syscall(__NR_write, fildes, buf, nbyte);
}


x86 assembly (clang, -O0):
<_syscall_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_syscall_write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@__NR_write = global i32 0
define i32 @_syscall_write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @__NR_write
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @syscall(i32 %7, i32 %8, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
@__NR_write = global i32 0
define i32 @_syscall_write(i32 %0, i8* %1, i64 %2) {
%4 = load i32, i32* @__NR_write
%5 = tail call i32 @syscall(i32 %4, i32 %0, i8* %1, i64 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ i2c1_init(int);
int i2c1_readreg(int);
int /*<<< orphan*/ i2c1_writereg(int, int);
void mpu6050_init() {
  i2c1_init(0x68);
  if (i2c1_readreg(117) != 0x68) {
    while (1)
      ;
  }
  i2c1_writereg(107, 0x09);
  i2c1_writereg(26, 0x01);
  i2c1_writereg(28, 0x10);
  i2c1_writereg(27, 0x08);
}


x86 assembly (clang, -O0):
<mpu6050_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x68,%edi
call   1040 <i2c1_init@plt>
mov    $0x75,%edi
call   1050 <i2c1_readreg@plt>
cmp    $0x68,%eax
je     115b <mpu6050_init+0x2b>
jmp    1156 <mpu6050_init+0x26>
jmp    1156 <mpu6050_init+0x26>
mov    $0x6b,%edi
mov    $0x9,%esi
call   1030 <i2c1_writereg@plt>
mov    $0x1a,%edi
mov    $0x1,%esi
call   1030 <i2c1_writereg@plt>
mov    $0x1c,%edi
mov    $0x10,%esi
call   1030 <i2c1_writereg@plt>
mov    $0x1b,%edi
mov    $0x8,%esi
call   1030 <i2c1_writereg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpu6050_init>:
push   %rax
mov    $0x68,%edi
call   1040 <i2c1_init@plt>
mov    $0x75,%edi
call   1050 <i2c1_readreg@plt>
cmp    $0x68,%eax
jne    1190 <mpu6050_init+0x60>
mov    $0x6b,%edi
mov    $0x9,%esi
call   1030 <i2c1_writereg@plt>
mov    $0x1a,%edi
mov    $0x1,%esi
call   1030 <i2c1_writereg@plt>
mov    $0x1c,%edi
mov    $0x10,%esi
call   1030 <i2c1_writereg@plt>
mov    $0x1b,%edi
mov    $0x8,%esi
pop    %rax
jmp    1030 <i2c1_writereg@plt>
nopw   0x0(%rax,%rax,1)
jmp    1190 <mpu6050_init+0x60>

LLVM IR (-O0):
define void @mpu6050_init() {
%1 = call i32 @i2c1_init(i32 104)
%2 = call i32 @i2c1_readreg(i32 117)
%3 = icmp ne i32 %2, 104
br i1 %3, label %4, label %6
4: ; preds = %0
br label %5
5: ; preds = %4, %5
br label %5
6: ; preds = %0
%7 = call i32 @i2c1_writereg(i32 107, i32 9)
%8 = call i32 @i2c1_writereg(i32 26, i32 1)
%9 = call i32 @i2c1_writereg(i32 28, i32 16)
%10 = call i32 @i2c1_writereg(i32 27, i32 8)
ret void
}

LLVM IR (-O2):
define void @mpu6050_init() {
%1 = tail call i32 @i2c1_init(i32 104)
%2 = tail call i32 @i2c1_readreg(i32 117)
%3 = icmp eq i32 %2, 104
br i1 %3, label %5, label %4
4: ; preds = %0, %4
br label %4
5: ; preds = %0
%6 = tail call i32 @i2c1_writereg(i32 107, i32 9)
%7 = tail call i32 @i2c1_writereg(i32 26, i32 1)
%8 = tail call i32 @i2c1_writereg(i32 28, i32 16)
%9 = tail call i32 @i2c1_writereg(i32 27, i32 8)
ret void
}
/* Variables and functions */
int f477(int *);
int f478(int *p) { return f477(p); }


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

x86 assembly (clang, -O2):
<f478>:
jmp    1030 <f477@plt>

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

LLVM IR (-O2):
define i32 @f478(i32* %0) {
%2 = tail call i32 @f477(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("hello\n");
  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)
lea    0xed3(%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 = [7 x i8] c"hello\0A\00"
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 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
__attribute__((pure)) int str_empty(const char *restrict str) {
  return !str || !str[0];
}


x86 assembly (clang, -O0):
<str_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1127 <str_empty+0x27>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_empty>:
test   %rdi,%rdi
je     110e <str_empty+0xe>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @str_empty(i8* noalias %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ true, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @str_empty(i8* noalias %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
void printusage(void) {}


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

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

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

LLVM IR (-O2):
define void @printusage() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
unsigned int item_property_identifier(const char *name) {
  if (strcmp(name, "cap") == 0) {
    return 0x00000019;
  }
  return 0xFFFFFFFF;
}


x86 assembly (clang, -O0):
<item_property_identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <item_property_identifier+0x32>
movl   $0x19,-0x4(%rbp)
jmp    1149 <item_property_identifier+0x39>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<item_property_identifier>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x19,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"cap\00"
define i32 @item_property_identifier(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 25, i32 -1
ret i32 %4
}
float fabsf(float x) {
  __asm__ __volatile__("flds %0;"
                       "fabs;"
                       "fstps %0"
                       : "+m"(x));
  return x;
}


x86 assembly (clang, -O0):
<fabsf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
flds   -0x4(%rbp)
fabs
fstps  -0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsf>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
fabs
fstps  -0x4(%rsp)
movss  -0x4(%rsp),%xmm0
ret

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

LLVM IR (-O2):
define float @fabsf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
ret float %3
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  unsigned long long flags;
  int /*<<< orphan*/ value;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_UPDATE_ELEM;
int /*<<< orphan*/ __NR_bpf;
int /*<<< orphan*/ ptr_to_u64(void *);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_update_elem(int fd, void *key, void *value, unsigned long long flags) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = ptr_to_u64(key),
      .value = ptr_to_u64(value),
      .flags = flags,
  };
  return syscall(__NR_bpf, BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_update_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
mov    $0x8,%ecx
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_update_elem>:
push   %rax
mov    %rcx,(%rsp)
mov    0x2ebc(%rip),%rax
mov    (%rax),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x8,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i64 }
@__NR_bpf = global i32 0
@BPF_MAP_UPDATE_ELEM = global i32 0
define i32 @bpf_update_elem(i32 %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca %union.bpf_attr
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = bitcast %union.bpf_attr* %9 to i64*
%11 = load i64, i64* %8
store i64 %11, i64* %10
%12 = load i32, i32* @__NR_bpf
%13 = load i32, i32* @BPF_MAP_UPDATE_ELEM
%14 = call i32 @syscall(i32 %12, i32 %13, %union.bpf_attr* %9, i32 8)
ret i32 %14
}

LLVM IR (-O2):
%union.bpf_attr = type { i64 }
@__NR_bpf = global i32 0
@BPF_MAP_UPDATE_ELEM = global i32 0
define i32 @bpf_update_elem(i32 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i64 %3) {
%5 = alloca %union.bpf_attr
%6 = bitcast %union.bpf_attr* %5 to i8*
%7 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %5, i64 0, i32 0
store i64 %3, i64* %7
%8 = load i32, i32* @__NR_bpf
%9 = load i32, i32* @BPF_MAP_UPDATE_ELEM
%10 = call i32 @syscall(i32 %8, i32 %9, %union.bpf_attr* %5, i32 8)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_ICMP;
int /*<<< orphan*/ SOCK_RAW;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int pinger_icmp_open(void) { return socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); }


x86 assembly (clang, -O0):
<pinger_icmp_open>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinger_icmp_open>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_ICMP = global i32 0
define i32 @pinger_icmp_open() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_RAW
%3 = load i32, i32* @IPPROTO_ICMP
%4 = call i32 @socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_ICMP = global i32 0
define i32 @pinger_icmp_open() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_RAW
%3 = load i32, i32* @IPPROTO_ICMP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
ret i32 %4
}
int dos_start(char *proc, char *parm, char *title) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @dos_start(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
int stat(const char *file, struct stat *st) {}


x86 assembly (clang, -O0):
<stat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @stat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
double addSub();
double expression() { return addSub(); }


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

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

LLVM IR (-O0):
define double @expression() {
%1 = call double (...) @addSub()
ret double %1
}

LLVM IR (-O2):
define double @expression() {
%1 = tail call double (...) @addSub()
ret double %1
}
int signum(double a) { return (a == 0) ? 0 : (a < 0 ? -1 : 1); }


x86 assembly (clang, -O0):
<signum>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    112b <signum+0x2b>
jp     112b <signum+0x2b>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1147 <signum+0x47>
movsd  -0x8(%rbp),%xmm1
xorps  %xmm0,%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @signum(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 -1, i32 1
br label %11
11: ; preds = %6, %5
%12 = phi i32 [ 0, %5 ], [ %10, %6 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @signum(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, i32 -1, i32 1
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void f1(char *source) {
  char *destination = 0;
  memcpy(destination + 0, source, 10);
}


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

x86 assembly (clang, -O2):
<f1>:
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0xa,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @f1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @memcpy(i8* %5, i8* %6, i32 10)
ret void
}

LLVM IR (-O2):
define void @f1(i8* %0) {
%2 = tail call i32 @memcpy(i8* null, i8* %0, i32 10)
ret void
}
void foo_1_1_1_2_1_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_1_2_1_1_2_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IntDisable(unsigned long);
int /*<<< orphan*/ IntUnregister(unsigned long);
void SSIIntUnregister(unsigned long ulBase) {
  unsigned long ulInt;
  ;
  ulInt = (ulBase == 0x40008000) ? 23 : 50;
  IntDisable(ulInt);
  IntUnregister(ulInt);
}


x86 assembly (clang, -O0):
<SSIIntUnregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x32,%eax
mov    $0x17,%ecx
cmp    $0x40008000,%rdx
cmove  %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <IntDisable@plt>
mov    -0x10(%rbp),%rdi
call   1040 <IntUnregister@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSIIntUnregister>:
push   %rbx
cmp    $0x40008000,%rdi
mov    $0x17,%eax
mov    $0x32,%ebx
cmove  %rax,%rbx
mov    %rbx,%rdi
call   1030 <IntDisable@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <IntUnregister@plt>

LLVM IR (-O0):
define void @SSIIntUnregister(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 1073774592
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 23, i32 50
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i32 @IntDisable(i64 %9)
%11 = load i64, i64* %3
%12 = call i32 @IntUnregister(i64 %11)
ret void
}

LLVM IR (-O2):
define void @SSIIntUnregister(i64 %0) {
%2 = icmp eq i64 %0, 1073774592
%3 = select i1 %2, i64 23, i64 50
%4 = tail call i32 @IntDisable(i64 %3)
%5 = tail call i32 @IntUnregister(i64 %3)
ret void
}
int main() {
  int x, y, z;
  x = 10;
  y = 10;
  z = x + 3 * x / (y - 4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
imul   $0x3,-0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%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
store i32 0, i32* %1
store i32 10, i32* %2
store i32 10, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = mul nsw i32 3, %6
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 4
%10 = sdiv i32 %7, %9
%11 = add nsw i32 %5, %10
store i32 %11, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int test1(int x) {
  static int first_time;
  if (x == 1)
    first_time = 1;
  else if (x > 0)
    first_time = 2;
  return first_time + x;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1120 <test1+0x20>
movl   $0x1,0x2f09(%rip)
jmp    1139 <test1+0x39>
cmpl   $0x0,-0x4(%rbp)
jle    1134 <test1+0x34>
movl   $0x2,0x2ef0(%rip)
jmp    1139 <test1+0x39>
mov    0x2ee5(%rip),%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
cmp    $0x1,%edi
jne    1117 <test1+0x17>
movl   $0x1,0x2f15(%rip)
mov    $0x1,%eax
add    %edi,%eax
ret
jl     112b <test1+0x2b>
movl   $0x2,0x2f01(%rip)
mov    $0x2,%eax
add    %edi,%eax
ret
mov    0x2ef3(%rip),%eax
add    %edi,%eax
ret

LLVM IR (-O0):
@test1.first_time = internal global i32 0
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 1, i32* @test1.first_time
br label %11
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 2, i32* @test1.first_time
br label %10
10: ; preds = %9, %6
br label %11
11: ; preds = %10, %5
%12 = load i32, i32* @test1.first_time
%13 = load i32, i32* %2
%14 = add nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
@test1.first_time = internal unnamed_addr global i32 0
define i32 @test1(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %4
3: ; preds = %1
store i32 1, i32* @test1.first_time
br label %9
4: ; preds = %1
%5 = icmp sgt i32 %0, 0
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = load i32, i32* @test1.first_time
br label %9
8: ; preds = %4
store i32 2, i32* @test1.first_time
br label %9
9: ; preds = %6, %8, %3
%10 = phi i32 [ %7, %6 ], [ 2, %8 ], [ 1, %3 ]
%11 = add nsw i32 %10, %0
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void ErrHandler(char *errMesg) {
  fprintf(stderr, "\n");
  fprintf(stderr, errMesg);
  fprintf(stderr, "\n\n");
  _exit(0);
}


x86 assembly (clang, -O0):
<ErrHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xe9d(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<ErrHandler>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec9(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xeae(%rip),%rsi
call   1040 <fprintf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @ErrHandler(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %5, i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define void @ErrHandler(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @_exit(i32 0)
unreachable
}
void dump_list(const char *label) {}


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

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

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

LLVM IR (-O2):
define void @dump_list(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ tmp;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_pack_prim_4_le(int /*<<< orphan*/ *,
                                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ **, int /*<<< orphan*/ const *,
                          int);
void ivory_serialize_pack_int32_le(uint8_t *dst, uint32_t offs,
                                   const int32_t *src) {
  uint8_t tmp[4] = {0};
  memcpy(&tmp, src, sizeof(tmp));
  ivory_serialize_pack_prim_4_le(dst + offs, tmp);
}


x86 assembly (clang, -O0):
<ivory_serialize_pack_int32_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   1050 <memcpy@plt>
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x30(%rbp),%rsi
call   1030 <ivory_serialize_pack_prim_4_le@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_pack_int32_le>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rdx,%rsi
mov    $0x10,%edx
call   1040 <memcpy@plt>
movslq %ebx,%rax
lea    (%r14,%rax,4),%rdi
mov    %r15,%rsi
call   1030 <ivory_serialize_pack_prim_4_le@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @ivory_serialize_pack_int32_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca [4 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = bitcast [4 x i32]* %7 to i8*
%9 = bitcast [4 x i32]* %7 to i32**
%10 = load i32*, i32** %6
%11 = call i32 @memcpy(i32** %9, i32* %10, i32 16)
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%17 = call i32 @ivory_serialize_pack_prim_4_le(i32* %15, i32* %16)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_pack_int32_le(i32* %0, i32 %1, i32* %2) {
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = bitcast [4 x i32]* %4 to i32**
%7 = call i32 @memcpy(i32** %6, i32* %2, i32 16)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%11 = call i32 @ivory_serialize_pack_prim_4_le(i32* %9, i32* %10)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ narcissisticnumber(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int number;
  printf("½Ð¿é¥X©Ò¦³1000~9999¤§¤ºªº©Ò¦³¤ô¥Pªá¼Æ¡G\n");
  for (number = 1000; number <= 9999; number++)
    narcissisticnumber(number);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
movl   $0x3e8,-0x8(%rbp)
cmpl   $0x270f,-0x8(%rbp)
jg     1165 <main+0x45>
mov    -0x8(%rbp),%edi
call   1040 <narcissisticnumber@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x22>
mov    0x2e74(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x3e8,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1040 <narcissisticnumber@plt>
add    $0x1,%ebx
cmp    $0x2710,%ebx
jne    1140 <main+0x20>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [68 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A5X\C2\A9\C3\92\C2\A6\C2\B31000~9999\C2\A4\C2\A7\C2\A4\C2\BA\C2\AA\C2\BA\C2\A9\C3\92\C2\A6\C2\B3\C2\A4\C3\B4\C2\A5P\C2\AA\C3\A1\C2\BC\C3\86\C2\A1G\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0))
store i32 1000, i32* %2
br label %4
4: ; preds = %10, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 9999
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %2
%9 = call i32 @narcissisticnumber(i32 %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [67 x i8] c"\C2\BD\C3\90\C2\BF\C3\A9\C2\A5X\C2\A9\C3\92\C2\A6\C2\B31000~9999\C2\A4\C2\A7\C2\A4\C2\BA\C2\AA\C2\BA\C2\A9\C3\92\C2\A6\C2\B3\C2\A4\C3\B4\C2\A5P\C2\AA\C3\A1\C2\BC\C3\86\C2\A1G\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1000, %0 ], [ %5, %2 ]
%4 = tail call i32 @narcissisticnumber(i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 10000
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}