xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_AddMat4_init(void) {
  _hmt_register_covercase("HMM_AddMat4", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_AddMat4_init>:
lea    0xee9(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"HMM_AddMat4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_AddMat4_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"HMM_AddMat4\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_AddMat4_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *alloca(scalar_t__);
int mkstemp(char *);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
int /*<<< orphan*/ unlink(char *);
int h2o_file_mktemp(const char *fn_template) {
  int fd;
  char *tmpfn = alloca(strlen(fn_template) + 1);
  strcpy(tmpfn, fn_template);
  if ((fd = mkstemp(tmpfn)) == -1) {
    return -1;
  }
  unlink(tmpfn);
  return fd;
}


x86 assembly (clang, -O0):
<h2o_file_mktemp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <alloca@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x20(%rbp),%rdi
call   1070 <mkstemp@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    11a3 <h2o_file_mktemp+0x53>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b2 <h2o_file_mktemp+0x62>
mov    -0x20(%rbp),%rdi
call   1030 <unlink@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_file_mktemp>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbp
call   1050 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <alloca@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1070 <mkstemp@plt>
mov    %eax,%ebp
cmp    $0xffffffff,%eax
je     1189 <h2o_file_mktemp+0x39>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @h2o_file_mktemp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = add nsw i64 %7, 1
%9 = call i8* @alloca(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @mkstemp(i8* %13)
store i32 %14, i32* %4
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %17
16: ; preds = %1
store i32 -1, i32* %2
br label %21
17: ; preds = %1
%18 = load i8*, i8** %5
%19 = call i32 @unlink(i8* %18)
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %17, %16
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @h2o_file_mktemp(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @alloca(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
%6 = tail call i32 @mkstemp(i8* %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @unlink(i8* %4)
br label %10
10: ; preds = %1, %8
ret i32 %6
}
double min(double x, double y) {
  if (x - y > 1e-4)
    return y;
  else
    return x;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1139 <min+0x39>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1143 <min+0x43>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
movapd %xmm0,%xmm3
subsd  %xmm1,%xmm3
movsd  0xef0(%rip),%xmm2
cmpltsd %xmm3,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @min(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fsub double %6, %7
%9 = fcmp ogt double %8, 1.000000e-04
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load double, double* %5
store double %11, double* %3
br label %14
12: ; preds = %2
%13 = load double, double* %4
store double %13, double* %3
br label %14
14: ; preds = %12, %10
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @min(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fcmp ogt double %3, 1.000000e-04
%5 = select i1 %4, double %1, double %0
ret double %5
}
int test_imm_05int16_mem(short *val) {
  return ((*val) & (-0x05 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_05int16_mem>:
movzwl (%rdi),%eax
test   $0xfffb,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_05int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -5
%7 = icmp ne i32 %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_05int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -5
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int strtol(char *, char **, int);
int hex2int(char *a) {
  char *offset;
  return strtol(a, &offset, 16);
}


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

x86 assembly (clang, -O2):
<hex2int>:
push   %rax
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtol@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hex2int(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strtol(i8* %4, i8** %3, i32 16)
ret i32 %5
}

LLVM IR (-O2):
define i32 @hex2int(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @strtol(i8* %0, i8** %2, i32 16)
ret i32 %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void set_cdb_buffer_length(unsigned char *cdb, uint16_t buflen) {
  cdb[7] = (buflen >> 8) & 0xff;
  cdb[7 + 1] = buflen & 0xff;
}


x86 assembly (clang, -O0):
<set_cdb_buffer_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x7(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_cdb_buffer_length>:
rol    $0x8,%si
mov    %si,0x7(%rdi)
ret

LLVM IR (-O0):
define void @set_cdb_buffer_length(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 7
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 8
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @set_cdb_buffer_length(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %4, i8* %5
%6 = trunc i32 %1 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %6, i8* %7
ret void
}
/* Variables and functions */
char *commas_in_money(double);
char *place_commas_in_money(double d) { return commas_in_money(d); }


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

x86 assembly (clang, -O2):
<place_commas_in_money>:
jmp    1030 <commas_in_money@plt>

LLVM IR (-O0):
define i8* @place_commas_in_money(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i8* @commas_in_money(double %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @place_commas_in_money(double %0) {
%2 = tail call i8* @commas_in_money(double %0)
ret i8* %2
}
int test_imm_79int64_lowword_reg(long long val) {
  return ((val) & (0x79 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_79int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 121
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fail();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void error(char *message, char *arg) {
  fprintf(stderr, "ERROR: %s: %s.\n", message, arg);
  fail();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <fail@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"ERROR: %s: %s.\0A\00"
define void @error(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = tail call i32 (...) @fail()
ret void
}
struct rpn_plugin_info *rpn_plugin_info(
    struct rpn_plugin_info *(*info_link)(char *, char *, char *, double)) {
  return info_link("Test Plugin", "Ian Duncan", "This is a test.", 1.0);
}


x86 assembly (clang, -O0):
<rpn_plugin_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xef5(%rip),%rdi
lea    0xefa(%rip),%rsi
lea    0xefe(%rip),%rdx
movsd  0xed7(%rip),%xmm0
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_plugin_info>:
mov    %rdi,%rax
lea    0xefe(%rip),%rdi
lea    0xf03(%rip),%rsi
lea    0xf07(%rip),%rdx
movsd  0xee0(%rip),%xmm0
jmp    *%rax

LLVM IR (-O0):
%struct.rpn_plugin_info = type opaque
@.str = [12 x i8] c"Test Plugin\00"
@.str.1 = [11 x i8] c"Ian Duncan\00"
@.str.2 = [16 x i8] c"This is a test.\00"
define %struct.rpn_plugin_info* @rpn_plugin_info(%struct.rpn_plugin_info* (i8*, i8*, i8*, double)* %0) {
%2 = alloca %struct.rpn_plugin_info* (i8*, i8*, i8*, double)*
store %struct.rpn_plugin_info* (i8*, i8*, i8*, double)* %0, %struct.rpn_plugin_info* (i8*, i8*, i8*, double)** %2
%3 = load %struct.rpn_plugin_info* (i8*, i8*, i8*, double)*, %struct.rpn_plugin_info* (i8*, i8*, i8*, double)** %2
%4 = call %struct.rpn_plugin_info* %3(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00)
ret %struct.rpn_plugin_info* %4
}

LLVM IR (-O2):
%struct.rpn_plugin_info = type opaque
@.str = [12 x i8] c"Test Plugin\00"
@.str.1 = [11 x i8] c"Ian Duncan\00"
@.str.2 = [16 x i8] c"This is a test.\00"
define %struct.rpn_plugin_info* @rpn_plugin_info(%struct.rpn_plugin_info* (i8*, i8*, i8*, double)* nocapture %0) {
%2 = tail call %struct.rpn_plugin_info* %0(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 1.000000e+00)
ret %struct.rpn_plugin_info* %2
}
__attribute__((no, noclone)) int bar(int x) {
  int v = 0;
  switch (x) {
  case 18:
    v = 67;
    break;
  case 19:
    v = 68;
    break;
  case 20:
    v = 69;
    break;
  }
  return v;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x12,%eax
je     1144 <bar+0x44>
jmp    1122 <bar+0x22>
mov    -0xc(%rbp),%eax
sub    $0x13,%eax
je     1150 <bar+0x50>
jmp    1133 <bar+0x33>
mov    -0xc(%rbp),%eax
sub    $0x14,%eax
je     115c <bar+0x5c>
jmp    1163 <bar+0x63>
movl   $0x43,-0x8(%rbp)
jmp    1163 <bar+0x63>
movl   $0x44,-0x8(%rbp)
jmp    1163 <bar+0x63>
movl   $0x45,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    -0x12(%rdi),%ecx
lea    0x31(%rdi),%edx
xor    %eax,%eax
cmp    $0x3,%ecx
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 18, label %5
i32 19, label %6
i32 20, label %7
]
5: ; preds = %1
store i32 67, i32* %3
br label %8
6: ; preds = %1
store i32 68, i32* %3
br label %8
7: ; preds = %1
store i32 69, i32* %3
br label %8
8: ; preds = %1, %7, %6, %5
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
%2 = add i32 %0, -18
%3 = icmp ult i32 %2, 3
%4 = add i32 %0, 49
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
int scandir(const char *restrict dir __attribute__((__unused__)),
            struct dirent ***restrict namelist __attribute__((__unused__)),
            int (*selector)(const struct dirent *) __attribute__((__unused__)),
            int (*cmp)(const struct dirent **, const struct dirent **)
                __attribute__((__unused__))) {
  return -1;
}


x86 assembly (clang, -O0):
<scandir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.dirent = type opaque
define i32 @scandir(i8* noalias %0, %struct.dirent*** noalias %1, i32 (%struct.dirent*)* %2, i32 (%struct.dirent**, %struct.dirent**)* %3) {
%5 = alloca i8*
%6 = alloca %struct.dirent***
%7 = alloca i32 (%struct.dirent*)*
%8 = alloca i32 (%struct.dirent**, %struct.dirent**)*
store i8* %0, i8** %5
store %struct.dirent*** %1, %struct.dirent**** %6
store i32 (%struct.dirent*)* %2, i32 (%struct.dirent*)** %7
store i32 (%struct.dirent**, %struct.dirent**)* %3, i32 (%struct.dirent**, %struct.dirent**)** %8
ret i32 -1
}

LLVM IR (-O2):
%struct.dirent = type opaque
define i32 @scandir(i8* noalias nocapture readnone %0, %struct.dirent*** noalias nocapture readnone %1, i32 (%struct.dirent*)* nocapture readnone %2, i32 (%struct.dirent**, %struct.dirent**)* nocapture readnone %3) {
ret i32 -1
}
mread(fd, address, bytes) int fd;
char *address;
register int bytes;
{
  if (read(fd, address, bytes) < 0 && bytes != 0)
    error(1, "Read error", ((char *)0));
}


x86 assembly (clang, -O0):
<mread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x0,%al
call   1030 <read@plt>
cmp    $0x0,%eax
jge    116d <mread+0x4d>
cmpl   $0x0,-0x14(%rbp)
je     116d <mread+0x4d>
mov    $0x1,%edi
lea    0xe9e(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1040 <error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mread>:
push   %rbx
mov    %edx,%ebx
xor    %eax,%eax
call   1030 <read@plt>
test   %ebx,%ebx
je     1147 <mread+0x27>
test   %eax,%eax
jns    1147 <mread+0x27>
lea    0xec7(%rip),%rsi
mov    $0x1,%edi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <error@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Read error\00"
define i32 @mread(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = load i32, i32* %7
%11 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %8, i8* %9, i32 %10)
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %3
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* null)
br label %18
18: ; preds = %16, %13, %3
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@.str = [11 x i8] c"Read error\00"
define i32 @mread(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @read to i32 (i32, i8*, i32, ...)*)(i32 %0, i8* %1, i32 %2)
%5 = icmp slt i32 %4, 0
%6 = icmp ne i32 %2, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @error to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* null)
br label %10
10: ; preds = %8, %3
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ip(char const *);
int /*<<< orphan*/ line();
int /*<<< orphan*/ logtype(char const *);
int /*<<< orphan*/ name(char const *);
int /*<<< orphan*/ space();
int /*<<< orphan*/ string(char *);
void log_merge(const char *addr, const char qtype[2], const char *q) {
  string(" + merge ");
  ip(addr);
  space();
  logtype(qtype);
  space();
  name(q);
  line();
}


x86 assembly (clang, -O0):
<log_merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xe85(%rip),%rdi
call   1040 <string@plt>
mov    -0x8(%rbp),%rdi
call   1080 <ip@plt>
mov    $0x0,%al
call   1030 <space@plt>
mov    -0x10(%rbp),%rdi
call   1060 <logtype@plt>
mov    $0x0,%al
call   1030 <space@plt>
mov    -0x18(%rbp),%rdi
call   1050 <name@plt>
mov    $0x0,%al
call   1070 <line@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_merge>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xe8b(%rip),%rdi
call   1040 <string@plt>
mov    %rbx,%rdi
call   1080 <ip@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    %r15,%rdi
call   1060 <logtype@plt>
xor    %eax,%eax
call   1030 <space@plt>
mov    %r14,%rdi
call   1050 <name@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1070 <line@plt>

LLVM IR (-O0):
@.str = [10 x i8] c" + merge \00"
define void @log_merge(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %4
%9 = call i32 @ip(i8* %8)
%10 = call i32 (...) @space()
%11 = load i8*, i8** %5
%12 = call i32 @logtype(i8* %11)
%13 = call i32 (...) @space()
%14 = load i8*, i8** %6
%15 = call i32 @name(i8* %14)
%16 = call i32 (...) @line()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c" + merge \00"
define void @log_merge(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @ip(i8* %0)
%6 = tail call i32 (...) @space()
%7 = tail call i32 @logtype(i8* %1)
%8 = tail call i32 (...) @space()
%9 = tail call i32 @name(i8* %2)
%10 = tail call i32 (...) @line()
ret void
}
int d_lt_rr2(double a1, double a2) { return !(((a1) < (a2))); }


x86 assembly (clang, -O0):
<d_lt_rr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_lt_rr2>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
ret

LLVM IR (-O0):
define i32 @d_lt_rr2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_lt_rr2(double %0, double %1) {
%3 = fcmp uge double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned char *SHA1(unsigned char const *, size_t, unsigned char *);
unsigned char *libwebsockets_SHA1(const unsigned char *d, size_t n,
                                  unsigned char *md) {
  return SHA1(d, n, md);
}


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

x86 assembly (clang, -O2):
<libwebsockets_SHA1>:
jmp    1030 <SHA1@plt>

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

LLVM IR (-O2):
define i8* @libwebsockets_SHA1(i8* %0, i64 %1, i8* %2) {
%4 = tail call i8* @SHA1(i8* %0, i64 %1, i8* %2)
ret i8* %4
}
void g_date_add_days() {}


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

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

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

LLVM IR (-O2):
define void @g_date_add_days() {
ret void
}
void my_task_not_quite(int foo, char *bar) {}


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

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

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

LLVM IR (-O2):
define void @my_task_not_quite(i32 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int cos(double);
int sin(double);
int md_rot_x(int x0, double pho, int x, int y) {
  return ((int)x0 + (int)(x * cos(pho) + y * sin(pho)));
}


x86 assembly (clang, -O0):
<md_rot_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <cos@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    %eax,%esi
mov    -0x1c(%rbp),%eax
imul   %esi,%edx
add    %edx,%ecx
add    %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md_rot_x>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
movsd  %xmm0,(%rsp)
mov    %edi,%r15d
call   1040 <cos@plt>
mov    %eax,%ebx
imul   %ebp,%ebx
movsd  (%rsp),%xmm0
call   1030 <sin@plt>
imul   %r14d,%eax
add    %r15d,%ebx
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @md_rot_x(i32 %0, double %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store double %1, double* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = load double, double* %6
%12 = call i32 @cos(double %11)
%13 = mul nsw i32 %10, %12
%14 = load i32, i32* %8
%15 = load double, double* %6
%16 = call i32 @sin(double %15)
%17 = mul nsw i32 %14, %16
%18 = add nsw i32 %13, %17
%19 = add nsw i32 %9, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @md_rot_x(i32 %0, double %1, i32 %2, i32 %3) {
%5 = tail call i32 @cos(double %1)
%6 = mul nsw i32 %5, %2
%7 = tail call i32 @sin(double %1)
%8 = mul nsw i32 %7, %3
%9 = add i32 %6, %0
%10 = add i32 %9, %8
ret i32 %10
}
/* Variables and functions */
scalar_t__ syscall(int, int, unsigned int *);
void *clGetExtensionFunctionAddress(const char *func_name) {
  unsigned int sys_args[1];
  sys_args[0] = (unsigned int)func_name;
  return (void *)syscall(325, 1073, sys_args);
}


x86 assembly (clang, -O0):
<clGetExtensionFunctionAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdx
mov    $0x145,%edi
mov    $0x431,%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clGetExtensionFunctionAddress>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x145,%edi
mov    $0x431,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @clGetExtensionFunctionAddress(i8* %0) {
%2 = alloca i8*
%3 = alloca [1 x i32]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%8 = call i64 @syscall(i32 325, i32 1073, i32* %7)
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}

LLVM IR (-O2):
define i8* @clGetExtensionFunctionAddress(i8* %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = ptrtoint i8* %0 to i64
%5 = trunc i64 %4 to i32
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 %5, i32* %6
%7 = call i64 @syscall(i32 325, i32 1073, i32* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}
int main() {
  unsigned char x = 5;
  signed short y = 10;
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x5,-0x5(%rbp)
movw   $0xa,-0x8(%rbp)
movzbl -0x5(%rbp),%eax
movswl -0x8(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i16
store i32 0, i32* %1
store i8 5, i8* %2
store i16 10, i16* %3
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = load i16, i16* %3
%7 = sext i16 %6 to i32
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 15
}
/* Variables and functions */
int /*<<< orphan*/ PrintNestedDependency();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void PrintHelloWorldDynamic(void) {
  fprintf(stderr, "Hello World Dynamic!\n");
  PrintNestedDependency();
}


x86 assembly (clang, -O0):
<PrintHelloWorldDynamic>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <PrintNestedDependency@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintHelloWorldDynamic>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <PrintNestedDependency@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Hello World Dynamic!\0A\00"
define void @PrintHelloWorldDynamic() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @PrintNestedDependency()
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Hello World Dynamic!\0A\00"
define void @PrintHelloWorldDynamic() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @PrintNestedDependency()
ret void
}
int main() {
  register int i;
  char foo[255];
  for (i = 0; i <= 400; i++)
    foo[i] = 42;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x190,-0x8(%rbp)
jg     1140 <main+0x40>
movslq -0x8(%rbp),%rax
movb   $0x2a,-0x110(%rbp,%rax,1)
2a
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    $0x1,%eax
add    $0x90,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [255 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 400
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 %9
store i8 42, i8* %10
br label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ set_ptr(int *, int);
int set_ptr_local_array() {
  int buf[2];
  set_ptr(buf, 1);
  return buf[0];
}


x86 assembly (clang, -O0):
<set_ptr_local_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <set_ptr@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ptr_local_array>:
push   %rax
mov    %rsp,%rdi
mov    $0x1,%esi
call   1030 <set_ptr@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @set_ptr_local_array() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = call i32 @set_ptr(i32* %2, i32 1)
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @set_ptr_local_array() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @set_ptr(i32* %3, i32 1)
%5 = load i32, i32* %3
ret i32 %5
}
void av_q2intfloat() {}


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

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

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

LLVM IR (-O2):
define void @av_q2intfloat() {
ret void
}
int tam_kati(int sayi_bir, int sayi_iki) {
  int tam_kat;
  tam_kat = sayi_iki % sayi_bir;
  if (tam_kat == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<tam_kati>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    112a <tam_kati+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <tam_kati+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tam_kati>:
mov    %esi,%eax
cltd
idiv   %edi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

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

LLVM IR (-O2):
define i32 @tam_kati(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ask_query();
int main() {
  ask_query();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ask_query()
ret i32 0
}
__attribute__((always_)) void dealloc_float(float *p) { __builtin_free(p); }


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

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

LLVM IR (-O0):
define void @dealloc_float(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = bitcast float* %3 to i8*
ret void
}

LLVM IR (-O2):
define void @dealloc_float(float* nocapture %0) {
%2 = bitcast float* %0 to i8*
tail call void @free(i8* %2)
ret void
}
long Long_dec(long x) { return x - 1; }


x86 assembly (clang, -O0):
<Long_dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Long_dec>:
lea    -0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @Long_dec(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 1
ret i64 %4
}

LLVM IR (-O2):
define i64 @Long_dec(i64 %0) {
%2 = add nsw i64 %0, -1
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *stdout;
int open_stdout(FILE **ptr_out) {
  *ptr_out = stdout;
  return 0;
}


x86 assembly (clang, -O0):
<open_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_stdout>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
@stdout = global i32* null
define i32 @open_stdout(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32*, i32** @stdout
%4 = load i32**, i32*** %2
store i32* %3, i32** %4
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32* null
define i32 @open_stdout(i32** nocapture writeonly %0) {
%2 = load i32*, i32** @stdout
store i32* %2, i32** %0
ret i32 0
}
int f(unsigned t) { return (t * 2) / 2; }


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

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

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 2
%5 = udiv i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = and i32 %0, 2147483647
ret i32 %2
}
/* Type definitions */
typedef size_t c;

/* Variables and functions */
int /*<<< orphan*/ xmchout(char);
void zputhex(int c) {
  static char digits[] = "0123456789abcdef";
  xmchout(digits[(c & 0xF0) >> 4]);
  xmchout(digits[(c)&0xF]);
}


x86 assembly (clang, -O0):
<zputhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movslq %eax,%rcx
lea    0x2f00(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <xmchout@plt>
mov    -0x4(%rbp),%eax
and    $0xf,%eax
movslq %eax,%rcx
lea    0x2ee7(%rip),%rax
movsbl (%rax,%rcx,1),%edi
call   1030 <xmchout@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zputhex>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x4,%eax
and    $0xf,%eax
lea    0xedb(%rip),%r14
movsbl (%rax,%r14,1),%edi
call   1030 <xmchout@plt>
and    $0xf,%ebx
movsbl (%rbx,%r14,1),%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xmchout@plt>

LLVM IR (-O0):
@zputhex.digits = internal global [17 x i8] c"0123456789abcdef\00"
define void @zputhex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 240
%5 = ashr i32 %4, 4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = call i32 @xmchout(i8 signext %8)
%10 = load i32, i32* %2
%11 = and i32 %10, 15
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = call i32 @xmchout(i8 signext %14)
ret void
}

LLVM IR (-O2):
@zputhex.digits = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define void @zputhex(i32 %0) {
%2 = lshr i32 %0, 4
%3 = and i32 %2, 15
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = tail call i32 @xmchout(i8 signext %6)
%8 = and i32 %0, 15
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @zputhex.digits, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @xmchout(i8 signext %11)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef size_t uint32_t;

/* Variables and functions */
int /*<<< orphan*/ wchar_to_utf8(int /*<<< orphan*/ const *const,
                                 int /*<<< orphan*/, size_t *);
int /*<<< orphan*/ wcslen(int /*<<< orphan*/ const *const);
size_t ustringPackSize(const wchar_t *const *data) {
  uint32_t out_size;
  if (*data == NULL) {
    out_size = 0;
  } else {
    wchar_to_utf8(*data, wcslen(*data), &out_size);
  }
  return sizeof(uint32_t) + out_size;
}


x86 assembly (clang, -O0):
<ustringPackSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1147 <ustringPackSize+0x27>
movq   $0x0,-0x10(%rbp)
jmp    116d <ustringPackSize+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <wcslen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
lea    -0x10(%rbp),%rdx
call   1030 <wchar_to_utf8@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustringPackSize>:
push   %rbx
sub    $0x10,%rsp
mov    (%rdi),%rbx
test   %rbx,%rbx
je     114f <ustringPackSize+0x2f>
mov    %rbx,%rdi
call   1040 <wcslen@plt>
lea    0x8(%rsp),%rdx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <wchar_to_utf8@plt>
mov    0x8(%rsp),%rax
add    $0x8,%rax
jmp    1154 <ustringPackSize+0x34>
mov    $0x8,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @ustringPackSize(i32** nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = tail call i32 @wcslen(i32* %4)
%8 = call i32 @wchar_to_utf8(i32* %4, i32 %7, i64* %2)
%9 = load i64, i64* %2
%10 = add i64 %9, 8
br label %11
11: ; preds = %1, %6
%12 = phi i64 [ %10, %6 ], [ 8, %1 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ inform_user(char *);
void print_usage(void) {
  inform_user("Usage: conntest [options]\n"
              "  Options:\n"
              "  -id <num>   Process ID.\n"
              "  -s          Server mode\n"
              "  -c          Client mode\n"
              "  -a <port>   Aggregator port\n"
              "  -n <num>    Number of connections.\n"
              "  -t <kbps>   Throughput to aim for in kbps\n"
              "  -l <hostip> Host name/IP address\n"
              "  -p <port>   Server port number\n"
              "  -v          Display version information\n"
              "  -h          Display this text\n\n"
              "For bug reporting and suggestions, mail peter@torpman.se\n");
}


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

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

LLVM IR (-O0):
@.str = [427 x i8] c"Usage: conntest [options]\0A Options:\0A -id <num> Process ID.\0A -s Server mode\0A -c Client mode\0A -a <port> Aggregator port\0A -n <num> Number of connections.\0A -t <kbps> Throughput to aim for in kbps\0A -l <hostip> Host name/IP address\0A -p <port> Server port number\0A -v Display version information\0A -h Display this text\0A\0AFor bug reporting and suggestions, mail peter@torpman.se\0A\00"
define void @print_usage() {
%1 = call i32 @inform_user(i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [427 x i8] c"Usage: conntest [options]\0A Options:\0A -id <num> Process ID.\0A -s Server mode\0A -c Client mode\0A -a <port> Aggregator port\0A -n <num> Number of connections.\0A -t <kbps> Throughput to aim for in kbps\0A -l <hostip> Host name/IP address\0A -p <port> Server port number\0A -v Display version information\0A -h Display this text\0A\0AFor bug reporting and suggestions, mail peter@torpman.se\0A\00"
define void @print_usage() {
%1 = tail call i32 @inform_user(i8* getelementptr inbounds ([427 x i8], [427 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int glSceneCreateTextureTGA(char *fileTGA) {
  unsigned int value = 0;
  return (value);
}


x86 assembly (clang, -O0):
<glSceneCreateTextureTGA>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @glSceneCreateTextureTGA(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void do_wrap_up(int one_times, int another_times) {
  int total;
  total = one_times + another_times;
  printf("All done, one thing %d, another %d for a total of %d\n", one_times,
         another_times, total);
}


x86 assembly (clang, -O0):
<do_wrap_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_wrap_up>:
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%ecx
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"All done, one thing %d, another %d for a total of %d\0A\00"
define void @do_wrap_up(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [54 x i8] c"All done, one thing %d, another %d for a total of %d\0A\00"
define void @do_wrap_up(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void bi_free(void *p) { free(p); }


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

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

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

LLVM IR (-O2):
define void @bi_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void kol_paint_bar(unsigned x, unsigned y, unsigned w, unsigned h, unsigned c) {
  asm("int $0x40" ::"a"(13), "b"(x * 65536 + w), "c"(y * 65536 + h), "d"(c));
}


x86 assembly (clang, -O0):
<kol_paint_bar>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0xc(%rbp),%ebx
shl    $0x10,%ebx
add    -0x14(%rbp),%ebx
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
add    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%edx
mov    $0xd,%eax
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_paint_bar>:
push   %rbx
shl    $0x10,%edi
lea    (%rdi,%rdx,1),%ebx
shl    $0x10,%esi
add    %esi,%ecx
mov    $0xd,%eax
mov    %r8d,%edx
int    $0x40
pop    %rbx
ret

LLVM IR (-O0):
define void @kol_paint_bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%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
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = mul i32 %11, 65536
%13 = load i32, i32* %8
%14 = add i32 %12, %13
%15 = load i32, i32* %7
%16 = mul i32 %15, 65536
%17 = load i32, i32* %9
%18 = add i32 %16, %17
%19 = load i32, i32* %10
ret void
}

LLVM IR (-O2):
define void @kol_paint_bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = shl i32 %0, 16
%7 = add i32 %6, %2
%8 = shl i32 %1, 16
%9 = add i32 %8, %3
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 13, i32 %7, i32 %9, i32 %4)
ret void
}