xunge/DecIR huggingface dataset:
void delay(void) {
  volatile unsigned int j;
  for (j = 0; j < 50000; j++)
    ;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    $0xc350,%eax
jae    112c <delay+0x2c>
jmp    111e <delay+0x1e>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <delay+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
movl   $0x0,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0xc34f,%eax
ja     1130 <delay+0x30>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
mov    -0x4(%rsp),%eax
cmp    $0xc350,%eax
jb     1120 <delay+0x20>
ret

LLVM IR (-O0):
define void @delay() {
%1 = alloca i32
store volatile i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* %1
%4 = icmp ult i32 %3, 50000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load volatile i32, i32* %1
%8 = add i32 %7, 1
store volatile i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @delay() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
%3 = load volatile i32, i32* %1
%4 = icmp ult i32 %3, 50000
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = load volatile i32, i32* %1
%7 = add i32 %6, 1
store volatile i32 %7, i32* %1
%8 = load volatile i32, i32* %1
%9 = icmp ult i32 %8, 50000
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char const *);
char *alloc_string(const char *string) {
  char *output = NULL;
  if (string)
    asprintf(&output, "%s", string);
  return output;
}


x86 assembly (clang, -O0):
<alloc_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <alloc_string+0x33>
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <asprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_string>:
push   %rax
movq   $0x0,(%rsp)
test   %rdi,%rdi
je     1136 <alloc_string+0x26>
mov    %rdi,%rdx
lea    0xed8(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i8* @alloc_string(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = load i8*, i8** %2
br label %8
8: ; preds = %5, %1
%9 = phi i8* [ %7, %5 ], [ null, %1 ]
ret i8* %9
}
short test_hisf(float x) { return (short)x; }


x86 assembly (clang, -O0):
<test_hisf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hisf>:
cvttss2si %xmm0,%eax
ret

LLVM IR (-O0):
define signext i16 @test_hisf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fptosi float %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @test_hisf(float %0) {
%2 = fptosi float %0 to i16
ret i16 %2
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
size_t float_hash(float val) {
  union {
    float f;
    uint32_t u;
  } v = {val};
  return v.u;
}


x86 assembly (clang, -O0):
<float_hash>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_hash>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
%union.anon = type { i64 }
define i64 @float_hash(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = bitcast %union.anon* %3 to float*
%5 = load float, float* %2
store float %5, float* %4
%6 = bitcast %union.anon* %3 to i64*
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @float_hash(float %0) {
%2 = bitcast float %0 to i32
%3 = zext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void synth_free(void *synth) { free(synth); }


x86 assembly (clang, -O0):
<synth_free>:
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):
<synth_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @synth_free(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 @synth_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void ECAPAPWMPolarityConfig(unsigned int baseAdd, unsigned int flag) {
  if (flag) {
    (*((volatile unsigned short *)(baseAdd + (0x2A)))) |= (0x0400u);
  } else {
    (*((volatile unsigned short *)(baseAdd + (0x2A)))) &= ~(0x0400u);
  }
}


x86 assembly (clang, -O0):
<ECAPAPWMPolarityConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1130 <ECAPAPWMPolarityConfig+0x30>
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
or     $0x400,%ecx
mov    %cx,(%rax)
jmp    1147 <ECAPAPWMPolarityConfig+0x47>
mov    -0x4(%rbp),%eax
add    $0x2a,%eax
mov    %eax,%eax
mov    (%rax),%cx
movzwl %cx,%ecx
and    $0xfffffbff,%ecx
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ECAPAPWMPolarityConfig>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
add    $0x2a,%edi
movzwl (%rdi),%ecx
and    $0xfffffbff,%ecx
shl    $0xa,%eax
or     %ecx,%eax
mov    %ax,(%rdi)
ret

LLVM IR (-O0):
define void @ECAPAPWMPolarityConfig(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add i32 %8, 42
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i16*
%12 = load volatile i16, i16* %11
%13 = zext i16 %12 to i32
%14 = or i32 %13, 1024
%15 = trunc i32 %14 to i16
store volatile i16 %15, i16* %11
br label %25
16: ; preds = %2
%17 = load i32, i32* %3
%18 = add i32 %17, 42
%19 = zext i32 %18 to i64
%20 = inttoptr i64 %19 to i16*
%21 = load volatile i16, i16* %20
%22 = zext i16 %21 to i32
%23 = and i32 %22, -1025
%24 = trunc i32 %23 to i16
store volatile i16 %24, i16* %20
br label %25
25: ; preds = %16, %7
ret void
}

LLVM IR (-O2):
define void @ECAPAPWMPolarityConfig(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = add i32 %0, 42
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i16*
%7 = load volatile i16, i16* %6
%8 = and i16 %7, -1025
%9 = select i1 %3, i16 0, i16 1024
%10 = or i16 %8, %9
store volatile i16 %10, i16* %6
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t read32(uint8_t *buf) {
  return (uint32_t)buf[0] | ((uint32_t)buf[1] << 8) | ((uint32_t)buf[2] << 16) |
         ((uint32_t)buf[3] << 24);
}


x86 assembly (clang, -O0):
<read32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @read32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void mlx5e_dcbnl_delete_app(struct mlx5e_priv *priv) {}


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

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

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

LLVM IR (-O2):
%struct.mlx5e_priv = type opaque
define void @mlx5e_dcbnl_delete_app(%struct.mlx5e_priv* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int16_t;

/* Variables and functions */
int ldsw_le_p(const void *ptr) {
  const uint8_t *p = ptr;
  return (int16_t)(p[0] | (p[1] << 8));
}


x86 assembly (clang, -O0):
<ldsw_le_p>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldsw_le_p>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ldsw_le_p(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 8
%13 = or i32 %8, %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @ldsw_le_p(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
const char *getSpec(void) { return "typ_spec { name=typ_AudioType; }"; }


x86 assembly (clang, -O0):
<getSpec>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getSpec>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [33 x i8] c"typ_spec { name=typ_AudioType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"typ_spec { name=typ_AudioType; }\00"
define i8* @getSpec() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
void strstrip_leading_zeros(char *s) {
  char c, *p;
  p = s;
  while (*s == '0')
    s++;
  do {
    c = *s++;
    *p++ = c;
  } while (c != '\0');
}


x86 assembly (clang, -O0):
<strstrip_leading_zeros>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1131 <strstrip_leading_zeros+0x31>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <strstrip_leading_zeros+0x10>
jmp    1136 <strstrip_leading_zeros+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1136 <strstrip_leading_zeros+0x36>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strstrip_leading_zeros>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
cmp    $0x30,%cl
je     1110 <strstrip_leading_zeros+0x10>
mov    %cl,(%rdi)
test   %cl,%cl
je     1140 <strstrip_leading_zeros+0x40>
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rax,%rcx,1),%edx
mov    %dl,0x1(%rdi,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1130 <strstrip_leading_zeros+0x30>
ret

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

LLVM IR (-O2):
define void @strstrip_leading_zeros(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 48
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %2, label %7
7: ; preds = %2
store i8 %4, i8* %0
%8 = icmp eq i8 %4, 0
br i1 %8, label %16, label %9
9: ; preds = %7, %9
%10 = phi i8* [ %12, %9 ], [ %3, %7 ]
%11 = phi i8* [ %13, %9 ], [ %0, %7 ]
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = getelementptr inbounds i8, i8* %11, i64 1
%14 = load i8, i8* %12
store i8 %14, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %9
16: ; preds = %9, %7
ret void
}
void closespaces(line, col, number, nl) int line, col, number, nl;
{ pcspaces(line, col, number, nl, 1); }


x86 assembly (clang, -O0):
<closespaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x1,%r8d
mov    $0x0,%al
call   1030 <pcspaces@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<closespaces>:
mov    $0x1,%r8d
xor    %eax,%eax
jmp    1030 <pcspaces@plt>

LLVM IR (-O0):
define void @closespaces(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @pcspaces to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %9, i32 %10, i32 %11, i32 %12, i32 1)
ret void
}

LLVM IR (-O2):
define void @closespaces(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @pcspaces to i32 (i32, i32, i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 %2, i32 %3, i32 1)
ret void
}
/* Variables and functions */
int core3_swap(char *, int);
int U_EMRSETCOLORSPACE_swap(char *record, int torev) {
  return (core3_swap(record, torev));
}


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

x86 assembly (clang, -O2):
<U_EMRSETCOLORSPACE_swap>:
jmp    1030 <core3_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETCOLORSPACE_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core3_swap(i8* %0, i32 %1)
ret i32 %3
}
int test_imm_CBint64_lowword_reg(long long val) {
  return ((val) & (0xCB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CBint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 203
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
struct device_node *of_find_node_by_name(struct device_node *from,
                                         const char *name) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.device_node = type opaque
define %struct.device_node* @of_find_node_by_name(%struct.device_node* %0, i8* %1) {
%3 = alloca %struct.device_node*
%4 = alloca i8*
store %struct.device_node* %0, %struct.device_node** %3
store i8* %1, i8** %4
ret %struct.device_node* null
}

LLVM IR (-O2):
%struct.device_node = type opaque
define noalias %struct.device_node* @of_find_node_by_name(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1) {
ret %struct.device_node* null
}
int security_socket_setsockopt(struct socket *sock, int level, int optname) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.socket = type opaque
define i32 @security_socket_setsockopt(%struct.socket* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct jx {
  int dummy;
};
struct dag_node {
  int dummy;
};
struct dag {
  int dummy;
};

/* Variables and functions */
struct jx *dag_node_env_create(struct dag *, struct dag_node *);
int /*<<< orphan*/ jx_delete(struct jx *);
int /*<<< orphan*/ jx_export(struct jx *);
void makeflow_node_export_variables(struct dag *d, struct dag_node *n) {
  struct jx *j = dag_node_env_create(d, n);
  if (j) {
    jx_export(j);
    jx_delete(j);
  }
}


x86 assembly (clang, -O0):
<makeflow_node_export_variables>:
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   1030 <dag_node_env_create@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116e <makeflow_node_export_variables+0x3e>
mov    -0x18(%rbp),%rdi
call   1040 <jx_export@plt>
mov    -0x18(%rbp),%rdi
call   1050 <jx_delete@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeflow_node_export_variables>:
push   %rbx
call   1030 <dag_node_env_create@plt>
test   %rax,%rax
je     114f <makeflow_node_export_variables+0x1f>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <jx_export@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <jx_delete@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.dag = type { i32 }
%struct.dag_node = type { i32 }
%struct.jx = type { i32 }
define void @makeflow_node_export_variables(%struct.dag* %0, %struct.dag_node* %1) {
%3 = alloca %struct.dag*
%4 = alloca %struct.dag_node*
%5 = alloca %struct.jx*
store %struct.dag* %0, %struct.dag** %3
store %struct.dag_node* %1, %struct.dag_node** %4
%6 = load %struct.dag*, %struct.dag** %3
%7 = load %struct.dag_node*, %struct.dag_node** %4
%8 = call %struct.jx* @dag_node_env_create(%struct.dag* %6, %struct.dag_node* %7)
store %struct.jx* %8, %struct.jx** %5
%9 = load %struct.jx*, %struct.jx** %5
%10 = icmp ne %struct.jx* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load %struct.jx*, %struct.jx** %5
%13 = call i32 @jx_export(%struct.jx* %12)
%14 = load %struct.jx*, %struct.jx** %5
%15 = call i32 @jx_delete(%struct.jx* %14)
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.dag = type { i32 }
%struct.dag_node = type { i32 }
%struct.jx = type { i32 }
define void @makeflow_node_export_variables(%struct.dag* %0, %struct.dag_node* %1) {
%3 = tail call %struct.jx* @dag_node_env_create(%struct.dag* %0, %struct.dag_node* %1)
%4 = icmp eq %struct.jx* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @jx_export(%struct.jx* %3)
%7 = tail call i32 @jx_delete(%struct.jx* %3)
br label %8
8: ; preds = %5, %2
ret void
}
int x35_process_syn(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x35_process_syn(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void KeccakP1600_AddByte(void *state, unsigned char byte, unsigned int offset) {
  assert(offset < 200);
  ((unsigned char *)state)[offset] ^= byte;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0xc8,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movzbl -0x9(%rbp),%esi
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
xor    %edi,%edi
cmp    $0xc8,%edx
setb   %dil
call   1030 <assert@plt>
mov    %ebx,%eax
xor    %r14b,0x0(%rbp,%rax,1)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @KeccakP1600_AddByte(i8* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp ult i32 %7, 200
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = xor i32 %18, %12
%20 = trunc i32 %19 to i8
store i8 %20, i8* %16
ret void
}

LLVM IR (-O2):
define void @KeccakP1600_AddByte(i8* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = icmp ult i32 %2, 200
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = xor i8 %9, %1
store i8 %10, i8* %8
ret void
}
/* Variables and functions */
scalar_t__ undef();
void useUndef(void) { 0 || undef(); }


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

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

LLVM IR (-O0):
define void @useUndef() {
%1 = call i64 (...) @undef()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret void
}

LLVM IR (-O2):
define void @useUndef() {
%1 = tail call i64 (...) @undef()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _SC_PAGESIZE;
int /*<<< orphan*/ printf(char *, long);
long sysconf(int /*<<< orphan*/);
int main(void) {
  long rv = sysconf(_SC_PAGESIZE);
  printf("%ld\n", rv);
  return rv != (1 << 16);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x10000,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
cmp    $0x10000,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@_SC_PAGESIZE = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
%3 = load i32, i32* @_SC_PAGESIZE
%4 = call i64 @sysconf(i32 %3)
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = load i64, i64* %2
%8 = icmp ne i64 %7, 65536
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
@_SC_PAGESIZE = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = load i32, i32* @_SC_PAGESIZE
%2 = tail call i64 @sysconf(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = icmp ne i64 %2, 65536
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ baz(int, int, void *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main() {
  baz(10, 11, (void *)12);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0xb,%esi
mov    $0xc,%edx
call   1030 <baz@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc,%edx
mov    $0xa,%edi
mov    $0xb,%esi
call   1030 <baz@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @baz(i32 10, i32 11, i8* inttoptr (i64 12 to i8*))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @baz(i32 10, i32 11, i8* inttoptr (i64 12 to i8*))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int karatsuba(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%i", karatsuba(23, 24)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
mov    $0x18,%esi
call   1030 <karatsuba@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = call i32 @karatsuba(i32 23, i32 24)
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define i32 @main() {
%1 = tail call i32 @karatsuba(i32 23, i32 24)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void z(int i) {}


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

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

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

LLVM IR (-O2):
define void @z(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
float sqrt(int);
int exact_square(int answer) {
  int num;
  float helper;
  scanf("%d", &num);
  helper = sqrt(num);
  if (num / helper == helper) {
    answer = 1;
  } else
    answer = 0;
  return answer;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <sqrt@plt>
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    116e <exact_square+0x4e>
jp     116e <exact_square+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1175 <exact_square+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <sqrt@plt>
cvtsi2ssl 0x4(%rsp),%xmm1
divss  %xmm0,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call float @sqrt(i32 %6)
store float %7, float* %4
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to float
%10 = load float, float* %4
%11 = fdiv float %9, %10
%12 = load float, float* %4
%13 = fcmp oeq float %11, %12
br i1 %13, label %14, label %15
14: ; preds = %1
store i32 1, i32* %2
br label %16
15: ; preds = %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @exact_square(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call float @sqrt(i32 %5)
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to float
%9 = fdiv float %8, %6
%10 = fcmp oeq float %9, %6
%11 = zext i1 %10 to i32
ret i32 %11
}
char *stradd(char *buf, const char *str) {
  const char *p = str;
  char *d = buf;
  while (*p)
    *d++ = *p++;
  return d;
}


x86 assembly (clang, -O0):
<stradd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1150 <stradd+0x50>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    111c <stradd+0x1c>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @stradd(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* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
ret i8* %14
}
void foo378() {}


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

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

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

LLVM IR (-O2):
define void @foo378() {
ret void
}
/* Variables and functions */
char *malloc(size_t);
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *strdup(const char *str) {
  size_t len = strlen(str);
  char *out = malloc(len + 1);
  strncpy(out, str, len);
  out[len] = '\0';
  return out;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i64, i64* %3
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strncpy(i8* %4, i8* %0, i64 %2)
%6 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %6
ret i8* %4
}
/* Type definitions */
struct mat3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mat3_rotation_y(float *, float);
__attribute__((always_)) struct mat3 *psmat3_rotation_y(struct mat3 *result,
                                                        float angle) {
  mat3_rotation_y((float *)result, angle);
  return result;
}


x86 assembly (clang, -O0):
<psmat3_rotation_y>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
call   1030 <mat3_rotation_y@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat3_rotation_y>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat3_rotation_y@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_rotation_y(%struct.mat3* %0, float %1) {
%3 = alloca %struct.mat3*
%4 = alloca float
store %struct.mat3* %0, %struct.mat3** %3
store float %1, float* %4
%5 = load %struct.mat3*, %struct.mat3** %3
%6 = bitcast %struct.mat3* %5 to float*
%7 = load float, float* %4
%8 = call i32 @mat3_rotation_y(float* %6, float %7)
%9 = load %struct.mat3*, %struct.mat3** %3
ret %struct.mat3* %9
}

LLVM IR (-O2):
%struct.mat3 = type { i32 }
define %struct.mat3* @psmat3_rotation_y(%struct.mat3* returned %0, float %1) {
%3 = bitcast %struct.mat3* %0 to float*
%4 = tail call i32 @mat3_rotation_y(float* %3, float %1)
ret %struct.mat3* %0
}
/* Variables and functions */
int /*<<< orphan*/ OutChar(int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void PrintNumber(unsigned char n) {
  char buf[4];
  char *p = buf;
  snprintf(buf, 3, "%d", (int)n);
  while (*p)
    OutChar(*p++);
}


x86 assembly (clang, -O0):
<PrintNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x5(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x5(%rbp),%rdi
movzbl -0x1(%rbp),%ecx
mov    $0x3,%esi
lea    0xeb6(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1178 <PrintNumber+0x58>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <OutChar@plt>
jmp    114f <PrintNumber+0x2f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintNumber>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
lea    0xc(%rsp),%rdi
mov    $0x3,%esi
call   1040 <snprintf@plt>
mov    0xc(%rsp),%al
test   %al,%al
je     1163 <PrintNumber+0x43>
lea    0xd(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <OutChar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1150 <PrintNumber+0x30>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @PrintNumber(i8 zeroext %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = zext i8 %0 to i32
%5 = call i32 @snprintf(i8* %3, i32 3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8, i8* %3
%7 = icmp eq i8 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %1, %8
%9 = phi i8 [ %14, %8 ], [ %6, %1 ]
%10 = phi i8* [ %11, %8 ], [ %3, %1 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = sext i8 %9 to i32
%13 = call i32 @OutChar(i32 %12)
%14 = load i8, i8* %11
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %8, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int print_list_ele(void *data) {
  if (data == NULL) {
    return 0;
  }
  int number = *(int *)data;
  printf("%d\n", number);
  return 0;
}


x86 assembly (clang, -O0):
<print_list_ele>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <print_list_ele+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1152 <print_list_ele+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_list_ele>:
test   %rdi,%rdi
je     1128 <print_list_ele+0x18>
push   %rax
mov    (%rdi),%esi
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @print_list_ele(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %1, %3
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  setlocale(LC_ALL, "Portuguese");
  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    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <setlocale@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <setlocale@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\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 = load i32, i32* @LC_ALL
%7 = call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float divide(int x, int y) {
  if (y == 0)
    return -1;
  else
    return x / y;
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1126 <divide+0x26>
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1136 <divide+0x36>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
test   %esi,%esi
je     110e <divide+0xe>
mov    %edi,%eax
cltd
idiv   %esi
cvtsi2ss %eax,%xmm0
ret
movss  0xeea(%rip),%xmm0
ret

LLVM IR (-O0):
define float @divide(i32 %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store float -1.000000e+00, float* %3
br label %14
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = sdiv i32 %10, %11
%13 = sitofp i32 %12 to float
store float %13, float* %3
br label %14
14: ; preds = %9, %8
%15 = load float, float* %3
ret float %15
}

LLVM IR (-O2):
define float @divide(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
%6 = sitofp i32 %5 to float
br label %7
7: ; preds = %2, %4
%8 = phi float [ %6, %4 ], [ -1.000000e+00, %2 ]
ret float %8
}
void buscar_lista(struct lista *mlista, int valor_procurado) {}


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

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

LLVM IR (-O0):
%struct.lista = type opaque
define void @buscar_lista(%struct.lista* %0, i32 %1) {
%3 = alloca %struct.lista*
%4 = alloca i32
store %struct.lista* %0, %struct.lista** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.lista = type opaque
define void @buscar_lista(%struct.lista* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *LZ4_createStream() {
  void *lz4s = calloc(4, ((1 << (14 - 2)) + 8));
  memset(lz4s, 0, (((1 << (14 - 2)) + 8) * sizeof(unsigned int)));
  return lz4s;
}


x86 assembly (clang, -O0):
<LZ4_createStream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
mov    $0x1008,%esi
call   1040 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4020,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_createStream>:
push   %rbx
mov    $0x4,%edi
mov    $0x1008,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x4020,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @LZ4_createStream() {
%1 = alloca i8*
%2 = call i8* @calloc(i32 4, i32 4104)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @memset(i8* %3, i32 0, i32 16416)
%5 = load i8*, i8** %1
ret i8* %5
}

LLVM IR (-O2):
define i8* @LZ4_createStream() {
%1 = tail call dereferenceable_or_null(16416) i8* @calloc(i32 4, i32 4104)
%2 = tail call i32 @memset(i8* %1, i32 0, i32 16416)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *dyn_top_alloc(long, int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, long);
void *ztmalloc0(long size) {
  void *res = dyn_top_alloc(size, 8);
  assert(res);
  memset(res, 0, size);
  return res;
}


x86 assembly (clang, -O0):
<ztmalloc0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <dyn_top_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ztmalloc0>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x8,%esi
call   1030 <dyn_top_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1040 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ztmalloc0(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @dyn_top_alloc(i64 %4, i32 8)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @assert(i8* %6)
%8 = load i8*, i8** %3
%9 = load i64, i64* %2
%10 = call i32 @memset(i8* %8, i32 0, i64 %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @ztmalloc0(i64 %0) {
%2 = tail call i8* @dyn_top_alloc(i64 %0, i32 8)
%3 = tail call i32 @assert(i8* %2)
%4 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
scalar_t__ block_start(scalar_t__);
uint32_t block_end(uint32_t k) { return block_start(k) + ((1u << 6u) - 1); }


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

x86 assembly (clang, -O2):
<block_end>:
push   %rax
call   1030 <block_start@plt>
add    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @block_end(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @block_start(i64 %3)
%5 = add nsw i64 %4, 63
ret i64 %5
}

LLVM IR (-O2):
define i64 @block_end(i64 %0) {
%2 = tail call i64 @block_start(i64 %0)
%3 = add nsw i64 %2, 63
ret i64 %3
}