xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("This is a DHCP Server! Currently in development and non-working\n");
  printf("ngsdhcp [options] [arguments]\n\n");
  printf("-h\t\t\nShows this message\n");
  printf(
      "-c file.conf\t\tWill use the given file as configuration. The default "
      "one is in /etc/ngsdhcp/default.conf // Not implementet yet\n\n\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf3b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"This is a DHCP Server! Currently in development and non-working\0A\00"
@.str.1 = [32 x i8] c"ngsdhcp [options] [arguments]\0A\0A\00"
@.str.2 = [25 x i8] c"-h\09\09\0AShows this message\0A\00"
@.str.3 = [130 x i8] c"-c file.conf\09\09Will use the given file as configuration. The default one is in /etc/ngsdhcp/default.conf // Not implementet yet\0A\0A\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"This is a DHCP Server! Currently in development and non-working\00"
@str.4 = [31 x i8] c"ngsdhcp [options] [arguments]\0A\00"
@str.5 = [24 x i8] c"-h\09\09\0AShows this message\00"
@str.6 = [129 x i8] c"-c file.conf\09\09Will use the given file as configuration. The default one is in /etc/ngsdhcp/default.conf // Not implementet yet\0A\0A\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([129 x i8], [129 x i8]* @str.6, i64 0, i64 0))
ret void
}
int isvaluechar(int c) {
  switch (c) {
  case '\r':
  case '\n':
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isvaluechar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     112c <isvaluechar+0x2c>
jmp    111b <isvaluechar+0x1b>
mov    -0xc(%rbp),%eax
sub    $0xd,%eax
jne    1138 <isvaluechar+0x38>
jmp    112c <isvaluechar+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    113f <isvaluechar+0x3f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isvaluechar>:
cmp    $0xd,%edi
setne  %al
cmp    $0xa,%edi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @isvaluechar(i32 %0) {
%2 = icmp ne i32 %0, 13
%3 = icmp ne i32 %0, 10
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
const uint8_t *get_label_str(const uint8_t *label) { return &label[1]; }


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

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

LLVM IR (-O0):
define i32* @get_label_str(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
ret i32* %4
}

LLVM IR (-O2):
define i32* @get_label_str(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
ret i32* %2
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMRCE_set(void) { return U_WMRCORENONE_set("U_WMRCE"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMRCE\00"
define i8* @U_WMRCE_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMRCE\00"
define i8* @U_WMRCE_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t _EPIIntNumberGet(uint32_t ui32Base) {
  uint32_t ui32Int;
  ;
  ui32Int = 0;
  if ((((*((volatile uint32_t *)(0x400FE000))) & (0x70000000 | 0x00FF0000)) ==
       (0x10000000 | 0x000A0000))) {
    ui32Int = 66;
  }
  return (ui32Int);
}


x86 assembly (clang, -O0):
<_EPIIntNumberGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x400fe000,%eax
mov    (%rax),%eax
and    $0x70ff0000,%eax
cmp    $0x100a0000,%eax
jne    112c <_EPIIntNumberGet+0x2c>
movl   $0x42,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EPIIntNumberGet>:
mov    $0x70ff0000,%eax
and    0x400fe000,%eax
xor    %ecx,%ecx
cmp    $0x100a0000,%eax
mov    $0x42,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_EPIIntNumberGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%5 = and i32 %4, 1895759872
%6 = icmp eq i32 %5, 269090816
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 66, i32* %3
br label %8
8: ; preds = %7, %1
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @_EPIIntNumberGet(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 1074782208 to i32*)
%3 = and i32 %2, 1895759872
%4 = icmp eq i32 %3, 269090816
%5 = select i1 %4, i32 66, i32 0
ret i32 %5
}
int INHERENT_lstat() { return 0; }


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

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

LLVM IR (-O0):
define i32 @INHERENT_lstat() {
ret i32 0
}

LLVM IR (-O2):
define i32 @INHERENT_lstat() {
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_smeankbn(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_smeankbn(N, x, stride);
  printf("mean: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_smeankbn@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_smeankbn@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_smeankbn(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [10 x i8] c"mean: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_smeankbn(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage_b() {
  printf("dwarf-ng-%s (c) Fernando Iazeolla 2007-2013-2017\n", "0.4.0");
  printf("for help type: dwarf --help\n");
}


x86 assembly (clang, -O0):
<usage_b>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf10(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage_b>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf03(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"dwarf-ng-%s (c) Fernando Iazeolla 2007-2013-2017\0A\00"
@.str.1 = [6 x i8] c"0.4.0\00"
@.str.2 = [29 x i8] c"for help type: dwarf --help\0A\00"
define void @usage_b() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"dwarf-ng-%s (c) Fernando Iazeolla 2007-2013-2017\0A\00"
@.str.1 = [6 x i8] c"0.4.0\00"
@str = [28 x i8] c"for help type: dwarf --help\00"
define void @usage_b() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct webidl_node {
  int dummy;
};
struct binding {
  int dummy;
};

/* Variables and functions */
int generate_property_spec(struct binding *, int /*<<< orphan*/);
int /*<<< orphan*/ webidl_node_gettext(struct webidl_node *);
int webidl_property_spec_implements_cb(struct webidl_node *node, void *ctx) {
  struct binding *binding = ctx;
  return generate_property_spec(binding, webidl_node_gettext(node));
}


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

x86 assembly (clang, -O2):
<webidl_property_spec_implements_cb>:
push   %rbx
mov    %rsi,%rbx
call   1030 <webidl_node_gettext@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <generate_property_spec@plt>

LLVM IR (-O0):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_property_spec_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = alloca %struct.webidl_node*
%4 = alloca i8*
%5 = alloca %struct.binding*
store %struct.webidl_node* %0, %struct.webidl_node** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to %struct.binding*
store %struct.binding* %7, %struct.binding** %5
%8 = load %struct.binding*, %struct.binding** %5
%9 = load %struct.webidl_node*, %struct.webidl_node** %3
%10 = call i32 @webidl_node_gettext(%struct.webidl_node* %9)
%11 = call i32 @generate_property_spec(%struct.binding* %8, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.webidl_node = type { i32 }
%struct.binding = type { i32 }
define i32 @webidl_property_spec_implements_cb(%struct.webidl_node* %0, i8* %1) {
%3 = bitcast i8* %1 to %struct.binding*
%4 = tail call i32 @webidl_node_gettext(%struct.webidl_node* %0)
%5 = tail call i32 @generate_property_spec(%struct.binding* %3, i32 %4)
ret i32 %5
}
char *test_func_00(char *p, int *x) {
  int r = 0;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
movsbl (%rdi),%ecx
lea    0x1(%rdi),%rax
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i8* @test_func_00(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %3
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = load i32, i32* %5
%11 = add nsw i32 %10, %9
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
store i32 %12, i32* %13
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @test_func_00(i8* %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %0
%5 = sext i8 %4 to i32
store i32 %5, i32* %1
ret i8* %3
}
int isdelim(char c) {
  if (c == 32 || c == 9 || c == '\n' || c == 0 || c == '\r')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isdelim>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     114b <isdelim+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     114b <isdelim+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     114b <isdelim+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
je     114b <isdelim+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
jne    1157 <isdelim+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <isdelim+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdelim>:
cmp    $0x20,%dil
ja     1120 <isdelim+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002601,%rdx
bt     %rcx,%rdx
jae    1120 <isdelim+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @isdelim(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
i8 0, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
int asn1_item_embed_new(int /*<<< orphan*/ **, int /*<<< orphan*/ const *,
                        int /*<<< orphan*/);
int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it) {
  return asn1_item_embed_new(pval, it, 0);
}


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

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

LLVM IR (-O0):
define i32 @ASN1_item_ex_new(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 @asn1_item_embed_new(i32** %5, i32* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ASN1_item_ex_new(i32** %0, i32* %1) {
%3 = tail call i32 @asn1_item_embed_new(i32** %0, i32* %1, i32 0)
ret i32 %3
}
void RTThreadCreateF(void) {}


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

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

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

LLVM IR (-O2):
define void @RTThreadCreateF() {
ret void
}
/* Variables and functions */
int tolower(int);
__attribute__((visibility("default"))) int trio_to_lower(int source) {
  return tolower(source);
}


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

x86 assembly (clang, -O2):
<trio_to_lower>:
jmp    1030 <tolower@plt>

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

LLVM IR (-O2):
define i32 @trio_to_lower(i32 %0) {
%2 = tail call i32 @tolower(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printChar(char c) { printf("%c", c); }


x86 assembly (clang, -O0):
<printChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printChar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @printChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printChar(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
long long get_arch_specific_mem_size(void) { return -2; }


x86 assembly (clang, -O0):
<get_arch_specific_mem_size>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffffffffffe,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_arch_specific_mem_size>:
mov    $0xfffffffffffffffe,%rax
ret

LLVM IR (-O0):
define i64 @get_arch_specific_mem_size() {
ret i64 -2
}

LLVM IR (-O2):
define i64 @get_arch_specific_mem_size() {
ret i64 -2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a) {
  return (r << 16) | (g << 8) | (b << 0) | (a << 24);
}


x86 assembly (clang, -O0):
<rgba>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x0,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rgba(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = shl i32 %9, 16
%11 = load i32, i32* %6
%12 = shl i32 %11, 8
%13 = or i32 %10, %12
%14 = load i32, i32* %7
%15 = shl i32 %14, 0
%16 = or i32 %13, %15
%17 = load i32, i32* %8
%18 = shl i32 %17, 24
%19 = or i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @rgba(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 16
%6 = shl i32 %1, 8
%7 = or i32 %6, %5
%8 = or i32 %7, %2
%9 = shl i32 %3, 24
%10 = or i32 %8, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ do_64_to_80_tests();
int /*<<< orphan*/ do_80_to_64_tests();
int main(void) {
  do_80_to_64_tests();
  do_64_to_80_tests();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_80_to_64_tests()
%2 = tail call i32 (...) @do_64_to_80_tests()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isxdigit(int);
void t_isxdigit_0x30() {
  Assert_real((isxdigit(48)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              245, ("isxdigit should be 1 for 0"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x30>:
push   %rbp
mov    %rsp,%rbp
mov    $0x30,%edi
call   1030 <isxdigit@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xf5,%edx
lea    0xf66(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x30>:
push   %rax
mov    $0x30,%edi
call   1030 <isxdigit@plt>
lea    0xece(%rip),%rsi
lea    0xf70(%rip),%rcx
mov    %eax,%edi
mov    $0xf5,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for 0\00"
define void @t_isxdigit_0x30() {
%1 = call i32 @isxdigit(i32 48)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 1 for 0\00"
define void @t_isxdigit_0x30() {
%1 = tail call i32 @isxdigit(i32 48)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 245, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
void snprintf() {}


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

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

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

LLVM IR (-O2):
define void @snprintf() {
ret void
}
void *g(void) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @g() {
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxintc(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x18));
}


x86 assembly (clang, -O0):
<write_pxintc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
add    $0x18,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxintc>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010018,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxintc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 24
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxintc(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = getelementptr i8, i8* %5, i64 24
%7 = tail call i32 @writel(i32 %1, i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_WriteCmdStart(int);
void LCD_Cursor(unsigned char column) {
  if (column < 8) {
    LCD_WriteCmdStart(0x80 + column);
  } else {
    LCD_WriteCmdStart(0xB8 + column);
  }
}


x86 assembly (clang, -O0):
<LCD_Cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x8,%eax
jge    113f <LCD_Cursor+0x2f>
movzbl -0x1(%rbp),%edi
add    $0x80,%edi
call   1030 <LCD_WriteCmdStart@plt>
jmp    114e <LCD_Cursor+0x3e>
movzbl -0x1(%rbp),%edi
add    $0xb8,%edi
call   1030 <LCD_WriteCmdStart@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_Cursor>:
lea    0xb8(%rdi),%ecx
mov    %edi,%eax
sub    $0xffffff80,%eax
cmp    $0x8,%dil
cmovae %ecx,%eax
mov    %eax,%edi
jmp    1030 <LCD_WriteCmdStart@plt>

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

LLVM IR (-O2):
define void @LCD_Cursor(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = icmp ult i8 %0, 8
%4 = select i1 %3, i32 128, i32 184
%5 = add nuw nsw i32 %4, %2
%6 = tail call i32 @LCD_WriteCmdStart(i32 %5)
ret void
}
long shift_right(long v, char n) { return v << n; }


x86 assembly (clang, -O0):
<shift_right>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movsbl -0x9(%rbp),%ecx
mov    %ecx,%ecx
shl    %cl,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift_right>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    %cl,%rax
ret

LLVM IR (-O0):
define i64 @shift_right(i64 %0, i8 signext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = zext i32 %7 to i64
%9 = shl i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @shift_right(i64 %0, i8 signext %1) {
%3 = sext i8 %1 to i64
%4 = and i64 %3, 4294967295
%5 = shl i64 %0, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ gmx_current(int, char **);
int main(int argc, char *argv[]) {
  gmx_current(argc, argv);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_current(i32 %0, i8** %1)
ret i32 0
}
double f2(double f) { return __builtin_rint(f); }


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

x86 assembly (clang, -O2):
<f2>:
jmp    1030 <rint@plt>

LLVM IR (-O0):
define double @f2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.rint.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @f2(double %0) {
%2 = tail call double @llvm.rint.f64(double %0)
ret double %2
}
__attribute__((always_)) void check_trace_callback_type_mm_page_free_direct(
    void (*cb)(void *__data, struct page *page, unsigned int order)) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @check_trace_callback_type_mm_page_free_direct(void (i8*, %struct.page*, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ extern_func1_7(int, char *, unsigned long);
void extern_func1_6(int a, char *b, unsigned long c) {
  extern_func1_7(a, b, c);
}


x86 assembly (clang, -O0):
<extern_func1_6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <extern_func1_7@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extern_func1_6>:
jmp    1030 <extern_func1_7@plt>

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

LLVM IR (-O2):
define void @extern_func1_6(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @extern_func1_7(i32 %0, i8* %1, i64 %2)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void memintcopy_lt(void *mem, uint32_t val) {
  ((uint8_t *)mem)[0] = (uint8_t)(val);
  ((uint8_t *)mem)[1] = (uint8_t)(val >> 8);
  ((uint8_t *)mem)[2] = (uint8_t)(val >> 16);
  ((uint8_t *)mem)[3] = (uint8_t)(val >> 24);
}


x86 assembly (clang, -O0):
<memintcopy_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<memintcopy_lt>:
movslq %esi,%rax
mov    %rax,(%rdi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rdi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rdi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rdi)
ret

LLVM IR (-O0):
define void @memintcopy_lt(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 = sext i32 %5 to i64
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = getelementptr inbounds i64, i64* %8, i64 0
store i64 %6, i64* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 8
%12 = sext i32 %11 to i64
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to i64*
%15 = getelementptr inbounds i64, i64* %14, i64 1
store i64 %12, i64* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 16
%18 = sext i32 %17 to i64
%19 = load i8*, i8** %3
%20 = bitcast i8* %19 to i64*
%21 = getelementptr inbounds i64, i64* %20, i64 2
store i64 %18, i64* %21
%22 = load i32, i32* %4
%23 = ashr i32 %22, 24
%24 = sext i32 %23 to i64
%25 = load i8*, i8** %3
%26 = bitcast i8* %25 to i64*
%27 = getelementptr inbounds i64, i64* %26, i64 3
store i64 %24, i64* %27
ret void
}

LLVM IR (-O2):
define void @memintcopy_lt(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = bitcast i8* %0 to i64*
store i64 %3, i64* %4
%5 = ashr i32 %1, 8
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 8
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
%9 = ashr i32 %1, 16
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 16
%12 = bitcast i8* %11 to i64*
store i64 %10, i64* %12
%13 = ashr i32 %1, 24
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 24
%16 = bitcast i8* %15 to i64*
store i64 %14, i64* %16
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int MPI_Isend(const void *buf, int count, int datatype, int source, int tag,
              int comm, int *request) {
  static int callcount = 0;
  if (callcount == 0) {
    printf("MPI Stub WARNING: Should not send message to self\n");
    ++callcount;
  }
  return 0;
}


x86 assembly (clang, -O0):
<MPI_Isend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x0,0x2ef4(%rip)
jne    1159 <MPI_Isend+0x49>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2edc(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ed3(%rip)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Isend>:
push   %rax
cmpl   $0x0,0x2f14(%rip)
jne    112d <MPI_Isend+0x1d>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
addl   $0x1,0x2eff(%rip)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@MPI_Isend.callcount = internal global i32 0
@.str = [51 x i8] c"MPI Stub WARNING: Should not send message to self\0A\00"
define i32 @MPI_Isend(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%15 = load i32, i32* @MPI_Isend.callcount
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %7
%18 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%19 = load i32, i32* @MPI_Isend.callcount
%20 = add nsw i32 %19, 1
store i32 %20, i32* @MPI_Isend.callcount
br label %21
21: ; preds = %17, %7
ret i32 0
}

LLVM IR (-O2):
@MPI_Isend.callcount = internal unnamed_addr global i32 0
@str = [50 x i8] c"MPI Stub WARNING: Should not send message to self\00"
define i32 @MPI_Isend(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32* nocapture readnone %6) {
%8 = load i32, i32* @MPI_Isend.callcount
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @MPI_Isend.callcount
%13 = add nsw i32 %12, 1
store i32 %13, i32* @MPI_Isend.callcount
br label %14
14: ; preds = %10, %7
ret i32 0
}
char *strcpy(char *dst, const char *src) {
  char *d = dst;
  for (;; dst++, src++) {
    *dst = *src;
    if (!*src)
      break;
  }
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1132 <strcpy+0x32>
jmp    1154 <strcpy+0x54>
jmp    1137 <strcpy+0x37>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %cl,(%rdi)
cmpb   $0x0,(%rsi)
je     1131 <strcpy+0x31>
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
cmpb   $0x0,(%rsi,%rcx,1)
lea    0x1(%rcx),%rcx
jne    1120 <strcpy+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
store i8 %3, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %9, %6 ], [ %0, %2 ]
%8 = phi i8* [ %10, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
store i8 %11, i8* %9
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, double);
int main(int argc, const char *argv[]) {
  float num1;
  float num2;
  double sum;
  num1 = 3.141598;
  num2 = 4.58372;
  sum = num1 + num2;
  printf("The Sum of the two numbers %f and %f is %f", num1, num2, sum);
  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)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
movss  0xee0(%rip),%xmm0
movss  0xedc(%rip),%xmm1
movsd  0xed8(%rip),%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"The Sum of the two numbers %f and %f is %f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0x400921FE20000000, float* %6
store float 0x401255BAC0000000, float* %7
%9 = load float, float* %6
%10 = load float, float* %7
%11 = fadd float %9, %10
%12 = fpext float %11 to double
store double %12, double* %8
%13 = load float, float* %6
%14 = load float, float* %7
%15 = load double, double* %8
%16 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float %13, float %14, double %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"The Sum of the two numbers %f and %f is %f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float 0x400921FE20000000, float 0x401255BAC0000000, double 0x401EE6B9C0000000)
ret i32 0
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void simplehttp_ts_get(struct timeval *ts) { gettimeofday(ts, NULL); }


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

x86 assembly (clang, -O2):
<simplehttp_ts_get>:
xor    %esi,%esi
jmp    1030 <gettimeofday@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @simplehttp_ts_get(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @simplehttp_ts_get(%struct.timeval* nocapture %0) {
%2 = tail call i32 @gettimeofday(%struct.timeval* %0, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ungetch(char);
void ungets(char s[]) {
  int i = 0;
  while (s[i] != '\0')
    ungetch(s[i++]);
}


x86 assembly (clang, -O0):
<ungets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <ungets+0x48>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ungetch@plt>
jmp    1123 <ungets+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungets>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ungets+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ungetch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ungets+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ungets(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = add nuw i64 %5, 1
%8 = tail call i32 @ungetch(i8 signext %6)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int abs(int n) { return n >= 0 ? n : -n; }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     111c <abs+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <abs+0x24>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i32 [ %6, %5 ], [ %9, %7 ]
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void handle_56(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_56(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t get_unaligned_be32(const void *ptr) {
  const uint8_t *p = ptr;
  return p[0] << 24 | p[1] << 16 | p[2] << 8 | p[3];
}


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

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

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

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