xunge/DecIR huggingface dataset:
/* Type definitions */
struct forth_instance {
  int dummy;
};

/* Variables and functions */
scalar_t__ st_pop(struct forth_instance *);
int /*<<< orphan*/ st_push(struct forth_instance *, scalar_t__);
void plus(struct forth_instance *fi) { st_push(fi, st_pop(fi) + st_pop(fi)); }


x86 assembly (clang, -O0):
<plus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <st_pop@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdi
add    %rax,%rsi
call   1040 <st_push@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <st_pop@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <st_pop@plt>
add    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <st_push@plt>

LLVM IR (-O0):
%struct.forth_instance = type { i32 }
define void @plus(%struct.forth_instance* %0) {
%2 = alloca %struct.forth_instance*
store %struct.forth_instance* %0, %struct.forth_instance** %2
%3 = load %struct.forth_instance*, %struct.forth_instance** %2
%4 = load %struct.forth_instance*, %struct.forth_instance** %2
%5 = call i64 @st_pop(%struct.forth_instance* %4)
%6 = load %struct.forth_instance*, %struct.forth_instance** %2
%7 = call i64 @st_pop(%struct.forth_instance* %6)
%8 = add nsw i64 %5, %7
%9 = call i32 @st_push(%struct.forth_instance* %3, i64 %8)
ret void
}

LLVM IR (-O2):
%struct.forth_instance = type { i32 }
define void @plus(%struct.forth_instance* %0) {
%2 = tail call i64 @st_pop(%struct.forth_instance* %0)
%3 = tail call i64 @st_pop(%struct.forth_instance* %0)
%4 = add nsw i64 %3, %2
%5 = tail call i32 @st_push(%struct.forth_instance* %0, i64 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prInt(int);
void prBool(int b) { prInt(b); }


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

x86 assembly (clang, -O2):
<prBool>:
jmp    1030 <prInt@plt>

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

LLVM IR (-O2):
define void @prBool(i32 %0) {
%2 = tail call i32 @prInt(i32 %0)
ret void
}
int acx_debugfs_add_adev(struct acx_device *adev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.acx_device = type opaque
define i32 @acx_debugfs_add_adev(%struct.acx_device* nocapture readnone %0) {
ret i32 0
}
int test3(int e, int f) { return e ^ (e & f); }


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

x86 assembly (clang, -O2):
<test3>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @test3(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* %3
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = xor i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_decrypt_cbc();
int /*<<< orphan*/ test_decrypt_ecb();
int /*<<< orphan*/ test_encrypt_cbc();
int /*<<< orphan*/ test_encrypt_ecb();
int /*<<< orphan*/ test_encrypt_ecb_verbose();
int main(void) {
  test_encrypt_cbc();
  test_decrypt_cbc();
  test_decrypt_ecb();
  test_encrypt_ecb();
  test_encrypt_ecb_verbose();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_encrypt_cbc@plt>
mov    $0x0,%al
call   1050 <test_decrypt_cbc@plt>
mov    $0x0,%al
call   1030 <test_decrypt_ecb@plt>
mov    $0x0,%al
call   1060 <test_encrypt_ecb@plt>
mov    $0x0,%al
call   1070 <test_encrypt_ecb_verbose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_encrypt_cbc@plt>
xor    %eax,%eax
call   1050 <test_decrypt_cbc@plt>
xor    %eax,%eax
call   1030 <test_decrypt_ecb@plt>
xor    %eax,%eax
call   1060 <test_encrypt_ecb@plt>
xor    %eax,%eax
call   1070 <test_encrypt_ecb_verbose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_encrypt_cbc()
%3 = call i32 (...) @test_decrypt_cbc()
%4 = call i32 (...) @test_decrypt_ecb()
%5 = call i32 (...) @test_encrypt_ecb()
%6 = call i32 (...) @test_encrypt_ecb_verbose()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_encrypt_cbc()
%2 = tail call i32 (...) @test_decrypt_cbc()
%3 = tail call i32 (...) @test_decrypt_ecb()
%4 = tail call i32 (...) @test_encrypt_ecb()
%5 = tail call i32 (...) @test_encrypt_ecb_verbose()
ret i32 0
}
void SNDDummyDeInit() {}


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

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

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

LLVM IR (-O2):
define void @SNDDummyDeInit() {
ret void
}
int isvar(char c) { return c == 'x'; }


x86 assembly (clang, -O0):
<isvar>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x78,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvar>:
xor    %eax,%eax
cmp    $0x78,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isvar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 120
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @isvar(i8 signext %0) {
%2 = icmp eq i8 %0, 120
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ to_lower(char);
uint32_t get_child_index(char character) {
  if (((character >= 'A') && (character <= 'Z')) ||
      ((character >= 'a') && (character <= 'z'))) {
    return (uint32_t)to_lower(character) - 'a';
  } else {
    return (26);
  }
}


x86 assembly (clang, -O0):
<get_child_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1138 <get_child_index+0x28>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1152 <get_child_index+0x42>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1166 <get_child_index+0x56>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1166 <get_child_index+0x56>
movsbl -0x5(%rbp),%edi
call   1030 <to_lower@plt>
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    116d <get_child_index+0x5d>
movl   $0x1a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_child_index>:
mov    %edi,%ecx
and    $0xdf,%cl
add    $0xbf,%cl
mov    $0x1a,%eax
cmp    $0x19,%cl
ja     1133 <get_child_index+0x23>
push   %rax
movsbl %dil,%edi
call   1030 <to_lower@plt>
add    $0xffffff9f,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @get_child_index(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %24
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %24
19: ; preds = %15, %7
%20 = load i8, i8* %3
%21 = call i64 @to_lower(i8 signext %20)
%22 = trunc i64 %21 to i32
%23 = sub nsw i32 %22, 97
store i32 %23, i32* %2
br label %25
24: ; preds = %15, %11
store i32 26, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @get_child_index(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = tail call i64 @to_lower(i8 signext %0)
%7 = trunc i64 %6 to i32
%8 = add nsw i32 %7, -97
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 26, %1 ]
ret i32 %10
}
int hash(char *name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture readnone %0) {
ret i32 0
}
void compute(int size) {
  char *buffer[size];
  char *buferr2[size];
}


x86 assembly (clang, -O0):
<compute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @compute(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8*, i64 %7
store i64 %7, i64* %4
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = alloca i8*, i64 %11
store i64 %11, i64* %5
%13 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @compute(i32 %0) {
ret void
}
int test_imm_F4uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xF4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F4uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 244
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
void prompt_for_filename(char *filename) {
  puts("Where is the input file?");
  scanf("%s", filename);
}


x86 assembly (clang, -O0):
<prompt_for_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_for_filename>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xee2(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Where is the input file?\00"
@.str.1 = [3 x i8] c"%s\00"
define void @prompt_for_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Where is the input file?\00"
@.str.1 = [3 x i8] c"%s\00"
define void @prompt_for_filename(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
int f() { return 10; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f() {
ret i32 10
}

LLVM IR (-O2):
define i32 @f() {
ret i32 10
}
/* Variables and functions */
int /*<<< orphan*/ MV_SetReverb(int);
void FX_SetReverb(int reverb) { MV_SetReverb(reverb); }


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

x86 assembly (clang, -O2):
<FX_SetReverb>:
jmp    1030 <MV_SetReverb@plt>

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

LLVM IR (-O2):
define void @FX_SetReverb(i32 %0) {
%2 = tail call i32 @MV_SetReverb(i32 %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_maskmove_si64(int /*<<< orphan*/, int /*<<< orphan*/,
                                     char *);
void test_mm_maskmove_si64(__m64 d, __m64 n, char *p) {
  _mm_maskmove_si64(d, n, p);
}


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

x86 assembly (clang, -O2):
<test_mm_maskmove_si64>:
jmp    1030 <_mm_maskmove_si64@plt>

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

LLVM IR (-O2):
define void @test_mm_maskmove_si64(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @_mm_maskmove_si64(i32 %0, i32 %1, i8* %2)
ret void
}
int XGetTransientForHint() {}


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

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

LLVM IR (-O0):
define i32 @XGetTransientForHint() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XGetTransientForHint() {
ret i32 undef
}
/* Variables and functions */
unsigned int list_minmax(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *);
bool test_list_minmax_null_params(void) {
  bool pass = false;
  unsigned int res = list_minmax(NULL, NULL, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_minmax_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <list_minmax@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1142 <test_list_minmax_null_params+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_minmax_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <list_minmax@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_list_minmax_null_params() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @list_minmax(i32* null, i32* null, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_list_minmax_null_params() {
%1 = tail call i32 @list_minmax(i32* null, i32* null, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int test_imm_3Auint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x3A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_3Auint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 249108103168
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void __attribute__((weak)) * calloc(int size, size_t cnt) {
  void *mem = malloc(size * cnt);
  if (mem) {
    memset(mem, 0, size * cnt);
  }
  return mem;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1164 <calloc+0x44>
mov    -0x18(%rbp),%rdi
movslq -0x4(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
imul   %esi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1144 <calloc+0x24>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define weak i8* @calloc(i32 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = mul i32 %3, %0
%5 = tail call i8* @malloc(i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @memset(i8* %5, i32 0, i32 %4)
br label %9
9: ; preds = %7, %2
ret i8* %5
}
int testBit_fun_short(short x, unsigned i) { return (x & 1 << i) != 0; }


x86 assembly (clang, -O0):
<testBit_fun_short>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movswl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<testBit_fun_short>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @testBit_fun_short(i16 signext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @testBit_fun_short(i16 signext %0, i32 %1) {
%3 = sext i16 %0 to i32
%4 = lshr i32 %3, %1
%5 = and i32 %4, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void CRTFree(void *mm_context, void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<CRTFree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @CRTFree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
void nothing(void) {}


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

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

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

LLVM IR (-O2):
define void @nothing() {
ret void
}
void main(void) { static int unused_local_var; }


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

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

LLVM IR (-O0):
@main.unused_local_var = internal global i32 0
define void @main() {
ret void
}

LLVM IR (-O2):
define void @main() {
ret void
}
/* Variables and functions */
int i2c_read_reg(int);
int i2c_read_control() { return i2c_read_reg(2); }


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

x86 assembly (clang, -O2):
<i2c_read_control>:
mov    $0x2,%edi
jmp    1030 <i2c_read_reg@plt>

LLVM IR (-O0):
define i32 @i2c_read_control() {
%1 = call i32 @i2c_read_reg(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @i2c_read_control() {
%1 = tail call i32 @i2c_read_reg(i32 2)
ret i32 %1
}
/* Variables and functions */
unsigned int GET_UAA32LE(unsigned int *, int /*<<< orphan*/);
unsigned int LE32(unsigned int x) { return GET_UAA32LE(&x, 0); }


x86 assembly (clang, -O0):
<LE32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA32LE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LE32>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <GET_UAA32LE@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @LE32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @GET_UAA32LE(i32* %2, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t now;
  struct tm *tm_now;
  char datetime[200];
  time(&now);
  tm_now = localtime(&now);
  strftime(datetime, 200, "%Y-%m-%d_%H_%M_%S.mp4", tm_now);
  printf("now datetime : %s\n", datetime);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <time@plt>
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0xc8,%esi
lea    0xe81(%rip),%rdx
call   1060 <strftime@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xe0,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xe9c(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    %rax,%rcx
call   1060 <strftime@plt>
lea    0xe96(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%Y-%m-%d_%H_%M_%S.mp4\00"
@.str.1 = [19 x i8] c"now datetime : %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.tm*
%4 = alloca [200 x i8]
store i32 0, i32* %1
%5 = call i32 @time(i32* %2)
%6 = call %struct.tm* @localtime(i32* %2)
store %struct.tm* %6, %struct.tm** %3
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%8 = load %struct.tm*, %struct.tm** %3
%9 = call i32 @strftime(i8* %7, i32 200, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [22 x i8] c"%Y-%m-%d_%H_%M_%S.mp4\00"
@.str.1 = [19 x i8] c"now datetime : %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = call i32 @time(i32* %1)
%6 = call %struct.tm* @localtime(i32* %1)
%7 = call i32 @strftime(i8* %4, i32 200, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}
int INHERENT_link() { return 1; }


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

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

LLVM IR (-O0):
define i32 @INHERENT_link() {
ret i32 1
}

LLVM IR (-O2):
define i32 @INHERENT_link() {
ret i32 1
}
unsigned xrop3_166_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~T;
  stk2 = S & stk3;
  stk1 = D ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_166_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_166_1_1>:
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
not    %ecx
or     %edi,%esi
mov    %edi,%eax
not    %al
movzbl %al,%eax
and    %ecx,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_166_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -1
%6 = xor i8 %0, -1
%7 = zext i8 %6 to i32
%8 = and i32 %7, %5
%9 = or i8 %1, %0
%10 = zext i8 %9 to i32
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void emptyTerminal(void) { system("clear"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
define void @emptyTerminal() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
define void @emptyTerminal() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((always_)) const double mla(double x, double y, double z) {
  return x * y + z;
}


x86 assembly (clang, -O0):
<mla>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mla>:
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @mla(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @mla(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ bug(int);
int main(int argc, char **argv) { bug(4); }


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1030 <bug@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @bug(i32 4)
ret i32 0
}
unsigned long long Ch(unsigned long long x, unsigned long long y,
                      unsigned long long z) {
  return (x & y) ^ (~x & z);
}


x86 assembly (clang, -O0):
<Ch>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
and    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    -0x18(%rbp),%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ch>:
mov    %rsi,%rax
xor    %rdx,%rax
and    %rdi,%rax
xor    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @Ch(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = and i64 %7, %8
%10 = load i64, i64* %4
%11 = xor i64 %10, -1
%12 = load i64, i64* %6
%13 = and i64 %11, %12
%14 = xor i64 %9, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @Ch(i64 %0, i64 %1, i64 %2) {
%4 = and i64 %1, %0
%5 = xor i64 %0, -1
%6 = and i64 %5, %2
%7 = or i64 %6, %4
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *strrchr(char const *, char);
void usage(const char *tool) {
  char *name = NULL;
  name = strrchr(tool, '/');
  printf("usage : %s [PORT]\n", (name ? name + 1 : tool));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1162 <usage+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    116a <usage+0x4a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1040 <strrchr@plt>
lea    0x1(%rax),%rsi
test   %rax,%rax
cmove  %rbx,%rsi
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"usage : %s [PORT]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* null, i8** %3
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
%15 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"usage : %s [PORT]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
/* Type definitions */
struct json_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ json_object_new_string(char const *);
int /*<<< orphan*/ json_object_path_set(struct json_object *, char const *,
                                        int /*<<< orphan*/);
void json_object_path_set_string(struct json_object *jso, const char *path,
                                 const char *s) {
  json_object_path_set(jso, path, json_object_new_string(s));
}


x86 assembly (clang, -O0):
<json_object_path_set_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <json_object_new_string@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1040 <json_object_path_set@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_object_path_set_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <json_object_new_string@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <json_object_path_set@plt>

LLVM IR (-O0):
%struct.json_object = type { i32 }
define void @json_object_path_set_string(%struct.json_object* %0, i8* %1, i8* %2) {
%4 = alloca %struct.json_object*
%5 = alloca i8*
%6 = alloca i8*
store %struct.json_object* %0, %struct.json_object** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.json_object*, %struct.json_object** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @json_object_new_string(i8* %9)
%11 = call i32 @json_object_path_set(%struct.json_object* %7, i8* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.json_object = type { i32 }
define void @json_object_path_set_string(%struct.json_object* %0, i8* %1, i8* %2) {
%4 = tail call i32 @json_object_new_string(i8* %2)
%5 = tail call i32 @json_object_path_set(%struct.json_object* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
f() {
  int v = 4;
  {
    extern int v;
    if (v != 3)
      abort();
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x4,-0x8(%rbp)
mov    0x2eba(%rip),%rax
cmpl   $0x3,(%rax)
je     1136 <f+0x26>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    0x2ec8(%rip),%rax
cmpl   $0x3,(%rax)
jne    111f <f+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@v = external global i32
define i32 @f() {
%1 = alloca i32
%2 = alloca i32
store i32 4, i32* %2
%3 = load i32, i32* @v
%4 = icmp ne i32 %3, 3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@v = external global i32
define i32 @f() {
%1 = load i32, i32* @v
%2 = icmp eq i32 %1, 3
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 undef
}
/* Variables and functions */
scalar_t__ FP_SUBNORMAL;
scalar_t__ fpclassify(float);
float undenormalise(float f) {
  if (fpclassify(f) == FP_SUBNORMAL)
    return 0.0;
  return f;
}


x86 assembly (clang, -O0):
<undenormalise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <fpclassify@plt>
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
jne    1144 <undenormalise+0x34>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    114e <undenormalise+0x3e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<undenormalise>:
push   %rax
movss  %xmm0,0x4(%rsp)
call   1030 <fpclassify@plt>
mov    0x2ebd(%rip),%rcx
xorps  %xmm0,%xmm0
cmp    (%rcx),%rax
je     1131 <undenormalise+0x21>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@FP_SUBNORMAL = global i64 0
define float @undenormalise(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = call i64 @fpclassify(float %4)
%6 = load i64, i64* @FP_SUBNORMAL
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store float 0.000000e+00, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %8
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
@FP_SUBNORMAL = global i64 0
define float @undenormalise(float %0) {
%2 = tail call i64 @fpclassify(float %0)
%3 = load i64, i64* @FP_SUBNORMAL
%4 = icmp eq i64 %2, %3
%5 = select i1 %4, float 0.000000e+00, float %0
ret float %5
}
void set_music_volume(int percent) {}


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

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

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

LLVM IR (-O2):
define void @set_music_volume(i32 %0) {
ret void
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_clear(struct genlist *);
void fc_sockaddr_list_clear(struct fc_sockaddr_list *tthis) {
  genlist_clear((struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<fc_sockaddr_list_clear>:
jmp    1030 <genlist_clear@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_clear(%struct.fc_sockaddr_list* %0) {
%2 = alloca %struct.fc_sockaddr_list*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %2
%3 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %2
%4 = bitcast %struct.fc_sockaddr_list* %3 to %struct.genlist*
%5 = call i32 @genlist_clear(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%struct.genlist = type { i32 }
define void @fc_sockaddr_list_clear(%struct.fc_sockaddr_list* %0) {
%2 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_clear(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *, char *);
void logging_Error(char *fct_name, char *text, int err_code) {
  printf("Error - %s : %s\n", fct_name, text);
  exit(err_code);
}


x86 assembly (clang, -O0):
<logging_Error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<logging_Error>:
push   %rbx
mov    %edx,%ebx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Error - %s : %s\0A\00"
define void @logging_Error(i8* %0, i8* %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 i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
%10 = load i32, i32* %6
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"Error - %s : %s\0A\00"
define void @logging_Error(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
int /*<<< orphan*/ writeLint(char *, unsigned long);
int setDutyCyclePWM(unsigned char n, unsigned long int dutyCycle) {
  char f[44];
  sprintf(f, "/sys/class/pwm/pwmchip0/pwm%d/duty_cycle", n);
  writeLint(f, dutyCycle);
}


x86 assembly (clang, -O0):
<setDutyCyclePWM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xec3(%rip),%rsi
movzbl -0x5(%rbp),%edx
call   1040 <sprintf@plt>
lea    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <writeLint@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDutyCyclePWM>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <writeLint@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [41 x i8] c"/sys/class/pwm/pwmchip0/pwm%d/duty_cycle\00"
define i32 @setDutyCyclePWM(i8 zeroext %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i64
%6 = alloca [44 x i8]
store i8 %0, i8* %4
store i64 %1, i64* %5
%7 = getelementptr inbounds [44 x i8], [44 x i8]* %6, i64 0, i64 0
%8 = load i8, i8* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext %8)
%10 = getelementptr inbounds [44 x i8], [44 x i8]* %6, i64 0, i64 0
%11 = load i64, i64* %5
%12 = call i32 @writeLint(i8* %10, i64 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [41 x i8] c"/sys/class/pwm/pwmchip0/pwm%d/duty_cycle\00"
define i32 @setDutyCyclePWM(i8 zeroext %0, i64 %1) {
%3 = alloca [44 x i8]
%4 = getelementptr inbounds [44 x i8], [44 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8 zeroext %0)
%6 = call i32 @writeLint(i8* %4, i64 %1)
ret i32 undef
}
/* Variables and functions */
long double expl(long double);
long double expm1l(long double x) { return expl(x) - 1; }


x86 assembly (clang, -O0):
<expm1l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <expl@plt>
fld1
fchs
faddp  %st,%st(1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expm1l>:
sub    $0x18,%rsp
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <expl@plt>
fld1
fchs
faddp  %st,%st(1)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @expm1l(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call x86_fp80 @expl(x86_fp80 %3)
%5 = fsub x86_fp80 %4, 0xK3FFF8000000000000000
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @expm1l(x86_fp80 %0) {
%2 = tail call x86_fp80 @expl(x86_fp80 %0)
%3 = fadd x86_fp80 %2, 0xKBFFF8000000000000000
ret x86_fp80 %3
}
unsigned int instr_util_ustuffs8(int byte3, int byte2, int byte1, int byte0) {
  unsigned int retval;
  retval = (unsigned int)((byte3 << 24) & 0xff000000);
  retval = (unsigned int)((byte2 << 16) & 0x00ff0000);
  retval = (unsigned int)((byte1 << 8) & 0x0000ff00);
  retval |= (unsigned int)(byte0 & 0x000000ff);
  return retval;
}


x86 assembly (clang, -O0):
<instr_util_ustuffs8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
and    $0xff000000,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x10,%eax
and    $0xff0000,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<instr_util_ustuffs8>:
shl    $0x8,%edx
movzwl %dx,%edx
movzbl %cl,%eax
or     %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @instr_util_ustuffs8(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %2, 8
%6 = and i32 %5, 65280
%7 = and i32 %3, 255
%8 = or i32 %6, %7
ret i32 %8
}
int nth_bit(long long num, int n) { return (num & (1LL << (64 - n))) != 0; }


x86 assembly (clang, -O0):
<nth_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x40,%ecx
sub    -0xc(%rbp),%ecx
mov    %ecx,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    %rdx,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nth_bit>:
mov    $0x40,%al
sub    %sil,%al
movzbl %al,%ecx
xor    %eax,%eax
bt     %rcx,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @nth_bit(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 64, %6
%8 = zext i32 %7 to i64
%9 = shl i64 1, %8
%10 = and i64 %5, %9
%11 = icmp ne i64 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @nth_bit(i64 %0, i32 %1) {
%3 = sub nsw i32 64, %1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 1, %4
%6 = and i64 %5, %0
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}