xunge/DecIR huggingface dataset:
void branch_monitor_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @branch_monitor_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HplAdc12P__HplAdc12__resetIFGs();
void Msp430Adc12ImplP__HplAdc12__resetIFGs(void) {
  HplAdc12P__HplAdc12__resetIFGs();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__HplAdc12__resetIFGs() {
%1 = tail call i32 (...) @HplAdc12P__HplAdc12__resetIFGs()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ search(int);
int main() {
  search(1000);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @search(i32 1000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @search(i32 1000)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int string_cmp(const void *a, const void *b) {
  const char **ia = (const char **)a;
  const char **ib = (const char **)b;
  return strcmp(*ia, *ib);
}


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

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

LLVM IR (-O0):
define i32 @string_cmp(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** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @string_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void Rankings_Cache(void) { trap_R_RegisterShaderNoMip("menu/art/cut_frame"); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"menu/art/cut_frame\00"
define void @Rankings_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"menu/art/cut_frame\00"
define void @Rankings_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
void LEDMatrix_Display_Alarm() {}


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

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

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

LLVM IR (-O2):
define void @LEDMatrix_Display_Alarm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int client_out_callback(int sock, void *param) {
  printf("[CLIENT OUT] fd = %d\n", sock);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"[CLIENT OUT] fd = %d\0A\00"
define i32 @client_out_callback(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"[CLIENT OUT] fd = %d\0A\00"
define i32 @client_out_callback(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
void kmemcheck_mark_initialized(void *address, unsigned int n) {}


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

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

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

LLVM IR (-O2):
define void @kmemcheck_mark_initialized(i8* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
struct clib_rb_node {
  int dummy;
};
struct clib_rb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ debug_node_color(struct clib_rb *, struct clib_rb_node *);
void debug_verify_property_2(struct clib_rb *pTree, struct clib_rb_node *root) {
  assert(debug_node_color(pTree, root) == 0);
}


x86 assembly (clang, -O0):
<debug_verify_property_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <debug_node_color@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_verify_property_2>:
push   %rax
call   1030 <debug_node_color@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
%struct.clib_rb = type { i32 }
%struct.clib_rb_node = type { i32 }
define void @debug_verify_property_2(%struct.clib_rb* %0, %struct.clib_rb_node* %1) {
%3 = alloca %struct.clib_rb*
%4 = alloca %struct.clib_rb_node*
store %struct.clib_rb* %0, %struct.clib_rb** %3
store %struct.clib_rb_node* %1, %struct.clib_rb_node** %4
%5 = load %struct.clib_rb*, %struct.clib_rb** %3
%6 = load %struct.clib_rb_node*, %struct.clib_rb_node** %4
%7 = call i64 @debug_node_color(%struct.clib_rb* %5, %struct.clib_rb_node* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret void
}

LLVM IR (-O2):
%struct.clib_rb = type { i32 }
%struct.clib_rb_node = type { i32 }
define void @debug_verify_property_2(%struct.clib_rb* %0, %struct.clib_rb_node* %1) {
%3 = tail call i64 @debug_node_color(%struct.clib_rb* %0, %struct.clib_rb_node* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret void
}
const char *ottery_get_version_string(void) { return "0.0.0"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.0.0\00"
define i8* @ottery_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.0.0\00"
define i8* @ottery_get_version_string() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void OCSP_RESPID_new(void) {}


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

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

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

LLVM IR (-O2):
define void @OCSP_RESPID_new() {
ret void
}
void bad_boy() {}


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

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

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

LLVM IR (-O2):
define void @bad_boy() {
ret void
}
unsigned long long g1(unsigned long long n) { return (float)n; }


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x10(%rbp)
test   %rax,%rax
movss  %xmm0,-0xc(%rbp)
js     1145 <g1+0x45>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movaps %xmm0,%xmm1
cvttss2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movss  0xe9f(%rip),%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
test   %rdi,%rdi
js     110c <g1+0xc>
cvtsi2ss %rdi,%xmm0
jmp    1121 <g1+0x21>
mov    %rdi,%rax
shr    %rax
and    $0x1,%edi
or     %rax,%rdi
cvtsi2ss %rdi,%xmm0
addss  %xmm0,%xmm0
cvttss2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subss  0xecb(%rip),%xmm0
cvttss2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @g1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = uitofp i64 %3 to float
%5 = fptoui float %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @g1(i64 %0) {
%2 = uitofp i64 %0 to float
%3 = fptoui float %2 to i64
ret i64 %3
}
/* Type definitions */
typedef scalar_t__ uid_t;

/* Variables and functions */
unsigned long hash_uid(const uid_t uid) {
  unsigned long h = (unsigned long)uid;
  return h % (521);
}


x86 assembly (clang, -O0):
<hash_uid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x209,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_uid>:
movabs $0xfb93e672fa98528d,%rcx
e6 93 fb
mov    %rdi,%rax
mul    %rcx
shr    $0x9,%rdx
imul   $0x209,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @hash_uid(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = load i64, i64* %3
%6 = urem i64 %5, 521
ret i64 %6
}

LLVM IR (-O2):
define i64 @hash_uid(i64 %0) {
%2 = urem i64 %0, 521
ret i64 %2
}
int test_imm_F8int8_reg(signed char val) {
  return ((val) & (-0xF8 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_F8int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff08,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_F8int8_reg>:
test   $0xffffff08,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F8int8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -248
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fibSumEven(int term1, int term2, int max, int sum) {
  int term = term1 + term2;
  if (term > max)
    return sum;
  if (term % 2 == 0) {
    sum += term;
  }
  return fibSumEven(term2, term, max, sum);
}


x86 assembly (clang, -O0):
<fibSumEven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1144 <fibSumEven+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <fibSumEven+0x65>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1161 <fibSumEven+0x51>
mov    -0x18(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <fibSumEven@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibSumEven>:
mov    %ecx,%eax
add    %esi,%edi
cmp    %edx,%edi
jg     1129 <fibSumEven+0x29>
nopl   0x0(%rax,%rax,1)
mov    %edi,%ecx
test   $0x1,%cl
mov    $0x0,%edi
cmove  %ecx,%edi
add    %edi,%eax
add    %ecx,%esi
mov    %esi,%edi
cmp    %edx,%esi
mov    %ecx,%esi
jle    1110 <fibSumEven+0x10>
ret

LLVM IR (-O0):
define i32 @fibSumEven(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = add nsw i32 %11, %12
store i32 %13, i32* %10
%14 = load i32, i32* %10
%15 = load i32, i32* %8
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = load i32, i32* %9
store i32 %18, i32* %5
br label %33
19: ; preds = %4
%20 = load i32, i32* %10
%21 = srem i32 %20, 2
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i32, i32* %10
%25 = load i32, i32* %9
%26 = add nsw i32 %25, %24
store i32 %26, i32* %9
br label %27
27: ; preds = %23, %19
%28 = load i32, i32* %7
%29 = load i32, i32* %10
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = call i32 @fibSumEven(i32 %28, i32 %29, i32 %30, i32 %31)
store i32 %32, i32* %5
br label %33
33: ; preds = %27, %17
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
define i32 @fibSumEven(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = icmp sgt i32 %5, %2
br i1 %6, label %17, label %7
7: ; preds = %4, %7
%8 = phi i32 [ %15, %7 ], [ %5, %4 ]
%9 = phi i32 [ %14, %7 ], [ %3, %4 ]
%10 = phi i32 [ %8, %7 ], [ %1, %4 ]
%11 = and i32 %8, 1
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i32 %8, i32 0
%14 = add nsw i32 %13, %9
%15 = add nsw i32 %8, %10
%16 = icmp sgt i32 %15, %2
br i1 %16, label %17, label %7
17: ; preds = %7, %4
%18 = phi i32 [ %3, %4 ], [ %14, %7 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ cache_flush();
void storage_flush(void) { cache_flush(); }


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

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

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

LLVM IR (-O2):
define void @storage_flush() {
%1 = tail call i32 (...) @cache_flush()
ret void
}
int test_imm_9Dint8_reg(signed char val) {
  return ((val) & (0x9D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Dint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0x9d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_9Dint8_reg(i8 signext %0) {
%2 = and i8 %0, -99
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int any(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
main() {
  char s1[10] = "testtest";
  char s2[10] = "se";
  printf("%s\n", s1);
  printf("%d\n", any(s1, s2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xec7(%rip),%ax
mov    %ax,-0x6(%rbp)
mov    0xebe(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebb(%rip),%ax
mov    %ax,-0x10(%rbp)
lea    -0xe(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x7473657474736574,%rax
65 73 74
mov    %rax,0x10(%rsp)
movw   $0x0,0x18(%rsp)
movw   $0x0,0x8(%rsp)
movq   $0x6573,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <any@plt>
lea    0xe9b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s1 = [10 x i8] c"testtest\00\00"
@__const.main.s2 = [10 x i8] c"se\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = bitcast [10 x i8]* %3 to i8*
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @any(i8* %8, i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [10 x i8] c"testtest\00\00"
@__const.main.s2 = [10 x i8] c"se\00\00\00\00\00\00\00\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @puts(i8* %3)
%6 = call i32 @any(i8* %3, i8* %4)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
void *alignup(void *p) { return (void *)(((uintptr_t)p + 32) & -32); }


x86 assembly (clang, -O0):
<alignup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rax
and    $0xffffffffffffffe0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<alignup>:
lea    0x20(%rdi),%rax
and    $0xffffffffffffffe0,%rax
ret

LLVM IR (-O0):
define i8* @alignup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = add i64 %4, 32
%6 = and i64 %5, -32
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @alignup(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add i64 %2, 32
%4 = and i64 %3, -32
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int foo(int, int);
int main() {
  int valor = 0;
  int x = 0;
  x = foo(foo(valor, 1), 0);
#pragma omp taskwait
  assert(x == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <foo@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <foo@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <foo@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1040 <foo@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = load i32, i32* %1
%4 = call i32 @foo(i32 %3, i32 1)
%5 = call i32 @foo(i32 %4, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0, i32 1)
%2 = tail call i32 @foo(i32 %1, i32 0)
%3 = icmp eq i32 %2, 2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
ret i32 0
}
int fib(int num) {
  if (num < 2)
    return 1;
  return fib(num - 1) + fib(num - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1154 <fib+0x44>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jl     1145 <fib+0x35>
mov    %edi,%ebx
add    $0x2,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    -0x3(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x3,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fib(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call i32 @fib(i32 %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 2
%13 = call i32 @fib(i32 %12)
%14 = add nsw i32 %10, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %7, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
char *process_POST_request(char *URL, unsigned int *response_len) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @process_POST_request(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i8* null
}
void printMemoryLocations(int *ptr, int value) {
  value = 10;
  ptr = &value;
  printf("The value of ptr is: %d\n", ptr);
  printf("The memory location of ptr is: %p\n", *ptr);
}


x86 assembly (clang, -O0):
<printMemoryLocations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0xa,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printMemoryLocations>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [25 x i8] c"The value of ptr is: %d\0A\00"
@.str.1 = [35 x i8] c"The memory location of ptr is: %p\0A\00"
define void @printMemoryLocations(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 10, i32* %4
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"The value of ptr is: %d\0A\00"
@.str.1 = [35 x i8] c"The memory location of ptr is: %p\0A\00"
define void @printMemoryLocations(i32* nocapture readnone %0, i32 %1) {
%3 = alloca i32
store i32 10, i32* %3
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = load i32, i32* %3
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}
long fatorial(int n) { return 1; }


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

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

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

LLVM IR (-O2):
define i64 @fatorial(i32 %0) {
ret i64 1
}
void fitfun_initialize(char *name) {}


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

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

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

LLVM IR (-O2):
define void @fitfun_initialize(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t swap16(uint64_t x) {
  uint16_t out;
  out = ((x & 0xffull) << 8) | ((x & 0xff00ull) >> 8) << 0;
  return out;
}


x86 assembly (clang, -O0):
<swap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
and    $0xff,%rax
shl    $0x8,%rax
movslq -0x4(%rbp),%rcx
and    $0xff00,%rcx
shr    $0x8,%rcx
shl    $0x0,%rcx
or     %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = and i64 %5, 255
%7 = shl i64 %6, 8
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = and i64 %9, 65280
%11 = lshr i64 %10, 8
%12 = shl i64 %11, 0
%13 = or i64 %7, %12
%14 = trunc i64 %13 to i32
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @swap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
void OptickAPI_PopEvent(uint64_t inEventData) {}


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

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

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

LLVM IR (-O2):
define void @OptickAPI_PopEvent(i32 %0) {
ret void
}
void farpokeb(unsigned sel, void *off, char v) {
  __asm__ __volatile__("push %%fs\n\t"
                       "mov  %0, %%fs\n\t"
                       "movb %2, %%fs:(%1)\n\t"
                       "pop %%fs"
                       :
                       : "g"(sel), "r"(off), "r"(v));
}


x86 assembly (clang, -O0):
<farpokeb>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rax
mov    -0x11(%rbp),%cl
mov    %edx,-0x18(%rbp)
push   %fs
mov    -0x18(%rbp),%fs
mov    %cl,%fs:(%rax)
pop    %fs
pop    %rbp
ret

x86 assembly (clang, -O2):
<farpokeb>:
mov    %edi,-0x4(%rsp)
push   %fs
mov    -0x4(%rsp),%fs
mov    %dl,%fs:(%rsi)
pop    %fs
ret

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

LLVM IR (-O2):
define void @farpokeb(i32 %0, i8* %1, i8 signext %2) {
tail call void asm sideeffect "push %fs\0A\09mov $0, %fs\0A\09movb $2, %fs:($1)\0A\09pop %fs", "imr,r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i8 %2)
ret void
}
void inc_zcache_failed_alloc(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_failed_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("mark option:\n"
         "--mark    [!] [value][/mask]: Match nfmask value (see man page)\n");
}


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

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

LLVM IR (-O0):
@.str = [78 x i8] c"mark option:\0A--mark [!] [value][/mask]: Match nfmask value (see man page)\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [77 x i8] c"mark option:\0A--mark [!] [value][/mask]: Match nfmask value (see man page)\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([77 x i8], [77 x i8]* @str, i64 0, i64 0))
ret void
}
int isdec(int ch) {
  if (ch >= '0' && ch <= '9')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isdec>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <isdec+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <isdec+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isdec+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdec>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdec(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isdec(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime(struct tm *);
char *ctime(int /*<<< orphan*/ *);
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  struct tm *ptr;
  time_t lt;
  lt = time(NULL);
  ptr = gmtime(&lt);
  printf(asctime(ptr));
  printf(ctime(&lt));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1070 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <asctime@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
lea    -0x14(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1070 <gmtime@plt>
mov    %rax,%rdi
call   1040 <asctime@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
mov    %rax,%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
store i32 %4, i32* %3
%5 = call %struct.tm* @gmtime(i32* %3)
store %struct.tm* %5, %struct.tm** %2
%6 = load %struct.tm*, %struct.tm** %2
%7 = call i8* @asctime(%struct.tm* %6)
%8 = call i32 @printf(i8* %7)
%9 = call i8* @ctime(i32* %3)
%10 = call i32 @printf(i8* %9)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @gmtime(i32* %1)
%5 = call i8* @asctime(%struct.tm* %4)
%6 = call i32 @printf(i8* dereferenceable(1) %5)
%7 = call i8* @ctime(i32* %1)
%8 = call i32 @printf(i8* dereferenceable(1) %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr,
          "usage: %s [width [height [seed]]] terrain-spec ...\n\n"
          "where terrain-spec has the form SYMBOL:WEIGHT\n"
          "  SYMBOL is the output character for this terrain\n"
          "  WEIGHT is the relative proportion of the terrain\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [200 x i8] c"usage: %s [width [height [seed]]] terrain-spec ...\0A\0Awhere terrain-spec has the form SYMBOL:WEIGHT\0A SYMBOL is the output character for this terrain\0A WEIGHT is the relative proportion of the terrain\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [200 x i8] c"usage: %s [width [height [seed]]] terrain-spec ...\0A\0Awhere terrain-spec has the form SYMBOL:WEIGHT\0A SYMBOL is the output character for this terrain\0A WEIGHT is the relative proportion of the terrain\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([200 x i8], [200 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  static void *p = (void *)42;
  printf("p = %d\n", (int)p);
  return 0;
}


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

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

LLVM IR (-O0):
@main.p = internal global i8* inttoptr (i64 42 to i8*)
@.str = [8 x i8] c"p = %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i8*, i8** @main.p
%3 = ptrtoint i8* %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"p = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 42)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_vector(float *v, int nl, int nh) { free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_vector>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_vector(float* %0, i32 %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32
%6 = alloca i32
store float* %0, float** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load float*, float** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds float, float* %7, i64 %9
%11 = bitcast float* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_vector(float* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds float, float* %0, i64 %4
%6 = bitcast float* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
void mark_error(void) {}


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

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

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

LLVM IR (-O2):
define void @mark_error() {
ret void
}
long asc0(const long *w, long len) {
  long acc = 0;
  for (; len > 1; len--, w++) {
    if (*w + 1 == *(w + 1))
      acc++;
  }
  return acc;
}


x86 assembly (clang, -O0):
<asc0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jle    1166 <asc0+0x66>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x1,%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jne    1144 <asc0+0x44>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1149 <asc0+0x49>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <asc0+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc0>:
cmp    $0x2,%rsi
jl     1144 <asc0+0x44>
mov    (%rdi),%rcx
add    $0x1,%rsi
add    $0x8,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rcx
mov    (%rdi),%r8
xor    %edx,%edx
cmp    %r8,%rcx
sete   %dl
add    %rdx,%rax
add    $0xffffffffffffffff,%rsi
add    $0x8,%rdi
mov    %r8,%rcx
cmp    $0x2,%rsi
ja     1120 <asc0+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @asc0(i64* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %19
4: ; preds = %2
%5 = load i64, i64* %0
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %13, %6 ], [ %5, %4 ]
%8 = phi i64 [ %16, %6 ], [ 0, %4 ]
%9 = phi i64 [ %17, %6 ], [ %1, %4 ]
%10 = phi i64* [ %12, %6 ], [ %0, %4 ]
%11 = add nsw i64 %7, 1
%12 = getelementptr inbounds i64, i64* %10, i64 1
%13 = load i64, i64* %12
%14 = icmp eq i64 %11, %13
%15 = zext i1 %14 to i64
%16 = add nuw nsw i64 %8, %15
%17 = add nsw i64 %9, -1
%18 = icmp ugt i64 %9, 2
br i1 %18, label %6, label %19
19: ; preds = %6, %2
%20 = phi i64 [ 0, %2 ], [ %16, %6 ]
ret i64 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void elm_io_warn(char *preamble, va_list ap) { vfprintf(stdout, preamble, ap); }


x86 assembly (clang, -O0):
<elm_io_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <vfprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elm_io_warn>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ec4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <vfprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @elm_io_warn(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @vfprintf(i32 %5, i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @elm_io_warn(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @vfprintf(i32 %3, i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int AF_INET;
int idrnet_af_inet() { return AF_INET; }


x86 assembly (clang, -O0):
<idrnet_af_inet>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idrnet_af_inet>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@AF_INET = global i32 0
define i32 @idrnet_af_inet() {
%1 = load i32, i32* @AF_INET
ret i32 %1
}

LLVM IR (-O2):
@AF_INET = global i32 0
define i32 @idrnet_af_inet() {
%1 = load i32, i32* @AF_INET
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void writeId(const char *filename, const char *id) {
  FILE *f = fopen(filename, "w");
  if (f == NULL || id == NULL) {
    return;
  }
  fprintf(f, "%s", id);
  fclose(f);
}


x86 assembly (clang, -O0):
<writeId>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <writeId+0x3a>
cmpq   $0x0,-0x10(%rbp)
jne    116f <writeId+0x3f>
jmp    118c <writeId+0x5c>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeId>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %r14,%r14
je     116a <writeId+0x3a>
mov    %rax,%rbx
test   %rax,%rax
je     116a <writeId+0x3a>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define void @writeId(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
%5 = icmp eq i8* %1, null
%6 = or i1 %5, %4
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @fputs(i8* %1, i32* %3)
%9 = tail call i32 @fclose(i32* %3)
br label %10
10: ; preds = %2, %7
ret void
}
void set_trigger(int level, int slope) { return; }


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

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

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

LLVM IR (-O2):
define void @set_trigger(i32 %0, i32 %1) {
ret void
}
void INI_CfgDepBase_seq_ctx() {}


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

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

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

LLVM IR (-O2):
define void @INI_CfgDepBase_seq_ctx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inplace_swap(char *, char *);
int /*<<< orphan*/ printf(char *, char, char);
int main() {
  char x = 's', y = 't';
  inplace_swap(&x, &y);
  printf("%c,%c\n", x, y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x73,-0x5(%rbp)
movb   $0x74,-0x6(%rbp)
lea    -0x5(%rbp),%rdi
lea    -0x6(%rbp),%rsi
call   1040 <inplace_swap@plt>
mov    -0x5(%rbp),%al
lea    0xeb2(%rip),%rdi
movsbl %al,%esi
movsbl -0x6(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x73,0x7(%rsp)
movb   $0x74,0x6(%rsp)
lea    0x7(%rsp),%rdi
lea    0x6(%rsp),%rsi
call   1040 <inplace_swap@plt>
movsbl 0x7(%rsp),%esi
movsbl 0x6(%rsp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c,%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
store i32 0, i32* %1
store i8 115, i8* %2
store i8 116, i8* %3
%4 = call i32 @inplace_swap(i8* %2, i8* %3)
%5 = load i8, i8* %2
%6 = load i8, i8* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c,%c\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
store i8 115, i8* %1
store i8 116, i8* %2
%3 = call i32 @inplace_swap(i8* %1, i8* %2)
%4 = load i8, i8* %1
%5 = load i8, i8* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %4, i8 signext %5)
ret i32 0
}