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

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ skip_1(int /*<<< orphan*/ *);
void skip_upto(FILE *in, int chr) {
  int c;
  while ((c = fgetc(in)) != EOF) {
    if (c == '\\') {
      skip_1(in);
      continue;
    }
    if (c == chr)
      return;
  }
}


x86 assembly (clang, -O0):
<skip_upto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0x10(%rbp)
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%eax
je     1178 <skip_upto+0x58>
cmpl   $0x5c,-0x10(%rbp)
jne    1162 <skip_upto+0x42>
mov    -0x8(%rbp),%rdi
call   1040 <skip_1@plt>
jmp    112f <skip_upto+0xf>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1173 <skip_upto+0x53>
jmp    1178 <skip_upto+0x58>
jmp    112f <skip_upto+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_upto>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    0x2eb2(%rip),%rbp
jmp    1150 <skip_upto+0x30>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <skip_1@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    0x0(%rbp),%eax
je     115f <skip_upto+0x3f>
cmp    $0x5c,%eax
je     1140 <skip_upto+0x20>
cmp    %r14d,%eax
jne    1148 <skip_upto+0x28>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @skip_upto(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %6
6: ; preds = %22, %14, %2
%7 = load i32*, i32** %3
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %6
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 92
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32*, i32** %3
%16 = call i32 @skip_1(i32* %15)
br label %6
17: ; preds = %11
%18 = load i32, i32* %5
%19 = load i32, i32* %4
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17
br label %23
22: ; preds = %17
br label %6
23: ; preds = %21, %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @skip_upto(i32* %0, i32 %1) {
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %17, label %6
6: ; preds = %2, %11
%7 = phi i32 [ %12, %11 ], [ %3, %2 ]
%8 = icmp eq i32 %7, 92
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = tail call i32 @skip_1(i32* %0)
br label %11
11: ; preds = %9, %15
%12 = tail call i32 @fgetc(i32* %0)
%13 = load i32, i32* @EOF
%14 = icmp eq i32 %12, %13
br i1 %14, label %17, label %6
15: ; preds = %6
%16 = icmp eq i32 %7, %1
br i1 %16, label %17, label %11
17: ; preds = %15, %11, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char **argv) {
  unsigned int i;
  for (i = 0; i < 2000000000; i++)
    if (!(i % 1000000))
      printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x77359400,-0x14(%rbp)
jae    1171 <main+0x61>
mov    -0x14(%rbp),%eax
mov    $0xf4240,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    115e <main+0x4e>
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    1163 <main+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
jmp    112b <main+0x1b>
nop
add    $0x1,%ebx
cmp    $0x77359400,%ebx
je     114e <main+0x3e>
mov    %ebx,%eax
imul   $0x431bde83,%rax,%rax
shr    $0x32,%rax
imul   $0xf4240,%eax,%eax
cmp    %ebx,%eax
jne    1120 <main+0x10>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = icmp ult i32 %8, 2000000000
br i1 %9, label %10, label %21
10: ; preds = %7
%11 = load i32, i32* %6
%12 = urem i32 %11, 1000000
%13 = icmp ne i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = load i32, i32* %6
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %14, %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %6
%20 = add i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %9
%4 = phi i32 [ 0, %2 ], [ %10, %9 ]
%5 = urem i32 %4, 1000000
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %9
9: ; preds = %3, %7
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 2000000000
br i1 %11, label %12, label %3
12: ; preds = %9
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ kaatcp_parser_test_suite();
int /*<<< orphan*/ kaatcp_request_test_suite();
int main() {
  kaatcp_request_test_suite();
  kaatcp_parser_test_suite();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @kaatcp_request_test_suite()
%2 = tail call i32 (...) @kaatcp_parser_test_suite()
ret i32 0
}
void marker_bit(text) char *text;
{
  int marker;
  marker = Get_Bits(1);
}


x86 assembly (clang, -O0):
<marker_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <Get_Bits@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<marker_bit>:
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <Get_Bits@plt>

LLVM IR (-O0):
define void @marker_bit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
store i32 %4, i32* %3
ret void
}

LLVM IR (-O2):
define void @marker_bit(i8* nocapture readnone %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @Get_Bits to i32 (i32, ...)*)(i32 1)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
int readmeml(int /*<<< orphan*/, scalar_t__);
uint64_t readmemq(uint32_t s, uint16_t a) {
  uint64_t temp;
  temp = (uint64_t)(readmeml(s, a + 4)) << 32;
  temp |= readmeml(s, a);
  return temp;
}


x86 assembly (clang, -O0):
<readmemq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
add    $0x4,%rsi
call   1030 <readmeml@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <readmeml@plt>
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readmemq>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x4,%rsi
call   1030 <readmeml@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <readmeml@plt>

LLVM IR (-O0):
define i32 @readmemq(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = load i64, i64* %4
%8 = add nsw i64 %7, 4
%9 = call i32 @readmeml(i32 %6, i64 %8)
%10 = shl i32 %9, 32
store i32 %10, i32* %5
%11 = load i32, i32* %3
%12 = load i64, i64* %4
%13 = call i32 @readmeml(i32 %11, i64 %12)
%14 = load i32, i32* %5
%15 = or i32 %14, %13
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @readmemq(i32 %0, i64 %1) {
%3 = add nsw i64 %1, 4
%4 = tail call i32 @readmeml(i32 %0, i64 %3)
%5 = tail call i32 @readmeml(i32 %0, i64 %1)
ret i32 poison
}
int printf(const char *format, ...) {
  char i = *format;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ f(int /*<<< orphan*/);
main() { f(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 0)
ret i32 0
}
/* Variables and functions */
double calcTemp(double);
double calcWave(double);
int findZone(double);
double getObservationHeight();
int /*<<< orphan*/ printResults(double, double, double, int);
int main() {
  double obsHeight = 0.0;
  double temp = 0.0;
  double wave = 0.0;
  int zone = 0;
  obsHeight = getObservationHeight();
  temp = calcTemp(obsHeight);
  wave = calcWave(temp);
  zone = findZone(obsHeight);
  printResults(temp, obsHeight, wave, zone);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    $0x0,%al
call   1060 <getObservationHeight@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <calcTemp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <calcWave@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1070 <findZone@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
mov    -0x24(%rbp),%edi
call   1040 <printResults@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
xor    %eax,%eax
call   1060 <getObservationHeight@plt>
movsd  %xmm0,(%rsp)
call   1050 <calcTemp@plt>
movsd  %xmm0,0x10(%rsp)
call   1030 <calcWave@plt>
movsd  %xmm0,0x8(%rsp)
movsd  (%rsp),%xmm0
call   1070 <findZone@plt>
movsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
mov    %eax,%edi
call   1040 <printResults@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca i32
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store i32 0, i32* %5
%6 = call double (...) @getObservationHeight()
store double %6, double* %2
%7 = load double, double* %2
%8 = call double @calcTemp(double %7)
store double %8, double* %3
%9 = load double, double* %3
%10 = call double @calcWave(double %9)
store double %10, double* %4
%11 = load double, double* %2
%12 = call i32 @findZone(double %11)
store i32 %12, i32* %5
%13 = load double, double* %3
%14 = load double, double* %2
%15 = load double, double* %4
%16 = load i32, i32* %5
%17 = call i32 @printResults(double %13, double %14, double %15, i32 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @getObservationHeight()
%2 = tail call double @calcTemp(double %1)
%3 = tail call double @calcWave(double %2)
%4 = tail call i32 @findZone(double %1)
%5 = tail call i32 @printResults(double %2, double %1, double %3, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ get_port(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
uint8_t get_port_pullups(uint8_t address, uint8_t port) {
  return get_port(address, port, 0x0C, 0x0D);
}


x86 assembly (clang, -O0):
<get_port_pullups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xc,%edx
mov    $0xd,%ecx
call   1030 <get_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_port_pullups>:
mov    $0xc,%edx
mov    $0xd,%ecx
jmp    1030 <get_port@plt>

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

LLVM IR (-O2):
define i32 @get_port_pullups(i32 %0, i32 %1) {
%3 = tail call i32 @get_port(i32 %0, i32 %1, i32 12, i32 13)
ret i32 %3
}
int spmi_dfs_add_controller(struct spmi_controller *ctrl) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.spmi_controller = type opaque
define i32 @spmi_dfs_add_controller(%struct.spmi_controller* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int parse_tags(unsigned char const *, int const, unsigned char **, char *,
               char *);
int parse_parens(const unsigned char *in_str, const int init_pos,
                 unsigned char **out_str) {
  return parse_tags(in_str, init_pos, out_str, "(", ")");
}


x86 assembly (clang, -O0):
<parse_parens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    0xecb(%rip),%rcx
lea    0xec6(%rip),%r8
call   1030 <parse_tags@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_parens>:
lea    0xee9(%rip),%rcx
lea    0xee4(%rip),%r8
jmp    1030 <parse_tags@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c")\00"
define i32 @parse_parens(i8* %0, i32 %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i8**, i8*** %6
%10 = call i32 @parse_tags(i8* %7, i32 %8, i8** %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %10
}

LLVM IR (-O2):
@.str = [2 x i8] c"(\00"
@.str.1 = [2 x i8] c")\00"
define i32 @parse_parens(i8* %0, i32 %1, i8** %2) {
%4 = tail call i32 @parse_tags(i8* %0, i32 %1, i8** %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 %4
}
f(unsigned long long ull) {
  switch (ull) {
  case (signed char)-1:
    return 1;
  case 8:
    return 2;
  }
  return 3;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
sub    $0xffffffffffffffff,%rax
je     1132 <f+0x32>
jmp    111f <f+0x1f>
mov    -0x18(%rbp),%rax
sub    $0x8,%rax
je     113e <f+0x3e>
jmp    114a <f+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <f+0x51>
movl   $0x2,-0x4(%rbp)
jmp    1151 <f+0x51>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %ecx,%ecx
cmp    $0x8,%rdi
sete   %cl
xor    $0x3,%ecx
cmp    $0xffffffffffffffff,%rdi
mov    $0x1,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i64 %0) {
%2 = icmp eq i64 %0, 8
%3 = select i1 %2, i32 2, i32 3
%4 = icmp eq i64 %0, -1
%5 = select i1 %4, i32 1, i32 %3
ret i32 %5
}
unsigned toRep(float x) {
  const union {
    float f;
    unsigned i;
  } rep = {.f = x};
  return rep.i;
}


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

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

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

LLVM IR (-O2):
define i32 @toRep(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
unsigned xrop3_18_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_18_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
mov    %ecx,%edx
xor    $0xffffff00,%edx
or     %eax,%ecx
or     %edx,%ecx
not    %ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_18_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, -256
%8 = or i32 %6, %4
%9 = or i32 %8, %7
%10 = xor i32 %9, -1
%11 = xor i32 %4, -1
%12 = and i32 %11, %5
%13 = or i32 %12, %10
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ GL_FLAT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glShadeModel(int /*<<< orphan*/);
void robot_init(void) {
  glClearColor(0.0, 0.0, 0.0, 0.0);
  glShadeModel(GL_FLAT);
}


x86 assembly (clang, -O0):
<robot_init>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1030 <glClearColor@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <glShadeModel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<robot_init>:
push   %rax
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
call   1030 <glClearColor@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <glShadeModel@plt>

LLVM IR (-O0):
@GL_FLAT = global i32 0
define void @robot_init() {
%1 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = call i32 @glShadeModel(i32 %2)
ret void
}

LLVM IR (-O2):
@GL_FLAT = global i32 0
define void @robot_init() {
%1 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
%2 = load i32, i32* @GL_FLAT
%3 = tail call i32 @glShadeModel(i32 %2)
ret void
}
int $Sub$$_sys_iserror(int status) {
  if (status < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<$Sub$$_sys_iserror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    111d <$Sub$$_sys_iserror+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <$Sub$$_sys_iserror+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<$Sub$$_sys_iserror>:
mov    %edi,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @"$Sub$$_sys_iserror"(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @"$Sub$$_sys_iserror"(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
zero_value(exp, filep, file_red) register char *exp;
register struct filepointer *filep;
register struct inclist *file_red;
{
  if (cppsetup(exp, filep, file_red))
    return (15);
  else
    return (0);
}


x86 assembly (clang, -O0):
<zero_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1030 <cppsetup@plt>
cmp    $0x0,%eax
je     114c <zero_value+0x3c>
movl   $0xf,-0x4(%rbp)
jmp    1153 <zero_value+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_value>:
push   %rax
xor    %eax,%eax
call   1030 <cppsetup@plt>
test   %eax,%eax
mov    $0xf,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.filepointer = type opaque
%struct.inclist = type opaque
define i32 @zero_value(i8* %0, %struct.filepointer* %1, %struct.inclist* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca %struct.filepointer*
%7 = alloca %struct.inclist*
store i8* %0, i8** %5
store %struct.filepointer* %1, %struct.filepointer** %6
store %struct.inclist* %2, %struct.inclist** %7
%8 = load i8*, i8** %5
%9 = load %struct.filepointer*, %struct.filepointer** %6
%10 = load %struct.inclist*, %struct.inclist** %7
%11 = call i32 (i8*, %struct.filepointer*, %struct.inclist*, ...) bitcast (i32 (...)* @cppsetup to i32 (i8*, %struct.filepointer*, %struct.inclist*, ...)*)(i8* %8, %struct.filepointer* %9, %struct.inclist* %10)
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 15, i32* %4
br label %15
14: ; preds = %3
store i32 0, i32* %4
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
%struct.filepointer = type opaque
%struct.inclist = type opaque
define i32 @zero_value(i8* %0, %struct.filepointer* %1, %struct.inclist* %2) {
%4 = tail call i32 (i8*, %struct.filepointer*, %struct.inclist*, ...) bitcast (i32 (...)* @cppsetup to i32 (i8*, %struct.filepointer*, %struct.inclist*, ...)*)(i8* %0, %struct.filepointer* %1, %struct.inclist* %2)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 0, i32 15
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_int(int *a, int tam) {
  int i;
  for (i = 0; i < tam; i++)
    printf("%d, ", a[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_int+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_int+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_int+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_int+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @print_int(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int my_is_prime(int nb) {
  int i;
  int result;
  i = 2;
  if (nb <= 0 || nb == 1)
    return (0);
  while (i < nb) {
    result = nb / i;
    if (result * i == nb)
      return (0);
    i++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1122 <my_is_prime+0x22>
cmpl   $0x1,-0x8(%rbp)
jne    112e <my_is_prime+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    117a <my_is_prime+0x7a>
jmp    1133 <my_is_prime+0x33>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1173 <my_is_prime+0x73>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1165 <my_is_prime+0x65>
movl   $0x0,-0x4(%rbp)
jmp    117a <my_is_prime+0x7a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <my_is_prime+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <my_is_prime+0xa>
mov    %ecx,%eax
ret
jne    1112 <my_is_prime+0x12>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <my_is_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <my_is_prime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @my_is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %12, label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
char cc_format_pos_file(int const i) {
  if ((i < (0)) || ((25) < i))
    return '?';
  return (char)('a' + i);
}


x86 assembly (clang, -O0):
<cc_format_pos_file>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111f <cc_format_pos_file+0x1f>
mov    $0x19,%eax
cmp    -0x8(%rbp),%eax
jge    1128 <cc_format_pos_file+0x28>
movb   $0x3f,-0x1(%rbp)
jmp    1131 <cc_format_pos_file+0x31>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_format_pos_file>:
lea    0x61(%rdi),%eax
cmp    $0x1a,%edi
movzbl %al,%ecx
mov    $0x3f,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @cc_format_pos_file(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 25, %7
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i8 63, i8* %2
br label %14
10: ; preds = %6
%11 = load i32, i32* %3
%12 = add nsw i32 97, %11
%13 = trunc i32 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %10, %9
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @cc_format_pos_file(i32 %0) {
%2 = icmp ugt i32 %0, 25
%3 = trunc i32 %0 to i8
%4 = add i8 %3, 97
%5 = select i1 %2, i8 63, i8 %4
ret i8 %5
}
void reset_vma_resv_huge_pages(struct vm_area_struct *vma) {}


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

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

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

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
define void @reset_vma_resv_huge_pages(%struct.vm_area_struct* nocapture %0) {
ret void
}
/* Variables and functions */
scalar_t__ calloc(size_t const, size_t const);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *getmem(const size_t leng, const size_t size) {
  char *p = NULL;
  if ((p = (char *)calloc(leng, size)) == NULL) {
    fprintf(stderr, "Cannot allocate memory!\n");
    exit(3);
  }
  return (p);
}


x86 assembly (clang, -O0):
<getmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1182 <getmem+0x52>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmem>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <getmem+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"Cannot allocate memory!\0A\00"
define i8* @getmem(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
store i8* null, i8** %5
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i64 @calloc(i64 %6, i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 3)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"Cannot allocate memory!\0A\00"
define i8* @getmem(i64 %0, i64 %1) {
%3 = tail call i64 @calloc(i64 %0, i64 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 3)
unreachable
9: ; preds = %2
%10 = inttoptr i64 %3 to i8*
ret i8* %10
}
__attribute__((weak)) void SPI0_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<SPI0_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <SPI0_IrqHandler+0x9>
jmp    1109 <SPI0_IrqHandler+0x9>

x86 assembly (clang, -O2):
<SPI0_IrqHandler>:
jmp    1100 <SPI0_IrqHandler>

LLVM IR (-O0):
define weak void @SPI0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @SPI0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
unsigned short float2half(float);
float half2float(unsigned short);
unsigned short add(unsigned short a, unsigned short b) {
  float op1 = half2float(a);
  float op2 = half2float(b);
  return float2half(op1 + op2);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%edi
call   1040 <half2float@plt>
movss  %xmm0,-0x8(%rbp)
movzwl -0x4(%rbp),%edi
call   1040 <half2float@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0xc(%rbp),%xmm0
call   1030 <float2half@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
call   1040 <half2float@plt>
movss  %xmm0,0xc(%rsp)
mov    %ebx,%edi
call   1040 <half2float@plt>
addss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1030 <float2half@plt>

LLVM IR (-O0):
define zeroext i16 @add(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca float
%6 = alloca float
store i16 %0, i16* %3
store i16 %1, i16* %4
%7 = load i16, i16* %3
%8 = call float @half2float(i16 zeroext %7)
store float %8, float* %5
%9 = load i16, i16* %4
%10 = call float @half2float(i16 zeroext %9)
store float %10, float* %6
%11 = load float, float* %5
%12 = load float, float* %6
%13 = fadd float %11, %12
%14 = call zeroext i16 @float2half(float %13)
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @add(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call float @half2float(i16 zeroext %0)
%4 = tail call float @half2float(i16 zeroext %1)
%5 = fadd float %3, %4
%6 = tail call zeroext i16 @float2half(float %5)
ret i16 %6
}
int test_imm_87uint32_reg(unsigned int val) {
  return ((val) & (0x87 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_87uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x87,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_87uint32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 135
%5 = icmp ne i32 %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_87uint32_reg(i32 %0) {
%2 = and i32 %0, 135
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ armRaiseSafe(int);
void armCompactSafe() { armRaiseSafe(180); }


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

x86 assembly (clang, -O2):
<armCompactSafe>:
mov    $0xb4,%edi
jmp    1030 <armRaiseSafe@plt>

LLVM IR (-O0):
define void @armCompactSafe() {
%1 = call i32 @armRaiseSafe(i32 180)
ret void
}

LLVM IR (-O2):
define void @armCompactSafe() {
%1 = tail call i32 @armRaiseSafe(i32 180)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *, char *, char *);
int /*<<< orphan*/ fail(char *);
int /*<<< orphan*/ match(char);
scalar_t__ strlen(char *);
void doBreak(char *exitLabel) {
  match('b');
  if (NULL == exitLabel || 0 == strlen(exitLabel))
    fail("No loop to break from");
  else
    emitln("jmp\t%s\t#BREAK to %s", exitLabel, exitLabel);
}


x86 assembly (clang, -O0):
<doBreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x62,%edi
call   1060 <match@plt>
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1179 <doBreak+0x39>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    118a <doBreak+0x4a>
lea    0xe80(%rip),%rdi
call   1040 <fail@plt>
jmp    119e <doBreak+0x5e>
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rdx
lea    0xe7d(%rip),%rdi
call   1030 <emitln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doBreak>:
push   %rbx
mov    %rdi,%rbx
mov    $0x62,%edi
call   1050 <match@plt>
test   %rbx,%rbx
je     115b <doBreak+0x2b>
cmpb   $0x0,(%rbx)
je     115b <doBreak+0x2b>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <emitln@plt>
lea    0xe9e(%rip),%rdi
pop    %rbx
jmp    1040 <fail@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"No loop to break from\00"
@.str.1 = [20 x i8] c"jmp\09%s\09#BREAK to %s\00"
define void @doBreak(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @match(i8 signext 98)
%4 = load i8*, i8** %2
%5 = icmp eq i8* null, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
%9 = icmp eq i64 0, %8
br i1 %9, label %10, label %12
10: ; preds = %6, %1
%11 = call i32 @fail(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %16
12: ; preds = %6
%13 = load i8*, i8** %2
%14 = load i8*, i8** %2
%15 = call i32 @emitln(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"No loop to break from\00"
@.str.1 = [20 x i8] c"jmp\09%s\09#BREAK to %s\00"
define void @doBreak(i8* %0) {
%2 = tail call i32 @match(i8 signext 98)
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4, %1
%8 = tail call i32 @fail(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %4
%10 = tail call i32 @emitln(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %0)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
int fixup_db_avp(void **, int, int /*<<< orphan*/);
int fixup_db_store_avp(void **param, int param_no) {
  return fixup_db_avp(param, param_no, 0);
}


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

x86 assembly (clang, -O2):
<fixup_db_store_avp>:
xor    %edx,%edx
jmp    1030 <fixup_db_avp@plt>

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

LLVM IR (-O2):
define i32 @fixup_db_store_avp(i8** %0, i32 %1) {
%3 = tail call i32 @fixup_db_avp(i8** %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int countChars(char *, char);
int /*<<< orphan*/ escCopy(char *, char *, char, char);
char *needMem(int);
int strlen(char *);
char *makeEscapedString(char *in, char toEscape) {
  int newSize = strlen(in) + countChars(in, toEscape);
  char *out = needMem(newSize + 1);
  escCopy(in, out, toEscape, '\\');
  return out;
}


x86 assembly (clang, -O0):
<makeEscapedString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1060 <countChars@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
add    $0x1,%edi
call   1050 <needMem@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x5c,%ecx
movsbl -0x9(%rbp),%edx
call   1040 <escCopy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeEscapedString>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    %r15d,%esi
call   1060 <countChars@plt>
lea    (%r14,%rax,1),%edi
add    $0x1,%edi
call   1050 <needMem@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %rax,%rsi
mov    %r15d,%edx
mov    $0x5c,%ecx
call   1040 <escCopy@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @makeEscapedString(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8 %1, i8* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8, i8* %4
%11 = call i32 @countChars(i8* %9, i8 signext %10)
%12 = add nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = call i8* @needMem(i32 %14)
store i8* %15, i8** %6
%16 = load i8*, i8** %3
%17 = load i8*, i8** %6
%18 = load i8, i8* %4
%19 = call i32 @escCopy(i8* %16, i8* %17, i8 signext %18, i8 signext 92)
%20 = load i8*, i8** %6
ret i8* %20
}

LLVM IR (-O2):
define i8* @makeEscapedString(i8* %0, i8 signext %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @countChars(i8* %0, i8 signext %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i8* @needMem(i32 %6)
%8 = tail call i32 @escCopy(i8* %0, i8* %7, i8 signext %1, i8 signext 92)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ _response(char const *);
void _stat_error2_501(void) {
  const char msg[] = "501 Diretory or file name is too long.\r\n";
  _response(msg);
}


x86 assembly (clang, -O0):
<_stat_error2_501>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x29,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
call   1030 <_response@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stat_error2_501>:
sub    $0x38,%rsp
movups 0xefe(%rip),%xmm0
movups %xmm0,0x19(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <_response@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const._stat_error2_501.msg = [41 x i8] c"501 Diretory or file name is too long.\0D\0A\00"
define void @_stat_error2_501() {
%1 = alloca [41 x i8]
%2 = bitcast [41 x i8]* %1 to i8*
%3 = getelementptr inbounds [41 x i8], [41 x i8]* %1, i64 0, i64 0
%4 = call i32 @_response(i8* %3)
ret void
}

LLVM IR (-O2):
@__const._stat_error2_501.msg = [41 x i8] c"501 Diretory or file name is too long.\0D\0A\00"
define void @_stat_error2_501() {
%1 = alloca [41 x i8]
%2 = getelementptr inbounds [41 x i8], [41 x i8]* %1, i64 0, i64 0
%3 = call i32 @_response(i8* %2)
ret void
}