xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ BlankLine();
int /*<<< orphan*/ Emit(char *);
int /*<<< orphan*/ EmitUnitTesterBody();
int /*<<< orphan*/ ListExternalFunctions();
int /*<<< orphan*/ ListHeaderFiles();
void EmitCutCheck() {
  Emit("/* Automatically generated: DO NOT MODIFY. */");
  ListHeaderFiles();
  BlankLine();
  ListExternalFunctions();
  BlankLine();
  EmitUnitTesterBody();
}


x86 assembly (clang, -O0):
<EmitCutCheck>:
push   %rbp
mov    %rsp,%rbp
lea    0xea5(%rip),%rdi
call   1050 <Emit@plt>
mov    $0x0,%al
call   1040 <ListHeaderFiles@plt>
mov    $0x0,%al
call   1030 <BlankLine@plt>
mov    $0x0,%al
call   1070 <ListExternalFunctions@plt>
mov    $0x0,%al
call   1030 <BlankLine@plt>
mov    $0x0,%al
call   1060 <EmitUnitTesterBody@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EmitCutCheck>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <Emit@plt>
xor    %eax,%eax
call   1040 <ListHeaderFiles@plt>
xor    %eax,%eax
call   1030 <BlankLine@plt>
xor    %eax,%eax
call   1070 <ListExternalFunctions@plt>
xor    %eax,%eax
call   1030 <BlankLine@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <EmitUnitTesterBody@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"/* Automatically generated: DO NOT MODIFY. */\00"
define void @EmitCutCheck() {
%1 = call i32 @Emit(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @ListHeaderFiles()
%3 = call i32 (...) @BlankLine()
%4 = call i32 (...) @ListExternalFunctions()
%5 = call i32 (...) @BlankLine()
%6 = call i32 (...) @EmitUnitTesterBody()
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"/* Automatically generated: DO NOT MODIFY. */\00"
define void @EmitCutCheck() {
%1 = tail call i32 @Emit(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @ListHeaderFiles()
%3 = tail call i32 (...) @BlankLine()
%4 = tail call i32 (...) @ListExternalFunctions()
%5 = tail call i32 (...) @BlankLine()
%6 = tail call i32 (...) @EmitUnitTesterBody()
ret void
}
void node_cleanup(void *p) {}


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

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

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

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

/* Variables and functions */
uint16_t nrf_drv_radio802154_tx_duration_get(uint8_t psdu_length,
                                             bool ack_requested) {
  uint16_t result = 12 + 8 + 12 + 10;
  result += (psdu_length + 1) * 2;
  if (ack_requested) {
    result += (20 + 12 + 10 + (6 * 2));
  }
  result *= 16;
  return result;
}


x86 assembly (clang, -O0):
<nrf_drv_radio802154_tx_duration_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x2a,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1133 <nrf_drv_radio802154_tx_duration_get+0x33>
mov    -0xc(%rbp),%eax
add    $0x36,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_drv_radio802154_tx_duration_get>:
test   %esi,%esi
lea    0x2c(%rdi,%rdi,1),%ecx
lea    0x62(%rdi,%rdi,1),%eax
cmove  %ecx,%eax
shl    $0x4,%eax
ret

LLVM IR (-O0):
define i32 @nrf_drv_radio802154_tx_duration_get(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 42, i32* %5
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
%8 = mul nsw i32 %7, 2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, %8
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 54
store i32 %15, i32* %5
br label %16
16: ; preds = %13, %2
%17 = load i32, i32* %5
%18 = mul nsw i32 %17, 16
store i32 %18, i32* %5
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
define i32 @nrf_drv_radio802154_tx_duration_get(i32 %0, i32 %1) {
%3 = shl i32 %0, 1
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i32 44, i32 98
%6 = add i32 %5, %3
%7 = shl nsw i32 %6, 4
ret i32 %7
}
int symbol_name_char(char c) {
  return c != '(' && c != ')' && c != ' ' && c != '\t' && c != '\n';
}


x86 assembly (clang, -O0):
<symbol_name_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x28,%ecx
mov    %al,-0x2(%rbp)
je     115f <symbol_name_char+0x5f>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x29,%ecx
mov    %al,-0x2(%rbp)
je     115f <symbol_name_char+0x5f>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     115f <symbol_name_char+0x5f>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     115f <symbol_name_char+0x5f>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol_name_char>:
cmp    $0x29,%dil
ja     111d <symbol_name_char+0x1d>
xor    %eax,%eax
movzbl %dil,%ecx
movabs $0x30100000200,%rdx
bt     %rcx,%rdx
jae    111d <symbol_name_char+0x1d>
ret
xor    %eax,%eax
cmp    $0xa,%dil
setne  %al
ret

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

LLVM IR (-O2):
define i32 @symbol_name_char(i8 signext %0) {
switch i8 %0, label %2 [
i8 41, label %5
i8 40, label %5
i8 32, label %5
i8 9, label %5
]
2: ; preds = %1
%3 = icmp ne i8 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %2
%6 = phi i32 [ 0, %1 ], [ %4, %2 ], [ 0, %1 ], [ 0, %1 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int maxSubArray(int *, int);
int /*<<< orphan*/ printf(char *, int);
void test(int *arr, int c) { printf("%d\n", maxSubArray(arr, c)); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <maxSubArray@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
call   1040 <maxSubArray@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @test(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 @maxSubArray(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @test(i32* %0, i32 %1) {
%3 = tail call i32 @maxSubArray(i32* %0, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
void _enable() { return; }


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

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

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

LLVM IR (-O2):
define void @_enable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void printUsage(char *appname) {
  char *usage =
      "%s usage:\n\n"
      "\t-h                 Print help\n"
      "\t-d <device name>   Serial port device (default: /dev/ttyS0)\n"
      "\t-a <address>       IP address (default: 127.0.0.1)\n"
      "\t-p <port>          UDP port (default: 9999)\n"
      "\t-i <init cmd>      RFM12i initialization command (default: 8b 200g)\n";
  fprintf(stderr, usage, appname);
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [270 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> IP address (default: 127.0.0.1)\0A\09-p <port> UDP port (default: 9999)\0A\09-i <init cmd> RFM12i initialization command (default: 8b 200g)\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([270 x i8], [270 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = call i32 @fprintf(i32 %4, i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [270 x i8] c"%s usage:\0A\0A\09-h Print help\0A\09-d <device name> Serial port device (default: /dev/ttyS0)\0A\09-a <address> IP address (default: 127.0.0.1)\0A\09-p <port> UDP port (default: 9999)\0A\09-i <init cmd> RFM12i initialization command (default: 8b 200g)\0A\00"
@stderr = global i32 0
define void @printUsage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([270 x i8], [270 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void badusage(void) {
  fprintf(stderr, "Usage: fsalabmin [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h] "
                  "[filename]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badusage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<badusage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: fsalabmin [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h] [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"Usage: fsalabmin [-ip d/s] [-op d/s] [-silent] [-v] [-l/-h] [filename]\0A\00"
define void @badusage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int square(int);
void main() { printf("Square of %d is %d\n", 5, square(5)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <square@plt>
mov    %eax,%edx
lea    0xec9(%rip),%rdi
mov    $0x5,%esi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1030 <square@plt>
lea    0xece(%rip),%rdi
mov    $0x5,%esi
mov    %eax,%edx
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Square of %d is %d\0A\00"
define void @main() {
%1 = call i32 @square(i32 5)
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Square of %d is %d\0A\00"
define void @main() {
%1 = tail call i32 @square(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 5, i32 %1)
ret void
}
/* Type definitions */
struct json_encoder {
  int dummy;
};

/* Variables and functions */
int json_encode_object_key(struct json_encoder *, char *);
int json_encode_array_name(struct json_encoder *encoder, char *name) {
  return json_encode_object_key(encoder, name);
}


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

x86 assembly (clang, -O2):
<json_encode_array_name>:
jmp    1030 <json_encode_object_key@plt>

LLVM IR (-O0):
%struct.json_encoder = type { i32 }
define i32 @json_encode_array_name(%struct.json_encoder* %0, i8* %1) {
%3 = alloca %struct.json_encoder*
%4 = alloca i8*
store %struct.json_encoder* %0, %struct.json_encoder** %3
store i8* %1, i8** %4
%5 = load %struct.json_encoder*, %struct.json_encoder** %3
%6 = load i8*, i8** %4
%7 = call i32 @json_encode_object_key(%struct.json_encoder* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.json_encoder = type { i32 }
define i32 @json_encode_array_name(%struct.json_encoder* %0, i8* %1) {
%3 = tail call i32 @json_encode_object_key(%struct.json_encoder* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_baudrate(int baud) { return (make_return_packet(0)); }


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

x86 assembly (clang, -O2):
<gdb_baudrate>:
xor    %edi,%edi
jmp    1030 <make_return_packet@plt>

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

LLVM IR (-O2):
define i8* @gdb_baudrate(i32 %0) {
%2 = tail call i8* @make_return_packet(i32 0)
ret i8* %2
}
/* Variables and functions */
int GET32(int);
unsigned int uart_recv(void) {
  while (1) {
    if (GET32(0x20215054) & 0x01)
      break;
  }
  return (GET32(0x20215040) & 0xFF);
}


x86 assembly (clang, -O0):
<uart_recv>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <uart_recv+0x9>
mov    $0x20215054,%edi
call   1030 <GET32@plt>
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <uart_recv+0x24>
jmp    1139 <uart_recv+0x29>
jmp    1119 <uart_recv+0x9>
mov    $0x20215040,%edi
call   1030 <GET32@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_recv>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x20215054,%edi
call   1030 <GET32@plt>
test   $0x1,%al
je     1120 <uart_recv+0x10>
mov    $0x20215040,%edi
call   1030 <GET32@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @uart_recv() {
br label %1
1: ; preds = %0, %6
%2 = call i32 @GET32(i32 539054164)
%3 = and i32 %2, 1
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %7
6: ; preds = %1
br label %1
7: ; preds = %5
%8 = call i32 @GET32(i32 539054144)
%9 = and i32 %8, 255
ret i32 %9
}

LLVM IR (-O2):
define i32 @uart_recv() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @GET32(i32 539054164)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = tail call i32 @GET32(i32 539054144)
%7 = and i32 %6, 255
ret i32 %7
}
int compareInt(void *a, void *b) { return *((int *)a) - *((int *)b); }


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

x86 assembly (clang, -O2):
<compareInt>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareInt(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compareInt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int8_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ FlattenFloat(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                float);
size_t i32_to_be_buf(int /*<<< orphan*/ *, int /*<<< orphan*/);
size_t SerializeFloat(uint8_t *buf, float number) {
  int32_t mant;
  int8_t exp;
  size_t result = 0;
  FlattenFloat(&mant, &exp, number);
  result = i32_to_be_buf(buf, mant);
  buf[result] = exp;
  result += sizeof(uint8_t);
  return result;
}


x86 assembly (clang, -O0):
<SerializeFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movq   $0x0,-0x20(%rbp)
movss  -0xc(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <FlattenFloat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <i32_to_be_buf@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SerializeFloat>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <FlattenFloat@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <i32_to_be_buf@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx,%rax,4)
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @SerializeFloat(i32* %0, float %1) {
%3 = alloca i32*
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32* %0, i32** %3
store float %1, float* %4
store i64 0, i64* %7
%8 = load float, float* %4
%9 = call i32 @FlattenFloat(i32* %5, i32* %6, float %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %5
%12 = call i64 @i32_to_be_buf(i32* %10, i32 %11)
store i64 %12, i64* %7
%13 = load i32, i32* %6
%14 = load i32*, i32** %3
%15 = load i64, i64* %7
%16 = getelementptr inbounds i32, i32* %14, i64 %15
store i32 %13, i32* %16
%17 = load i64, i64* %7
%18 = add i64 %17, 4
store i64 %18, i64* %7
%19 = load i64, i64* %7
ret i64 %19
}

LLVM IR (-O2):
define i64 @SerializeFloat(i32* %0, float %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @FlattenFloat(i32* %3, i32* %4, float %1)
%8 = load i32, i32* %3
%9 = call i64 @i32_to_be_buf(i32* %0, i32 %8)
%10 = load i32, i32* %4
%11 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %10, i32* %11
%12 = add i64 %9, 4
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void TAMP_STAMP_IRQHandler() { default_handler(); }


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

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

LLVM IR (-O0):
define weak void @TAMP_STAMP_IRQHandler() {
%1 = call i32 (...) @default_handler()
ret void
}

LLVM IR (-O2):
define weak void @TAMP_STAMP_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
int execute_ftime() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_ftime() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int y;
};
typedef TYPE_1__ XGraphicsExposeEvent;

/* Variables and functions */
void set_XGraphicsExposeEvent_y(void *_p, int _v) {
  ((XGraphicsExposeEvent *)_p)->y = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XGraphicsExposeEvent_y>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGraphicsExposeEvent_y(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 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGraphicsExposeEvent_y(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Type definitions */
struct fsm {
  int dummy;
};

/* Variables and functions */
struct fsm *fsm_subset(struct fsm *, int);
struct fsm *fsm_epsilon_remove(struct fsm *net) {
  return (fsm_subset(net, 1));
}


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

x86 assembly (clang, -O2):
<fsm_epsilon_remove>:
mov    $0x1,%esi
jmp    1030 <fsm_subset@plt>

LLVM IR (-O0):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_epsilon_remove(%struct.fsm* %0) {
%2 = alloca %struct.fsm*
store %struct.fsm* %0, %struct.fsm** %2
%3 = load %struct.fsm*, %struct.fsm** %2
%4 = call %struct.fsm* @fsm_subset(%struct.fsm* %3, i32 1)
ret %struct.fsm* %4
}

LLVM IR (-O2):
%struct.fsm = type { i32 }
define %struct.fsm* @fsm_epsilon_remove(%struct.fsm* %0) {
%2 = tail call %struct.fsm* @fsm_subset(%struct.fsm* %0, i32 1)
ret %struct.fsm* %2
}
/* Variables and functions */
int /*<<< orphan*/ consumo(int, int);
int /*<<< orphan*/ printf(char *);
main() {
  printf("Um carro que percorreu 50km e gastou 5 litros faz ");
  consumo(50, 5);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"Um carro que percorreu 50km e gastou 5 litros faz \00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @consumo(i32 50, i32 5)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"Um carro que percorreu 50km e gastou 5 litros faz \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @consumo(i32 50, i32 5)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
tCompare(const void *one, const void *two) {
  return strcmp((char *)one, (char *)two);
}


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

x86 assembly (clang, -O2):
<tCompare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @tCompare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
double position2Av(const double x, const double dens, const double Z) {
  const double NH = x * dens;
  return 5.34e-22 * NH * Z;
}


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

x86 assembly (clang, -O2):
<position2Av>:
mulsd  %xmm1,%xmm0
mulsd  0xef4(%rip),%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @position2Av(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fmul double %8, %9
store double %10, double* %7
%11 = load double, double* %7
%12 = fmul double 5.340000e-22, %11
%13 = load double, double* %6
%14 = fmul double %12, %13
ret double %14
}

LLVM IR (-O2):
define double @position2Av(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fmul double %4, 5.340000e-22
%6 = fmul double %5, %2
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/
DefineIntegratedMotorEncoderPID(int, double, int /*<<< orphan*/, double, int);
int /*<<< orphan*/ StartIntegratedMotorEncoderPID(int, int /*<<< orphan*/);
int /*<<< orphan*/ resetIME(int);
void initIMEProc(int motor, int withPID, int tol) {
  resetIME(motor);
  if (withPID == 1) {
    DefineIntegratedMotorEncoderPID(motor, 0.5, 0, 0.3, tol);
    StartIntegratedMotorEncoderPID(motor, 0);
  }
}


x86 assembly (clang, -O0):
<initIMEProc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <resetIME@plt>
cmpl   $0x1,-0x8(%rbp)
jne    117a <initIMEProc+0x4a>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%edx
movsd  0xe9f(%rip),%xmm0
xor    %esi,%esi
movsd  0xe9d(%rip),%xmm1
call   1050 <DefineIntegratedMotorEncoderPID@plt>
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1030 <StartIntegratedMotorEncoderPID@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initIMEProc>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <resetIME@plt>
cmp    $0x1,%ebp
jne    116e <initIMEProc+0x3e>
movsd  0xeb3(%rip),%xmm0
movsd  0xeb3(%rip),%xmm1
mov    %ebx,%edi
xor    %esi,%esi
mov    %r14d,%edx
call   1050 <DefineIntegratedMotorEncoderPID@plt>
mov    %ebx,%edi
xor    %esi,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <StartIntegratedMotorEncoderPID@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @initIMEProc(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = call i32 @resetIME(i32 %7)
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %17
11: ; preds = %3
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = call i32 @DefineIntegratedMotorEncoderPID(i32 %12, double 5.000000e-01, i32 0, double 3.000000e-01, i32 %13)
%15 = load i32, i32* %4
%16 = call i32 @StartIntegratedMotorEncoderPID(i32 %15, i32 0)
br label %17
17: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @initIMEProc(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @resetIME(i32 %0)
%5 = icmp eq i32 %1, 1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @DefineIntegratedMotorEncoderPID(i32 %0, double 5.000000e-01, i32 0, double 3.000000e-01, i32 %2)
%8 = tail call i32 @StartIntegratedMotorEncoderPID(i32 %0, i32 0)
br label %9
9: ; preds = %6, %3
ret void
}
int ler_quantidade_de_jogadores() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ler_quantidade_de_jogadores() {
ret i32 0
}
void kunmap_high(struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.page = type opaque
define void @kunmap_high(%struct.page* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int errno;
scalar_t__ setsid();
int _create_new_session(void) {
  pid_t sid;
  sid = setsid();
  if (sid < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<_create_new_session>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <setsid@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jge    1141 <_create_new_session+0x31>
xor    %eax,%eax
mov    0x2ea9(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1148 <_create_new_session+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_create_new_session>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <setsid@plt>
mov    0x2ebf(%rip),%rcx
sub    (%rcx),%ebx
sar    $0x3f,%rax
and    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i32 0
define i32 @_create_new_session() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @setsid()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
store i32 %8, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@errno = global i32 0
define i32 @_create_new_session() {
%1 = tail call i64 (...) @setsid()
%2 = icmp slt i64 %1, 0
%3 = load i32, i32* @errno
%4 = sub nsw i32 0, %3
%5 = select i1 %2, i32 %4, i32 0
ret i32 %5
}
void MIDI_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @MIDI_setup() {
ret void
}
void vp3054_i2c_remove(struct cx8802_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.cx8802_dev = type opaque
define void @vp3054_i2c_remove(%struct.cx8802_dev* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ multosBinToHex(unsigned char *, char *, int);
void multosWordToHex(unsigned short w, char *hexOut) {
  unsigned char bin[2];
  bin[0] = w / 256;
  bin[1] = w;
  multosBinToHex(bin, hexOut, 2);
}


x86 assembly (clang, -O0):
<multosWordToHex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %al,-0x12(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x11(%rbp)
lea    -0x12(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x2,%edx
call   1030 <multosBinToHex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multosWordToHex>:
push   %rax
rol    $0x8,%di
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%edx
call   1030 <multosBinToHex@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @multosWordToHex(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca [2 x i8]
store i16 %0, i16* %3
store i8* %1, i8** %4
%6 = load i16, i16* %3
%7 = zext i16 %6 to i32
%8 = sdiv i32 %7, 256
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %9, i8* %10
%11 = load i16, i16* %3
%12 = trunc i16 %11 to i8
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %12, i8* %13
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%15 = load i8*, i8** %4
%16 = call i32 @multosBinToHex(i8* %14, i8* %15, i32 2)
ret void
}

LLVM IR (-O2):
define void @multosWordToHex(i16 zeroext %0, i8* %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %0, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %0 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @multosBinToHex(i8* %4, i8* %1, i32 2)
ret void
}
/* Variables and functions */
int to_erl(int, char **);
int main(int argc, char **argv) { return to_erl(argc, argv); }


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 <to_erl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <to_erl@plt>

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 @to_erl(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @to_erl(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MemoryGetWordAt(int /*<<< orphan*/);
int /*<<< orphan*/ OperandGetValue();
int /*<<< orphan*/ PrintAWord(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void Write(void) {
  PrintAWord(MemoryGetWordAt(OperandGetValue()));
  puts("");
}


x86 assembly (clang, -O0):
<Write>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <OperandGetValue@plt>
mov    %eax,%edi
call   1030 <MemoryGetWordAt@plt>
mov    %eax,%edi
call   1060 <PrintAWord@plt>
lea    0xea0(%rip),%rdi
call   1040 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Write>:
push   %rax
xor    %eax,%eax
call   1050 <OperandGetValue@plt>
mov    %eax,%edi
call   1030 <MemoryGetWordAt@plt>
mov    %eax,%edi
call   1060 <PrintAWord@plt>
mov    $0xa,%edi
pop    %rax
jmp    1040 <putchar@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @Write() {
%1 = call i32 (...) @OperandGetValue()
%2 = call i32 @MemoryGetWordAt(i32 %1)
%3 = call i32 @PrintAWord(i32 %2)
%4 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @Write() {
%1 = tail call i32 (...) @OperandGetValue()
%2 = tail call i32 @MemoryGetWordAt(i32 %1)
%3 = tail call i32 @PrintAWord(i32 %2)
%4 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
bool SHAREMIND_MAP_KEY_EQUALS_int(int const k1, int const k2) {
  return k1 == k2;
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_EQUALS_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAREMIND_MAP_KEY_EQUALS_int>:
xor    %eax,%eax
cmp    %esi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int(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 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_EQUALS_int(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char *strchr(char *, int);
char *str_split_at(char *string, int delimiter) {
  char *cp;
  if ((cp = strchr(string, delimiter)) != NULL)
    *cp++ = 0;
  return (cp);
}


x86 assembly (clang, -O0):
<str_split_at>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114b <str_split_at+0x3b>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_split_at>:
push   %rax
call   1030 <strchr@plt>
test   %rax,%rax
je     1127 <str_split_at+0x17>
mov    %rax,%rcx
add    $0x1,%rax
movb   $0x0,(%rcx)
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @str_split_at(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @strchr(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %5
store i8 0, i8* %11
br label %13
13: ; preds = %10, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
define i8* @str_split_at(i8* %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
store i8 0, i8* %3
br label %7
7: ; preds = %5, %2
%8 = phi i8* [ %6, %5 ], [ null, %2 ]
ret i8* %8
}
double absolute(double a) {
  if (a > 0.0)
    return a;
  else
    return -1.0 * a;
}


x86 assembly (clang, -O0):
<absolute>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <absolute+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113c <absolute+0x3c>
movsd  0xece(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<absolute>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @absolute(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fmul double -1.000000e+00, %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @absolute(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
unsigned int FREE_MEM_SIZE_GET(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @FREE_MEM_SIZE_GET() {
ret i32 0
}
int calc_lowcomp1(int a, int b0, int b1, int c) {
  if ((b0 + 256) == b1) {
    a = c;
  } else if (b0 > b1) {
    a = ((a - 64) > (0) ? (a - 64) : (0));
  }
  return a;
}


x86 assembly (clang, -O0):
<calc_lowcomp1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x100,%eax
cmp    -0xc(%rbp),%eax
jne    112c <calc_lowcomp1+0x2c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <calc_lowcomp1+0x6a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1165 <calc_lowcomp1+0x65>
mov    -0x4(%rbp),%eax
sub    $0x40,%eax
cmp    $0x0,%eax
jle    1155 <calc_lowcomp1+0x55>
mov    -0x4(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <calc_lowcomp1+0x5f>
xor    %eax,%eax
mov    %eax,-0x14(%rbp)
jmp    115f <calc_lowcomp1+0x5f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <calc_lowcomp1+0x6a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_lowcomp1>:
mov    %ecx,%eax
lea    0x100(%rsi),%ecx
cmp    %edx,%ecx
je     111e <calc_lowcomp1+0x1e>
cmp    %edx,%esi
jle    111f <calc_lowcomp1+0x1f>
cmp    $0x41,%edi
mov    $0x40,%eax
cmovge %edi,%eax
add    $0xffffffc0,%eax
ret
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @calc_lowcomp1(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* %6
%10 = add nsw i32 %9, 256
%11 = load i32, i32* %7
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %8
store i32 %14, i32* %5
br label %30
15: ; preds = %4
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %29
19: ; preds = %15
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 64
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 64
br label %27
26: ; preds = %19
br label %27
27: ; preds = %26, %23
%28 = phi i32 [ %25, %23 ], [ 0, %26 ]
store i32 %28, i32* %5
br label %29
29: ; preds = %27, %15
br label %30
30: ; preds = %29, %13
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @calc_lowcomp1(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, 256
%6 = icmp eq i32 %5, %2
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = icmp sgt i32 %1, %2
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = icmp sgt i32 %0, 64
%11 = select i1 %10, i32 %0, i32 64
%12 = add nsw i32 %11, -64
br label %13
13: ; preds = %4, %7, %9
%14 = phi i32 [ %12, %9 ], [ %0, %7 ], [ %3, %4 ]
ret i32 %14
}
int main() {
  int arg1 = 46;
  int add = 0;
  __asm__("addl $0xF, %%eax;" : "=a"(add) : "a"(arg1));
  return add;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2e,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 46, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "addl $$0xF, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "addl $$0xF, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 46)
ret i32 %1
}
/* Variables and functions */
int f1(int, int);
int f2(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", f1(2, 1));
  printf("%d\n", f2(5, 3, 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <f1@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <f2@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2,%edi
mov    $0x1,%esi
call   1050 <f1@plt>
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x5,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <f2@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f1(i32 2, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @f2(i32 5, i32 3, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void SteamAPI_vr_IVRCompositor_SetGamma(void *self, float fGamma) {
  xlogf("%s(self = %p, fGamma = %f)\n", __func__, self, fGamma);
}


x86 assembly (clang, -O0):
<SteamAPI_vr_IVRCompositor_SetGamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xecb(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x1,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_vr_IVRCompositor_SetGamma>:
mov    %rdi,%rdx
cvtss2sd %xmm0,%xmm0
lea    0xee2(%rip),%rdi
lea    0xef7(%rip),%rsi
mov    $0x1,%al
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s(self = %p, fGamma = %f)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_SetGamma = [35 x i8] c"SteamAPI_vr_IVRCompositor_SetGamma\00"
define void @SteamAPI_vr_IVRCompositor_SetGamma(i8* %0, float %1) {
%3 = alloca i8*
%4 = alloca float
store i8* %0, i8** %3
store float %1, float* %4
%5 = load i8*, i8** %3
%6 = load float, float* %4
%7 = fpext float %6 to double
%8 = call i32 (i8*, i8*, i8*, double, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, double, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRCompositor_SetGamma, i64 0, i64 0), i8* %5, double %7)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s(self = %p, fGamma = %f)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_SetGamma = [35 x i8] c"SteamAPI_vr_IVRCompositor_SetGamma\00"
define void @SteamAPI_vr_IVRCompositor_SetGamma(i8* %0, float %1) {
%3 = fpext float %1 to double
%4 = tail call i32 (i8*, i8*, i8*, double, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, double, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @__func__.SteamAPI_vr_IVRCompositor_SetGamma, i64 0, i64 0), i8* %0, double %3)
ret void
}